File tree Expand file tree Collapse file tree 4 files changed +332
-274
lines changed
Expand file tree Collapse file tree 4 files changed +332
-274
lines changed Original file line number Diff line number Diff line change @@ -827,6 +827,12 @@ class SPANDATA:
827827 Example: "pipe" (stdio), "tcp" (HTTP/WebSocket/SSE)
828828 """
829829
830+ MCP_SESSION_ID = "mcp.session.id"
831+ """
832+ The session identifier for the MCP connection.
833+ Example: "a1b2c3d4e5f6"
834+ """
835+
830836
831837class SPANSTATUS :
832838 """
Original file line number Diff line number Diff line change @@ -27,9 +27,15 @@ def setup_once():
2727 Patches MCP server classes to instrument handler execution.
2828 """
2929 from sentry_sdk .integrations .mcp .lowlevel import patch_lowlevel_server
30+ from sentry_sdk .integrations .mcp .transport import (
31+ patch_streamable_http_transport ,
32+ )
3033
3134 # Patch server classes to instrument handlers
3235 patch_lowlevel_server ()
3336
37+ # Patch HTTP transport to track session IDs
38+ patch_streamable_http_transport ()
39+
3440
3541__all__ = ["MCPIntegration" ]
You can’t perform that action at this time.
0 commit comments