docs: clarify OpenTelemetry spans for resources and prompts
Closed
JO
18d ago+50+50+01234567890123456789-4-4-0123456789
What changed
- Expanded the OpenTelemetry docs example to include a resource and a prompt.
- Clarified that
resources/readandprompts/getare traced by the same request-level server middleware as tools. - Documented that
prompts/getgetsgen_ai.prompt.name, whileresources/readcurrently carries the common MCP attributes without adding the resource URI to the span name orgen_ai.*attributes. - Added a docs-source test that verifies the resource and prompt span behavior.
Why it changed
Issue #766 asks where instrumentation for resources and prompts should happen. The docs already covered tool spans, but resource and prompt behavior was less explicit.
How it was validated
uv run pytest tests/docs_src/test_opentelemetry.pyuv run pytest tests/docs_src/test_shape.pyuv run pytest tests/server/test_otel.pyuv run ruff check docs_src/opentelemetry tests/docs_src/test_opentelemetry.pyuv run ruff format --check docs_src/opentelemetry tests/docs_src/test_opentelemetry.pyuv run pyright docs_src/opentelemetry tests/docs_src/test_opentelemetry.pyuv run mkdocs build --strict
Related issue
Refs #766
Disclosure: AI assistance was used while preparing this PR; I reviewed the changes and take responsibility for them.