fastmcp/tests/server/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_delegate_method.py OTEL: Instrument all MCP list operations and enrich delegate spans (#3890) 2026-04-16 18:45:50 -04:00
test_list_tracing.py OTEL: Instrument all MCP list operations and enrich delegate spans (#3890) 2026-04-16 18:45:50 -04:00
test_provider_tracing.py Fix ty 0.0.17 diagnostics and bump lockfile 2026-02-16 16:13:38 -05:00
test_sampling_tracing.py Reapply span attributes after creation to survive non-forwarding samplers 2026-07-18 19:52:53 -04:00
test_server_tracing.py Add telemetry off-switch and mcp.protocol.version span attribute (#4481) 2026-07-17 17:02:48 -04:00