[otel] Update DevKit Server with OTEL implementation #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds comprehensive distributed tracing to the Mapbox MCP DevKit Server using OpenTelemetry
(OTEL). The implementation provides production-ready observability for tool executions, HTTP requests,
and server operations with zero impact on existing functionality.
Key Features
Opt-in Design
OTEL_EXPORTER_OTLP_ENDPOINTis setComprehensive Instrumentation
local processing)
Production-Ready
Honeycomb)
Implementation Details
Core Infrastructure
src/utils/tracing.ts- 379 lines of tracing utilities with span management, context propagation, andgraceful initialization
src/index.ts- Automatic tracing initialization/shutdown with .env loading spanssrc/tools/MapboxApiBasedTool.ts- Tool execution context integrationDeveloper Experience
.env.example- Ready-to-use configurations for 7 observability backendsdocs/tracing.md- Comprehensive documentation (450+ lines)docs/tracing-verification.md- Step-by-step verification guideCLAUDE.md- Quick reference for developersREADME.md- Updated with Observability sectionNPM Scripts
Trace Examples
Tool Execution Span
Summary
Changes Made
Code Changes
Documentation & Configuration
Testing
✅ All tests pass (255/255 tests)
Benefits
For Development
For Production
For Hosted Endpoint (mcp-devkit.mapbox.com/mcp)
Files Changed
Core Implementation (5 files)
Tool Updates (8 files)
Documentation (5 files)
Migration Guide
For Existing Users
For New Users
Checklist
Additional Notes