-
Notifications
You must be signed in to change notification settings - Fork 157
chore: add connection metadata to telemetry #716
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
base: main
Are you sure you want to change the base?
Conversation
Pull Request Test Coverage Report for Build 19166075826Details
💛 - Coveralls |
This reverts commit c5ec47e.
|
|
||
| export type ConnectionMetadata = AtlasMetadata & | ||
| AtlasLocalToolMetadata & { | ||
| connection_auth_type?: string; |
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.
planning to add host info here - starting with connection auth type as an example of something we can capture
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 adds connection authentication type metadata to telemetry events for improved tracking and analytics. The changes rename AtlasToolMetadata to AtlasMetadata for clarity and introduce ConnectionMetadata that captures both Atlas cluster information and connection authentication type across MongoDB and Atlas tools.
Key Changes:
- Introduced
ConnectionMetadatatype that combines Atlas metadata with connection auth type tracking - Added
getConnectionInfoMetadata()helper method inToolBaseto extract connection metadata from session state - Updated MongoDB and Atlas tools to report connection authentication type in telemetry
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/telemetry/types.ts | Renamed AtlasToolMetadata to AtlasMetadata, introduced ConnectionMetadata type combining Atlas and connection auth metadata |
| src/tools/tool.ts | Added getConnectionInfoMetadata() helper method to extract connection metadata from session |
| src/common/session.ts | Added getter for connectionStringAuthType from connection manager |
| src/tools/mongodb/mongodbTool.ts | Updated resolveTelemetryMetadata() to use new getConnectionInfoMetadata() helper |
| src/tools/atlas/atlasTool.ts | Updated return type from AtlasToolMetadata to AtlasMetadata |
| src/tools/atlas/connect/connectCluster.ts | Override resolveTelemetryMetadata() to include connection metadata after cluster connection |
| src/tools/atlasLocal/atlasLocalTool.ts | Updated return type to ConnectionMetadata |
| src/tools/atlasLocal/connect/connectDeployment.ts | Override resolveTelemetryMetadata() to include connection metadata after deployment connection |
| tests/unit/toolBase.test.ts | Added comprehensive unit tests for getConnectionInfoMetadata() method |
| tests/integration/tools/mongodb/mongodbTool.test.ts | Added integration tests verifying connection auth type is captured in telemetry metadata |
| protected override resolveTelemetryMetadata(result: CallToolResult): ConnectionMetadata { | ||
| return { | ||
| ...super.resolveTelemetryMetadata(result), | ||
| ...this.getConnectionInfoMetadata(), | ||
| }; | ||
| } |
Copilot
AI
Nov 7, 2025
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.
The spread operation on line 42 may overwrite properties from super.resolveTelemetryMetadata(result) since both return ConnectionMetadata objects that could contain overlapping keys like project_id. Consider making the precedence explicit or documenting which values should take priority.
Proposed changes
Checklist