[otel] Update MCP server with OTEL #63
Merged
+757
−368
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
Implements comprehensive OTEL tracing enhancements with additional multi-cloud observability platform support.
Key Changes
1. Environment Variable Loading with OTEL Tracing
dotenvpackage with Node.js built-inparseEnv()(src/index.ts:4-55)config.load_envcapturing:dotenvdependency from package.json2. CloudFront Correlation ID Tracking
TracingPolicyclass (src/utils/httpPipeline.ts:164-220) capturing:x-amz-cf-id- CloudFront request ID for correlationx-amz-cf-pop- CloudFront Point of Presence locationx-cache- Cache hit/miss statusetag- Entity taghttp.response.status_code- HTTP status for all requestsMAPBOX_API_ENDPOINTenvironment variable3. Simplified Configuration Management
.env.tracing.exampleand.env.aws.exampleinto single.env.exampleinspect:buildandinspect:devto automatically use.env4. Cleaned Up npm Scripts
Removed:
test:tracing- Redundant with .env configurationtracing:demo- Console output not useful for stdio transporttracing:test- Internal testing scriptinspect:build:tracing- Now uses .env insteadinspect:dev:tracing- Now uses .env insteadscripts/tracing-demo.tsscripts/test-tracing.tsKept:
tracing:jaeger:start/tracing:jaeger:stop- Docker helperstracing:verify- Updated with .env instructions5. Documentation Updates
Benefits
✅ End-to-End Observability: Configuration loading → Tool execution → HTTP requests → CloudFront
✅ Multi-Cloud Support: Ready-to-use configs for AWS, Azure, GCP
✅ Vendor Flexibility: Easy switching between observability platforms
✅ Debugging: CloudFront correlation IDs for troubleshooting with Mapbox support
✅ Cleaner Config: Single
.env.examplewith all options✅ No External Deps: Using Node.js built-in
parseEnvinstead of dotenv packageTesting
Test Coverage
MAPBOX_API_ENDPOINTenvironment variableManual Testing
Start Jaeger
npm run tracing:jaeger:start
npm run inspect:build
Make API call via inspector
Verify: Check traces at http://localhost:16686 for x-amz-cf-id attributes
- Verified .env.example has valid endpoint URLs for all 6 platforms
- Tested that uncommenting each platform section works without conflicts
Build & Lint
Compatibility
Checklist
Additional Notes