Skip to content

Commit ceb16b7

Browse files
Added OTEL documentation (#35)
1 parent d96e8ec commit ceb16b7

1 file changed

Lines changed: 67 additions & 0 deletions

File tree

README.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,74 @@ When using custom CA certificate bundles, you must configure both:
157157
158158
---
159159

160+
## OpenTelemetry
160161

162+
Perfecto MCP reports traces and metrics for MCP tool calls using [OpenTelemetry](https://opentelemetry.io/). This gives you visibility into which tools are used, how long they take, and when errors occur.
163+
164+
Telemetry is enabled by default. You do not need to configure anything unless you want to change where data is sent or turn it off.
165+
166+
### Default behavior
167+
168+
By default, telemetry is exported over gRPC to:
169+
170+
`https://grpc.public.prd.shared.perforce.com`
171+
172+
The service is identified as `perfecto-mcp` with the current release version. If telemetry fails to start or export, the MCP server continues to work as usual.
173+
174+
### Turn off telemetry
175+
176+
Add `OTEL_SDK_DISABLED=true` to your MCP client environment:
177+
178+
```json
179+
"env": {
180+
"OTEL_SDK_DISABLED": "true"
181+
}
182+
```
183+
184+
For Docker, pass it with `-e`:
185+
186+
```json
187+
"-e",
188+
"OTEL_SDK_DISABLED=true"
189+
```
190+
191+
### Send data to your own collector
192+
193+
Use these environment variables to point at a different OpenTelemetry collector (for example, a local one during development):
194+
195+
| Variable | Description | Default |
196+
|----------|-------------|---------|
197+
| `OTEL_EXPORTER_OTLP_ENDPOINT` | OTLP collector URL | `https://grpc.public.prd.shared.perforce.com` |
198+
| `OTEL_EXPORTER_OTLP_PROTOCOL` | `grpc`, `http/protobuf`, or `http/json` | `grpc` |
199+
200+
gRPC example (typical local collector on port 4317):
201+
202+
```json
203+
"env": {
204+
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4317",
205+
"OTEL_EXPORTER_OTLP_PROTOCOL": "grpc"
206+
}
207+
```
208+
209+
HTTP example (typical local collector on port 4318):
210+
211+
```json
212+
"env": {
213+
"OTEL_EXPORTER_OTLP_ENDPOINT": "http://localhost:4318",
214+
"OTEL_EXPORTER_OTLP_PROTOCOL": "http/protobuf"
215+
}
216+
```
217+
218+
### What gets reported
219+
220+
Each MCP tool call creates:
221+
222+
- **Traces** — one span per call with the tool name, action, MCP client name and version, session ID, and error type when applicable.
223+
- **Metrics**`mcp.tool.calls` (count) and `mcp.tool.duration` (seconds), broken down by tool and action.
224+
225+
Security tokens and other credentials are not included in telemetry data.
226+
227+
If your MCP client sends `traceparent` or `tracestate` in the request metadata, Perfecto MCP links its spans to that parent trace.
161228

162229
---
163230

0 commit comments

Comments
 (0)