This guide shows how to verify that OpenTelemetry tracing is working correctly with the MCP server.
# Start Jaeger in Docker (requires Docker to be installed)
npm run tracing:jaeger:startThis starts Jaeger with:
- UI: http://localhost:16686 (view traces here)
- OTLP HTTP endpoint: http://localhost:4318 (where our traces go)
# Run the MCP inspector with tracing enabled
npm run inspect:build:tracingThis will:
- Build the server
- Start it with SSE transport (so we get console logs)
- Enable tracing with OTLP endpoint pointing to Jaeger
- Set service name to
mapbox-mcp-server-inspector
In the MCP inspector:
- Execute any tool (e.g., search for "San Francisco")
- Try multiple tools to generate various traces
- Each tool execution creates traces
- Open http://localhost:16686 in your browser
- Select service:
mapbox-mcp-server-inspector - Click "Find Traces"
- You should see traces for:
- Tool executions (e.g.,
tool.search_tool) - HTTP requests (e.g.,
http.get) - Any errors or performance issues
- Tool executions (e.g.,
npm run tracing:jaeger:stop✅ Console output shows: OpenTelemetry tracing: enabled
✅ Jaeger UI shows traces for your service
✅ Trace details include:
- Tool name and execution time
- HTTP requests to Mapbox APIs
- Input/output sizes
- Success/error status
- Session context (if using JWT)
❌ "OpenTelemetry tracing: disabled"
- Check that
OTEL_EXPORTER_OTLP_ENDPOINTis set - Verify Jaeger is running:
docker ps | grep jaeger
❌ No traces in Jaeger
- Wait a few seconds after tool execution
- Check Jaeger is receiving data: http://localhost:16686
- Verify the service name matches:
mapbox-mcp-server-inspector
❌ Docker not available
- Use alternative OTLP collector
- Note: Console tracing is not supported with stdio transport
OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:2000
AWS_REGION=us-east-1OTEL_EXPORTER_OTLP_ENDPOINT=https://cloudtrace.googleapis.com/v1/projects/PROJECT_ID/traces:batchWriteOTEL_EXPORTER_OTLP_ENDPOINT=https://api.honeycomb.io/v1/traces
OTEL_EXPORTER_OTLP_HEADERS='{"x-honeycomb-team":"YOUR_API_KEY"}'SERVER_TRANSPORT=sse OTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 npm run inspect:buildOTEL_EXPORTER_OTLP_ENDPOINT=http://localhost:4318 npm run inspect:build- Performance: Tracing adds <1% CPU overhead
- Network: Each trace is ~1-5KB sent to OTLP endpoint
- Sampling: Use
OTEL_TRACES_SAMPLER=traceidratioandOTEL_TRACES_SAMPLER_ARG=0.1for high-volume environments - Security: Traces don't include sensitive input data, only metadata
A successful tool execution trace includes:
{
"traceId": "1234567890abcdef",
"spanId": "abcdef1234567890",
"operationName": "tool.search_tool",
"startTime": "2025-10-07T12:00:00Z",
"duration": "245ms",
"tags": {
"tool.name": "search_tool",
"tool.input.size": 156,
"tool.output.size": 2048,
"session.id": "session-uuid",
"http.method": "GET",
"http.url": "https://api.mapbox.com/search/...",
"http.status_code": 200
}
}This gives you complete visibility into tool performance, API calls, and any issues.