Skip to content

docs: clarify OpenTelemetry spans for resources and prompts#3077

Open
Joosboy wants to merge 1 commit into
modelcontextprotocol:mainfrom
Joosboy:docs-otel-resources-prompts
Open

docs: clarify OpenTelemetry spans for resources and prompts#3077
Joosboy wants to merge 1 commit into
modelcontextprotocol:mainfrom
Joosboy:docs-otel-resources-prompts

Conversation

@Joosboy

@Joosboy Joosboy commented Jul 8, 2026

Copy link
Copy Markdown

What changed

  • Expanded the OpenTelemetry docs example to include a resource and a prompt.
  • Clarified that resources/read and prompts/get are traced by the same request-level server middleware as tools.
  • Documented that prompts/get gets gen_ai.prompt.name, while resources/read currently carries the common MCP attributes without adding the resource URI to the span name or gen_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.py
  • uv run pytest tests/docs_src/test_shape.py
  • uv run pytest tests/server/test_otel.py
  • uv run ruff check docs_src/opentelemetry tests/docs_src/test_opentelemetry.py
  • uv run ruff format --check docs_src/opentelemetry tests/docs_src/test_opentelemetry.py
  • uv run pyright docs_src/opentelemetry tests/docs_src/test_opentelemetry.py
  • uv 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.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 3 files

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant