Add network/client span attributes and fix span status per OTEL semconv - #3750
Merged
Merged
Conversation
Add new additive span attributes: - network.protocol.version from incoming HTTP request - client.address and client.port from RemoteAddr - mcp.session.id from Mcp-Session-Id header - error.type on 5xx errors Fix span status to follow OTEL semantic conventions: - 4xx responses now leave span status Unset (client errors) - 5xx responses set Error with error.type attribute - 2xx/3xx remain Ok Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ChrisJBurns
requested review from
JAORMX,
jerm-dro and
yrobla
as code owners
February 10, 2026 17:35
JAORMX
previously approved these changes
Feb 10, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3750 +/- ##
==========================================
+ Coverage 66.39% 66.41% +0.01%
==========================================
Files 427 427
Lines 41864 41894 +30
==========================================
+ Hits 27797 27825 +28
Misses 11956 11956
- Partials 2111 2113 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Use network.protocol.version for the incoming HTTP request protocol and mcp.backend.protocol.version for the backend transport protocol, avoiding a silent overwrite when the two differ (e.g., HTTP/2 client with SSE/HTTP1.1 backend). Also add negative test for mcp.session.id when header is absent. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
JAORMX
approved these changes
Feb 10, 2026
11 tasks
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.
Summary
network.protocol.versionfrom incoming HTTP request protocolmcp.backend.protocol.versionfrom backend transport (SSE→"1.1", streamable-http→"2")client.addressandclient.portfrom RemoteAddrmcp.session.idfromMcp-Session-Idheadererror.typeon 5xx errorsUnset(client errors, not server errors per OTEL spec)Errorwitherror.typeattributeOk(unchanged)addNetworkAttributeshelper to keep cyclomatic complexity within limitsProtocol version attributes:
network.protocol.version"2"(HTTP/2 client)mcp.backend.protocol.version"1.1"(SSE backend)Stacked on #3748 (attribute renames) and #3747 (feature flag).
Test plan
httpProtocolVersionhelperparseRemoteAddrhelperclient.address,client.port,mcp.session.idattributesmcp.session.idwhen header absenterror.typetask lintpassestask testpasses🤖 Generated with Claude Code