Azure / Azure/data-api-builder
[Bug]: No MCP tool invocation trace spans
- Dominant language
- C#
- Stars
- 1.5k
- Forks
- 370
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 8
Description
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)
```
Contributor guide
Assessment
This issue has not been assessed yet.