Skip to content

Commit e2c1243

Browse files
committed
consolidate documentation
1 parent 8bf64d4 commit e2c1243

File tree

3 files changed

+55
-86
lines changed

3 files changed

+55
-86
lines changed

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ Each tool call creates a span with:
298298
- Name: `tools/call {tool_name}`
299299
- Attributes: `mcp.method.name`, `mcp.tool.name`, `mcp.request.argument.*`, `mcp.tool.result.*`
300300

301-
See `docs/MCP_TRACING.md` for complete documentation.
301+
See `docs/MCP_TRACING.md` for complete documentation on span conventions, attributes, and examples.
302302

303303
## Security Considerations
304304

docs/MCP_TRACING.md

Lines changed: 54 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,51 @@
22

33
This document describes the MCP (Model Context Protocol) tracing integration with Sentry for the GitHub Actions Utils CLI.
44

5+
## Quick Start
6+
7+
Automatic instrumentation for MCP tool calls that creates Sentry spans following OpenTelemetry conventions.
8+
9+
### Usage
10+
11+
Register a tool with Sentry tracing:
12+
13+
```go
14+
mcp.AddTool(server, &mcp.Tool{
15+
Name: "my_tool",
16+
Description: "My awesome tool",
17+
}, WithSentryTracing("my_tool", m.handleMyTool))
18+
```
19+
20+
That's it! The tool is now automatically traced.
21+
22+
### What Gets Captured
23+
24+
Every tool call creates a span with:
25+
26+
- **Operation**: `mcp.server`
27+
- **Name**: `tools/call my_tool`
28+
- **Attributes**:
29+
- Method name (`mcp.method.name`)
30+
- Tool name (`mcp.tool.name`)
31+
- All arguments (`mcp.request.argument.*`)
32+
- Result metadata (`mcp.tool.result.*`)
33+
- Transport info (`mcp.transport`, `network.transport`)
34+
- Error status (`mcp.tool.result.is_error`)
35+
36+
### Benefits
37+
38+
**Zero boilerplate**: One wrapper function, that's it\
39+
**Type-safe**: Uses Go generics\
40+
**Automatic**: Arguments and results captured automatically\
41+
**Standard**: Follows OpenTelemetry MCP conventions\
42+
**Production-ready**: Error capture, proper span lifecycle
43+
44+
### Disable Telemetry
45+
46+
```bash
47+
export TELEMETRY_ENABLED=false
48+
```
49+
550
## Overview
651

752
The MCP Server integration automatically instruments tool calls with Sentry spans, following the [OpenTelemetry MCP Semantic Conventions](https://github.com/open-telemetry/semantic-conventions/pull/2083). This provides comprehensive observability for MCP tool execution, including:
@@ -18,7 +63,7 @@ The implementation is based on the Sentry JavaScript SDK's MCP integration, adap
1863
- `internal/cli/mcp/sentry.go` - Tracing wrapper and attribute extraction
1964
- `internal/cli/mcp/server.go` - Tool registration with tracing
2065

21-
## Usage
66+
## Detailed Usage
2267

2368
### Wrapping a Tool Handler
2469

@@ -160,6 +205,14 @@ Here's an example of what a tool call span looks like in Sentry:
160205
}
161206
```
162207

208+
## Viewing Traces
209+
210+
In Sentry:
211+
212+
1. Go to **Performance****Traces**
213+
2. Filter by operation: `mcp.server`
214+
3. See tool calls with full context
215+
163216
## Comparison with JavaScript SDK
164217

165218
This implementation closely follows the Sentry JavaScript SDK's MCP integration:

docs/README_MCP_TRACING.md

Lines changed: 0 additions & 84 deletions
This file was deleted.

0 commit comments

Comments
 (0)