Observability
You don't operate what you can't see. Structured logging, OpenTelemetry across logs/metrics/traces, distributed tracing (W3C TraceContext, Activity, the pitfalls of Activity.Current across Task.Run), exporters (OTLP / Prometheus / App Insights), and the full diagnostic toolbox.
Topics (canonical order)
-
Microsoft.Extensions.Logging,[LoggerMessage]source-gen, Serilog, correlation IDs, log levels -
OpenTelemetry — Traces, Metrics, Logs
The three pillars,
ActivitySourceandMeter, semantic conventions -
W3C TraceContext, baggage,
Activity.Currentpitfalls inTask.Run, span linking -
OTLP (default), Prometheus scrape, Application Insights bridge, batch vs simple
-
dotnet-trace,dotnet-counters,dotnet-dump,!syncblk, PerfView, threadpool starvation diagnosis -
Head-based vs tail-based, parent-based, adaptive, OTEL Collector tail_sampling processor
-
Volume math, hot/warm/cold tiering, log shipping, sampling rules, cost dashboards
-
Agent vs gateway, processors (batch, memory_limiter, attributes, OTTL, tail_sampling), HA
-
Pixie, Cilium Tetragon, Parca; zero-app-change kernel-level tracing; .NET specifics
Why this order
Logging is the gateway drug; everyone has it. OTel is the modern unified replacement, so it follows. Distributed tracing is the most senior-relevant pillar because it's where async-correlation pitfalls bite. Exporters come next because choice depends on platform. Diagnostic tools close the section because they're the "now what?" when you suspect a problem.
Cross-references
Activity.Currentpitfalls connect to Async/Await — State Machine (ExecutionContext flow).- Logging source-gen connects to Source Generators & Analyzers.
- Distributed tracing feeds AI Observability (GenAI semantic conventions).