Propagate W3C trace context across HTTP and messaging, create spans around meaningful dependencies, and put trace/span IDs in structured logs. Use OpenTelemetry so instrumentation can export to different backends. Example: builder.Services.AddOpenTelemetry() .WithTracing(t => t.AddAspNetCoreInstrumentation() .AddHttpClientInstrumentation() .AddEntityFrameworkCoreInstrumentation()); Log stable fields such as operation, outcome, tenant ID, and duration; never log tokens, passwords, full request bodies, or unnecessary personal data. Sample high-volume success traces but retain errors intelligently. Correlation IDs help support, while distributed traces show causal timing. Define alerts from service-level signals—latency, errors, traffic, saturation—and test that context survives queue boundaries.
Backbencher Developer · · 0 likes