Azure / Azure/data-api-builder
[Bug]: No MCP tool invocation trace spans
- 主要言語
- C#
- スター
- 1.5k
- フォーク
- 370
- 平均マージ
- 3日 22時間
- マージ済み PR(30日)
- 9
説明
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)
```
コントリビューションガイド
調査の方向性
まず、Azure.DataApiBuilder.Mcp.BuiltInTools.CreateRecordTool と ReadRecordsTool のインストルメンテーションスコープによって特定される MCP ツールの境界を見つけ、次に ModelContextProtocol.Server.McpServer がツール実行ログをどのように出力するかを調べます。列挙された MCP ツールに対して、ツール名、セッション ID、RPC メソッド、サーバー種別、結果を含むトレーススパンを追加し、個々のツールのレイテンシーがトレースのウォーターフォールに表示されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- csharp
- 領域
- backend-api-design, observability
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 静か
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 52/100