Skip to content

docs: clarify OpenTelemetry spans for resources and prompts - #3077

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

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

@maxisbey

maxisbey commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Thanks for the PR, and sorry it sat here without a proper review.

We're closing most of the open PR backlog. v2 is out and changed a lot of the SDK, so many older PRs no longer apply as written, and we're a small team that realistically doesn't have the capacity to work through the rest.

If this still matters to you on v2, the most useful thing you can do is open an issue (or comment on the existing one) with your use case and a repro. Hearing why it matters to you is what we use to decide what to prioritise.

AI Disclaimer

@maxisbey maxisbey closed this Oct 5, 2026
@maxisbey maxisbey added the missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md) label Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

missing-issue-link Auto-closed: PR needs a linked issue assigned to its author (see CONTRIBUTING.md)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants