Tracing
Distributed tracing with OpenTelemetry: traces and spans, Activity and ActivitySource, W3C trace context and baggage, context propagation through messages, sampling, Jaeger, Zipkin and Application Insights.
-
What is distributed tracing? Explain traces, spans and parent/child relationships, what a trace id and span id are, and why logs alone aren't enough to understand a request that crosses several services.
Covers what distributed tracing is, the trace and span model with parent/child links and ids, and why correlated logs alone can't show where time goes across services.
Junior
Theory
Tracing
Β· π 3 follow-ups
-
What are Activity and ActivitySource in .NET, and how do they map to OpenTelemetry spans? Explain how you create an Activity, why StartActivity can return null, what Activity.Current is, and how tags, events, status and ActivityKind correspond to the OpenTelemetry span model.
Covers System.Diagnostics.Activity and ActivitySource as .NET's span API, listeners and sampling (null activities), Activity.Current flow, and the mapping of tags, events, status, kind and links to OpenTelemetry.
Intermediate
Theory
Tracing
Β· π 3 follow-ups Β· π 1 real-world
-
Show me how you add custom spans and attributes to a .NET 10 service and propagate the trace context through Azure Service Bus messages so the consumer's work appears in the same trace. Cover Producer and Consumer spans, injecting and extracting the context, messaging semantic conventions, and when to use span links instead of parent/child.
Covers writing custom spans with ActivitySource, injecting and extracting W3C trace context through Service Bus application properties, Producer/Consumer span kinds, messaging semantic conventions, span links for batches, and the Azure SDK's experimental tracing flag.
Mid-Level
Coding
Tracing
Β· π 3 follow-ups Β· π 1 real-world
-
Explain W3C Trace Context. What is in the traceparent and tracestate headers, what is W3C Baggage and when should you use it, how does .NET propagate these headers (and what changed in .NET 10), and how do you handle trace context when crossing into other vendors' systems or accepting it from the public internet?
Covers the traceparent and tracestate formats, the sampled flag, W3C Baggage and its risks, DistributedContextPropagator and the .NET 10 switch to the W3C propagator, interoperating with B3 and vendors, and trust boundaries at the public edge.
Mid-Level
Theory
Tracing
Β· π 3 follow-ups Β· π 1 real-world
-
How do you sample traces in production? Compare head-based and tail-based sampling, explain parent-based and trace-id-ratio samplers, how you make sure errors and slow requests are always kept, what Application Insights and the Azure Monitor distro do, and how you balance cost against visibility.
Covers head sampling (ParentBased, TraceIdRatioBased, rate-limited), tail sampling in the OpenTelemetry Collector with its load-balancing requirement, keeping errors and slow traces, Azure Monitor sampling and item counts, and the cost/visibility trade-off.
Senior
Theory
Tracing
Β· π 3 follow-ups Β· π 1 real-world
-
Your traces are broken. In Application Insights a checkout shows the API request but not the downstream pricing call's server span, background jobs and Service Bus consumers appear as separate traces, and some traces have orphan spans with missing parents. How do you find where trace context is being lost, and how do you fix each cause?
Covers diagnosing broken distributed traces: confirming propagation on the wire, missing AddSource or instrumentation, inconsistent sampling, gateways stripping headers, Activity.Current lost across queues and background work, messaging without propagation, mixed propagation formats and split backends.
Senior
Debugging
Tracing
Β· π 3 follow-ups Β· π 1 real-world
-
Jaeger, Zipkin, Grafana Tempo or Application Insights: what does each give you as a tracing backend, how do you get traces into them from .NET using OTLP and the OpenTelemetry Collector, and how would you choose for a team running .NET 10 services on Azure?
Compares Jaeger v2, Zipkin, Grafana Tempo and Application Insights on features, storage, cost and operations, explains OTLP export directly or via the Collector, the deprecated Zipkin exporter, and a decision approach for Azure-hosted .NET teams.
Mid-Level
Theory
Tracing
Β· π 3 follow-ups Β· π 1 real-world