Skip to main content

Module trace_layer

Module trace_layer 

Source
Expand description

Trace propagation utilities for Problem responses

This module provides helper traits and functions to automatically enrich Problem with trace context:

  • trace_id: extracted from the current tracing span
  • instance: extracted from the request URI

This eliminates per-callsite boilerplate and ensures consistent error reporting.

Traitsยง

WithRequestContext
Middleware-friendly: enrich errors from Axum extractors
WithTraceContext
Helper trait for enriching Problem with trace context