Repository navigation
Conversation
This was referenced Oct 5, 2026
betegon
force-pushed
the
bt/mcp-otel-attributes
branch
from
October 13, 2026 08:51
b85a9ff to
a038085
Compare
Contributor
size-limit report 📦
|
betegon
added a commit
that referenced
this pull request
Oct 13, 2026
Use `@sentry/conventions/attributes` for registered MCP keys, including
all singleton and indexed result fields. The branch now uses published
conventions `0.27.0` from `develop`, so both local result prefixes can
be removed.
Before, the SDK constructed `mcp.tool.result.0.content` from a local
prefix. After, `MCP_TOOL_RESULT_KEY_CONTENT.replace('<key>', '0')`
produces that same key. Singleton keys, values, original array indexes,
and input/output capture behavior remain unchanged. Deprecated
tool-result fields stay emitted for compatibility; this change adds no
aliases or backfill.
This is the mechanical base for network metadata (#24506), OAuth
attribution (#24508), and canonical OpenTelemetry attributes (#25060).
The latter separately adds complete serialized results in
`gen_ai.tool.call.result`.
betegon
force-pushed
the
bt/mcp-otel-attributes
branch
from
October 14, 2026 08:52
a038085 to
29abc47
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MCP spans emit legacy names and flattened content without the canonical OpenTelemetry attributes. Add JSON-RPC request IDs, GenAI tool/prompt names, tool-only
execute_tool, case-sensitive prompt variables, and serialized tool arguments and successful results, following the OpenTelemetry MCP conventions. Preserve legacy attributes and the existing input/output capture options.For a successful tool result with
content: [{ type: "text", text: "Hello" }], before we emit only flattened fields such asmcp.tool.result.content = "Hello". After we also emitgen_ai.tool.call.result = '{"content":[{"type":"text","text":"Hello"}]}'. Multiple blocks remain an array inside that JSON value; existing indexed legacy keys remain unchanged.Canonical content excludes protocol metadata and continuation state, and is omitted if serialization fails or exceeds the 20,000-character Sentry capture budget. Structured tool output supports any JSON value. Real MCP SDK v1/v2 coverage checks streamed spans in ESM/CJS with capture enabled and disabled.
#25059 is merged; this branch is rebased on develop and uses published
@sentry/conventions@0.27.0. Before releasing this payload change, confirm the conventions deployment in Snuba and the Sentry backend, then Relay, and deploy Relay #6511 and Sentry #127361 for scrubbing and frontend compatibility. Merge status alone does not establish deployment. Network metadata (#24506) and OAuth attribution (#24508) remain separate changes.Validated the 48-project SDK build, formatting and lint, 168 MCP unit tests, and eight real MCP SDK v1/v2 ESM/CJS integration tests after rebase.