Azure / Azure/data-api-builder
[Bug]: No MCP tool invocation trace spans
- Vorherrschende Sprache
- C#
- Sterne
- 1.5k
- Forks
- 370
- Ø Merge
- 3 T. 22 Std.
- Gemergte PRs (30 T.)
- 9
Beschreibung
MCP tool calls (describe_entities, read_records, create_record, update_record, delete_record, aggregate_records) produce log records but no trace spans. You cannot see MCP tool execution in a trace waterfall or measure individual tool latency via traces.
## Expected
Each MCP tool invocation should produce a span with the tool name and result:
```
Span: MCP tool/call describe_entities
Kind: Server
Duration: 37ms
Attributes:
mcp.tool.name = describe_entities
mcp.session.id = oHJsLuTRTyN3En34uxhxmg
rpc.method = tools/call
```
The code paths already exist — DAB has log instrumentation scopes `Azure.DataApiBuilder.Mcp.BuiltInTools.CreateRecordTool` and `Azure.DataApiBuilder.Mcp.BuiltInTools.ReadRecordsTool`, proving these tool boundaries are identified in code.
## Actual
MCP tool calls appear only as logs, not trace spans. The `ModelContextProtocol.Server.McpServer` scope emits log records for tool execution, but there is no corresponding `Activity` or span created:
```
InstrumentationScope Azure.DataApiBuilder.Mcp.BuiltInTools.ReadRecordsTool
LogRecord #0 (log only, no span)
```
Beitragsleitfaden
Rechercherichtung
Beginne damit, die MCP-Tool-Grenzen zu lokalisieren, die durch die Instrumentierungsbereiche von Azure.DataApiBuilder.Mcp.BuiltInTools.CreateRecordTool und ReadRecordsTool identifiziert werden, und untersuche anschließend, wie ModelContextProtocol.Server.McpServer Logs zur Tool-Ausführung ausgibt. Füge für die aufgelisteten MCP-Tools Trace-Spans mit dem Toolnamen, der Sitzungs-ID, der RPC-Methode, der Serverart und dem Ergebnis hinzu und überprüfe, dass die Latenz einzelner Tools in Trace-Wasserfalldiagrammen erscheint.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- csharp
- Bereich
- backend-api-design, observability
- Issue-Typ
- Bug
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Aktivitätsstatus
- Ruhig
- Klarheit
- Größtenteils klar
- Anfängerfreundlichkeit
- 52/100