Azure / Azure/data-api-builder
[Bug]: No MCP tool invocation trace spans
- Ngôn ngữ chính
- C#
- Star
- 1.5k
- Fork
- 370
- Merge trung bình
- 3 ngày 22 giờ
- Pull request đã merge (30 ngày)
- 9
Mô tả
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)
```
Hướng dẫn đóng góp
Hướng nghiên cứu
Bắt đầu bằng cách xác định các ranh giới của công cụ MCP được nhận diện bởi các phạm vi instrumentation của Azure.DataApiBuilder.Mcp.BuiltInTools.CreateRecordTool và ReadRecordsTool, sau đó kiểm tra cách ModelContextProtocol.Server.McpServer phát ra log thực thi công cụ. Thêm các trace span cho những công cụ MCP được liệt kê, cùng với tên công cụ, ID phiên, phương thức RPC, loại máy chủ và kết quả, rồi xác minh rằng độ trễ của từng công cụ xuất hiện trong các waterfall của trace.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- csharp
- Lĩnh vực
- backend-api-design, observability
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Ít trao đổi
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 52/100