This guide shows how to verify that OpenTelemetry tracing is working correctly with the MCP DevKit 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)
# Copy the example configuration
cp .env.example .env
# Edit .env to add your MAPBOX_ACCESS_TOKEN
# The OTEL_EXPORTER_OTLP_ENDPOINT is already set to http://localhost:4318# Build and run the MCP inspector
npm run inspect:buildThis will:
- Build the server
- Start it with the MCP inspector
- Enable tracing with OTLP endpoint pointing to Jaeger
- Set service name to
mapbox-mcp-devkit-server
In the MCP inspector:
- Execute any tool (e.g.,
list_styles_toolorget_latest_mapbox_docs_tool) - Try multiple tools to generate various traces:
- Style operations (create, update, retrieve, delete)
- Token management
- Documentation lookup
- Local processing tools
- Each tool execution creates traces
- Open http://localhost:16686 in your browser
- Select service:
mapbox-mcp-devkit-server - Click "Find Traces"
- You should see traces for:
- Tool executions (e.g.,
tool.list_styles_tool,tool.create_style_tool) - HTTP requests (e.g.,
http.get,http.post) - Configuration loading (
config.load_env) - Any errors or performance issues
- Tool executions (e.g.,
npm run tracing:jaeger:stop✅ Jaeger UI shows traces for your service after tool execution
✅ Trace details include:
- Tool name and execution time
- HTTP requests to Mapbox APIs
- Input/output sizes
- Success/error status
- Session context (if using JWT)
- CloudFront headers for Mapbox API calls
A typical style creation operation might show:
tool.create_style_tool (245ms)
└── http.post (198ms)
├── Request to api.mapbox.com/styles/v1/username
├── Status: 201 Created
└── CloudFront ID: ABC123XYZ...
❌ "OpenTelemetry tracing: disabled"
- Check that
OTEL_EXPORTER_OTLP_ENDPOINTis set in your .env file - Verify Jaeger is running:
docker ps | grep jaeger - Ensure .env file is in the project root
❌ 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-devkit-server - Check network connectivity to localhost:4318
❌ Docker not available
- Use alternative OTLP collector
- Or run with console tracing (see Alternative Methods below)
Test tracing with style operations:
# In MCP inspector, try:
list_styles_tool with limit=5
create_style_tool with a simple style
update_style_tool to modify the style
retrieve_style_tool to get style details
delete_style_tool to clean upEach operation creates a trace showing:
- Tool execution time
- API requests to Mapbox
- Response status codes
- Any errors
# Try these in MCP inspector:
list_tokens_tool
create_token_tool with specific scopesTraces show:
- JWT parsing and validation
- Token API interactions
- Pagination if applicable
# Try tools that don't make API calls:
coordinate_conversion_tool
bounding_box_tool
geojson_preview_toolThese show tool execution spans without HTTP child spans.
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"}'By default, OpenTelemetry diagnostic logs are disabled to prevent interference with stdio transport. If you need to troubleshoot OTEL configuration issues, you can enable diagnostic logging:
# Add to .env - only for debugging OTEL issues
OTEL_LOG_LEVEL=ERROR- 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 style creation trace includes:
{
"traceId": "1234567890abcdef",
"spanId": "abcdef1234567890",
"operationName": "tool.create_style_tool",
"startTime": "2025-11-03T12:00:00Z",
"duration": "342ms",
"tags": {
"tool.name": "create_style_tool",
"tool.input.size": 2048,
"tool.success": true,
"session.id": "session-uuid",
"http.method": "POST",
"http.url": "https://api.mapbox.com/styles/v1/...",
"http.status_code": 201,
"http.response.header.x_amz_cf_id": "ABC123...",
"http.response.header.x_amz_cf_pop": "IAD55-P3"
}
}This gives you complete visibility into:
- Tool execution performance
- API call timing and success rates
- CloudFront routing and caching
- Any errors or performance bottlenecks
Try operations that might fail to see error tracing:
- Invalid token scopes
- Malformed style JSON
- Non-existent style IDs
- Network timeouts (if simulated)
Each error creates a trace with:
- Error type and message
- Stack trace (if applicable)
- Span marked as error
- Timing up to failure point
Check the config.load_env span on startup to verify:
- .env file was found and loaded
- Number of environment variables loaded
- Any configuration errors
Use Jaeger to find:
- Slowest tool executions
- HTTP requests with high latency
- Tools with high error rates
- Patterns in failures
Once tracing is verified:
- Review the full tracing documentation
- Configure production OTLP backends (AWS X-Ray, Datadog, etc.)
- Set up sampling for high-volume environments
- Create dashboards and alerts based on trace data
If you encounter issues:
- Check the troubleshooting sections above
- Verify Jaeger is running:
docker logs jaeger - Check server logs for tracing initialization messages
- Ensure your .env file is properly configured