-
Notifications
You must be signed in to change notification settings - Fork 1
Add OpenTelemetry #10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR integrates OpenTelemetry distributed tracing into the Upsun MCP Server, providing observability for request flows, performance metrics, and debugging capabilities. The implementation includes configurable sampling rates, multiple exporters (console, OTLP), automatic instrumentation, and environment-based configuration.
Key Changes
- Added OpenTelemetry SDK with configurable tracing infrastructure supporting console and OTLP exporters
- Implemented automatic span wrapping for all MCP tool handlers via
ToolWrapperutility class - Created centralized configuration module with environment variable parsing and validation
Reviewed Changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| upsun-mcp/package.json | Added OpenTelemetry dependencies (api, sdk-node, exporters, auto-instrumentations) |
| upsun-mcp/tsconfig.json | Added Node.js types configuration |
| upsun-mcp/src/core/config.ts | New configuration module centralizing OpenTelemetry and app settings |
| upsun-mcp/src/core/telemetry.ts | New telemetry module implementing OpenTelemetry initialization and span utilities |
| upsun-mcp/src/core/helper.ts | Added ToolWrapper class for automatic tracing of tool handlers |
| upsun-mcp/src/index.ts | Integrated telemetry initialization and graceful shutdown handlers |
| upsun-mcp/src/mcpUpsun.ts | Added tracing to connection methods with span attributes and events |
| upsun-mcp/src/core/gateway.ts | Added tracing to server lifecycle methods |
| upsun-mcp/src/command/*.ts | Wrapped all tool handlers with ToolWrapper.trace for automatic observability |
| upsun-mcp/test/core/*.test.ts | Added comprehensive test coverage for telemetry and configuration modules |
| upsun-mcp/.env.example | Added OpenTelemetry environment variable examples and documentation |
| upsun-mcp/OPENTELEMETRY.md | Added comprehensive configuration guide for OpenTelemetry setup |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Coverage after merging otel into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Coverage after merging otel into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 28 out of 29 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Coverage after merging otel into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Copilot reviewed 28 out of 29 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Coverage after merging otel into main will be
Coverage Report
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
No description provided.