Kladde.ServiceDefaults is the most unassuming project in the Kladde. It has no page and no table, and yet its code runs in every process: in the web app, in the worker, in the import, in the migrations and, since lesson 3.14.2, in the TED stub. Since K2 2.9.3, five lessons have changed it. This lesson reads it as a whole, takes a closer look at the dashboard that shows its telemetry, and closes a gap that has been closed only by discipline since K2.

What the service defaults do today

The template from K2 created Extensions.cs with four jobs. The Kladde has changed each of them on purpose since then:

Job in the template in the Kladde since
OpenTelemetry logs, metrics and traces from ASP.NET Core, HttpClient and the runtime; OTLP only if OTEL_EXPORTER_OTLP_ENDPOINT is set plus AddSource("Kladde.*") and AddMeter("Kladde.*"); to the dashboard or to Application Insights through the Microsoft OpenTelemetry distro (TelemetryExport) 3.4.2, 3.4.3
Health checks self with the tag live; /health and /alive only in Development /health/live and /health/ready in every environment, without sign-in and without a measured value K2 2.9.3, 3.4.5
Service discovery for every HttpClient unchanged
Resilience AddStandardResilienceHandler() for every HttpClient deleted: each client decides for itself, none retries a POST K2 2.9.3, 3.9.2

This table belongs in the README of Kladde.ServiceDefaults. The template is code that belongs to you, and whoever sees a new version of the template should know which deviations are deliberate before they “update” them.