Skip to content

DRAFT: Rename telemetry span attributes to OTEL MCP semantic conventions - #3734

Closed
ChrisJBurns wants to merge 1 commit into
mainfrom
otel/pr2a-attribute-rename
Closed

ChrisJBurns wants to merge 1 commit into
mainfrom
otel/pr2a-attribute-rename

Conversation

@ChrisJBurns

Copy link
Copy Markdown
Collaborator

Summary

  • Renames existing span attributes to align with OpenTelemetry HTTP and MCP semantic conventions
  • Adds dual emission: new names are always emitted, old names conditionally emitted when UseLegacyAttributes=true (the default)
  • Adds mapTransport helper to convert MCP transport types to OTEL network.transport values
  • Updates span naming: mcp.tools/calltools/call github_search (method + resource target)

Key attribute renames:

Old New
http.method http.request.method
mcp.method mcp.method.name
mcp.request.id jsonrpc.request.id
mcp.tool.name gen_ai.tool.name
mcp.transport network.transport

See docs/telemetry-migration.md for the full mapping and migration guide.

Stacked on #3729 (adds the UseLegacyAttributes flag).

Test plan

  • Unit tests for dual emission (HTTP, MCP, method-specific, finalizeSpan attributes)
  • Unit tests for mapTransport helper
  • Unit tests for updated span naming
  • Integration test with UseLegacyAttributes=true verifies both old and new names present
  • Integration test with UseLegacyAttributes=false verifies only new names present
  • task lint passes
  • task test passes

🤖 Generated with Claude Code

@github-actions github-actions Bot added the size/L Large PR: 600-999 lines changed label Feb 9, 2026
@ChrisJBurns ChrisJBurns changed the title Rename telemetry span attributes to OTEL MCP semantic conventions DRAFT: Rename telemetry span attributes to OTEL MCP semantic conventions Feb 9, 2026
Base automatically changed from otel/add-use-legacy-attributes-flag to main February 10, 2026 14:17
Rename existing span attributes to align with the OpenTelemetry HTTP and
MCP semantic conventions, with dual emission of both old and new names
controlled by the UseLegacyAttributes flag (defaults to true).

Attribute renames:
- HTTP: http.method → http.request.method, http.url → url.full, etc.
- MCP: mcp.method → mcp.method.name, mcp.request.id → jsonrpc.request.id
- Tools: mcp.tool.name → gen_ai.tool.name, mcp.prompt.name → gen_ai.prompt.name
- Transport: mcp.transport → network.transport
- Response: http.status_code → http.response.status_code

When UseLegacyAttributes is true (the default), both old and new attribute
names are emitted for backward compatibility with existing dashboards.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@ChrisJBurns
ChrisJBurns force-pushed the otel/pr2a-attribute-rename branch from 329ed9e to 2aa273b Compare February 10, 2026 14:25
@github-actions github-actions Bot added size/L Large PR: 600-999 lines changed and removed size/L Large PR: 600-999 lines changed labels Feb 10, 2026
@codecov

codecov Bot commented Feb 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.69892% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 66.40%. Comparing base (cf2c338) to head (2aa273b).

Files with missing lines Patch % Lines
pkg/telemetry/middleware.go 95.69% 3 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3734      +/-   ##
==========================================
+ Coverage   66.31%   66.40%   +0.09%     
==========================================
  Files         427      427              
  Lines       41800    41860      +60     
==========================================
+ Hits        27718    27796      +78     
+ Misses      11971    11953      -18     
  Partials     2111     2111              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ChrisJBurns

Copy link
Copy Markdown
Collaborator Author

Superseded by #3747 and #3748 — split into two smaller, more reviewable PRs:

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

Labels

size/L Large PR: 600-999 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant