mirror of
https://github.com/PrefectHQ/fastmcp.git
synced 2026-09-01 20:13:19 +02:00
Enable distributed tracing across protocols that don't support HTTP headers (like SSE) by propagating W3C Trace Context through MCP _meta fields. - Add propagate_context parameter (default: True) to OpenTelemetryMiddleware - Implement _extract_trace_context() to read traceparent/tracestate from request metadata - Implement _inject_trace_context() to write trace context to response metadata - Update all operation handlers to extract parent context and inject into results - Add comprehensive test coverage for context propagation - Update documentation with examples and configuration details This enables trace continuity across MCP calls, allowing clients to link server spans to their traces and propagate context downstream. Co-authored-by: William Easton <strawgate@users.noreply.github.com> |
||
|---|---|---|
| .. | ||
| __init__.py | ||
| test_caching.py | ||
| test_error_handling.py | ||
| test_initialization_middleware.py | ||
| test_logging.py | ||
| test_middleware.py | ||
| test_opentelemetry_middleware.py | ||
| test_rate_limiting.py | ||
| test_timing.py | ||
| test_tool_injection.py | ||