Skip to main content

Module

W3C trace-context middleware for Starlette-based applications. TracingMiddleware extracts traceparent and tracestate through the configured OpenTelemetry propagator. Applications explicitly own the local Splunk AO logger and trace lifecycle

TracingMiddleware

Attach incoming W3C trace context for the duration of each request.

dispatch

Extract, attach, and reliably detach the request’s trace context.

get_request_logger

Create a request-scoped logger under the middleware’s active context. The caller must explicitly call start_trace() before adding spans and should call terminate() in finally. With an extracted W3C parent, the first real local operation becomes its descendant; without one, it starts a new trace.