fastmcp/tests
strawgate 13d6412741 feat: instrument ctx.sample() / sampling loop with OpenTelemetry spans
Add OTEL tracing to the sampling pipeline:
- `sampling/createMessage` span wrapping sample_impl() with attributes for
  temperature, max_tokens, tool_count, result_type, and iteration count
- `sampling/createMessage step` child spans per loop iteration with
  iteration index and stop reason
- `sampling.execute_tool <name>` spans for tool calls within sampling,
  including error status on failures
- Validation failure and text response retry events on the parent span
- Opt-in content capture via OTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT

Also adds is_recording() guards to server_span, delegate_span, and
client_span to avoid unnecessary attribute serialization when sampling is
disabled, and sets error.type using __qualname__ for better nested class
names.

Closes #3891

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-13 01:28:07 -05:00
..
apps Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
cli Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
client fix: resolve list[dict] return type producing Root() instead of dicts (#3880) 2026-04-12 17:54:00 -04:00
conformance Run MCP conformance tests in CI (#3628) 2026-03-26 22:19:13 -04:00
contrib fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
deprecated fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
docs Fix broken code examples in docs (#3869) 2026-04-12 12:53:04 -04:00
experimental Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
fs fix: filesystem provider import machinery (#3626) 2026-03-26 17:53:12 -04:00
integration_tests Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
prompts Extract parameter descriptions from docstrings (#3872) 2026-04-12 13:43:48 -04:00
resources Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00
server feat: instrument ctx.sample() / sampling loop with OpenTelemetry spans 2026-04-13 01:28:07 -05:00
telemetry Use standard traceparent/tracestate keys per OTel MCP semconv (#3221) 2026-02-18 15:51:24 -05:00
tools fix: strip titles from bare-metadata nodes (Gemini 2.5 Flash) (#3881) 2026-04-12 21:06:27 -04:00
utilities fix: strip titles from bare-metadata nodes (Gemini 2.5 Flash) (#3881) 2026-04-12 21:06:27 -04:00
__init__.py Update type handling for resources 2024-11-29 19:42:46 -05:00
conftest.py Expose minimum_check_interval, reduce task pickup latency (#3500) 2026-03-14 16:08:28 -04:00
test_apps.py Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
test_apps_prefab.py Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
test_fastmcp_app.py Replace ___ with hash-based backend tool routing and per-tool prefab resources (#3824) 2026-04-12 12:52:07 -04:00
test_json_schema_generation.py fix: resolve Pyright "Module is not callable" on @tool, @resource, @prompt decorators (#3540) 2026-03-17 18:11:42 -04:00
test_mcp_config.py Update ty ignore comments for 0.0.25 compatibility (#3614) 2026-03-24 20:26:26 -04:00