Azure / Azure/data-api-builder

[Bug]: No MCP tool invocation trace spans

Open
#3,563 0 comments 0 reactions 0 assignees View on GitHub
2.x telemetry
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

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.