Skip to main content

axum_layer

Function axum_layer 

Source
pub fn axum_layer() -> OtelTraceLayer
Expand description

Returns a ready-to-use tower::Layer that extracts W3C trace context from incoming HTTP requests, creates a span with standard HTTP semantic-convention attributes, and injects trace context into response headers.

Requires the axum feature flag.

§Example

use axum::Router;

let app: Router = Router::new()
    // ... add routes ...
    .layer(otel_bootstrap::axum_layer());