fastmcp/tests/telemetry
Jeremiah Lowin 4207802920
Reapply span attributes after creation to survive non-forwarding samplers
Tracer.start_span builds the span from sampling_result.attributes, not
the attributes kwarg — a custom Sampler that returns
SamplingResult(RECORD_AND_SAMPLE) without forwarding attributes
silently drops everything FastMCP passed at creation time. Reapply the
same attributes immediately after span creation (guarded by
is_recording()) so on_start hooks and samplers still see them, while
the finished span is guaranteed to carry FastMCP's telemetry
regardless of sampler behavior.
2026-07-18 19:52:53 -04:00
..
__init__.py Add OpenTelemetry tracing support 2026-01-14 09:45:41 -05:00
test_module.py Use standard traceparent/tracestate keys per OTel MCP semconv (#3221) 2026-02-18 15:51:24 -05:00
test_span_attributes.py Reapply span attributes after creation to survive non-forwarding samplers 2026-07-18 19:52:53 -04:00