| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
Here is example output tools/call
├── Span: 'MCP handle tools/call greet' kind=SERVER
│ trace_id: 0xbd62f33a2a8bca7fce981401e9e1fa37
│ ├── gen_ai.operation.name: 'execute_tool'
│ ├── gen_ai.tool.name: 'greet'
│ ├── jsonrpc.request.id: '1'
│ ├── mcp.method.name: 'tools/call'
│ └── rpc.system: 'mcp'
└── Span: 'MCP send tools/call greet' kind=CLIENT
trace_id: 0xbd62f33a2a8bca7fce981401e9e1fa37 ← same trace, context propagated
├── gen_ai.operation.name: 'execute_tool'
├── gen_ai.tool.name: 'greet'
├── jsonrpc.request.id: '1'
├── mcp.method.name: 'tools/call'
└── rpc.system: 'mcp'
tools/list
├── Span: 'MCP handle tools/list' kind=SERVER
│ trace_id: 0xb34caa9e9dbe2748b4b3e37847bd4545
│ ├── gen_ai.operation.name: 'list_tools'
│ ├── jsonrpc.request.id: '1'
│ ├── mcp.method.name: 'tools/list'
│ └── rpc.system: 'mcp'
└── Span: 'MCP send tools/list' kind=CLIENT
trace_id: 0xb34caa9e9dbe2748b4b3e37847bd4545
├── gen_ai.operation.name: 'list_tools'
├── jsonrpc.request.id: '1'
├── mcp.method.name: 'tools/list'
└── rpc.system: 'mcp'
resources/read
├── Span: 'MCP handle resources/read' kind=SERVER
│ trace_id: 0x6f0d7ecaaea9cb4453f7a9e453f923b6
│ ├── gen_ai.operation.name: 'read_resource'
│ ├── jsonrpc.request.id: '1'
│ ├── mcp.method.name: 'resources/read'
│ ├── mcp.resource.uri: 'test://greeting'
│ └── rpc.system: 'mcp'
└── Span: 'MCP send resources/read' kind=CLIENT
trace_id: 0x6f0d7ecaaea9cb4453f7a9e453f923b6
├── gen_ai.operation.name: 'read_resource'
├── jsonrpc.request.id: '1'
├── mcp.method.name: 'resources/read'
├── mcp.resource.uri: 'test://greeting'
└── rpc.system: 'mcp'
|
Sorry, something went wrong.
…, add gen_ai.prompt.name for prompts/get
|
Thanks for the PR. This has since landed via #2970. I'm closing this out as part of a backlog cleanup now that v2 is out. Feel free to reopen if this is still relevant. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The existing otel_middleware and client-side spans only emitted mcp.method.name and jsonrpc.request.id. This enriches them with attributes defined in the OTel GenAI MCP semantic conventions:
Motivation and Context
The SDK already ships otel_middleware in src/mcp/server/runner.py producing SpanKind.SERVER spans with W3C trace context propagation. Aligning the native span attributes with the GenAI semconv spec means every MCP-based framework and every distribution gets conformant telemetry without independently re-implementing span plumbing.
How Has This Been Tested?
Adds three tests to tests/shared/test_otel.py:
Types of changes
Checklist
Additional context