Add richer OTel MCP span attributes #2387
Open
Claude / Claude Code Review
completed
Apr 3, 2026 in 18m 32s
Code review found 1 important issue
Found 5 candidates, confirmed 4. See review comments for details.
Details
| Severity | Count |
|---|---|
| 🔴 Important | 1 |
| 🟡 Nit | 0 |
| 🟣 Pre-existing | 0 |
| Severity | File:Line | Issue |
|---|---|---|
| 🔴 Important | src/mcp/shared/_otel.py:40-57 |
build_client_span_attributes missing mcp.session.id - client/server span asymmetry |
Annotations
Check failure on line 57 in src/mcp/shared/_otel.py
claude / Claude Code Review
build_client_span_attributes missing mcp.session.id - client/server span asymmetry
build_client_span_attributes has no session_id parameter, so client spans can never carry the mcp.session.id attribute while server spans for the same session can — creating an observability asymmetry. The PR description's claim that 'mcp.session.id is surfaced on the client side through the streamable HTTP write stream wrapper' is factually incorrect: commit 67ca7fe in this same branch explicitly removed that wrapper without adding a replacement. To fix this, add a session_id parameter to build
Loading