Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

chore: expose a hook to specify telemetry hosting mode MCP-166 #501

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

Open
nirinchev wants to merge 4 commits into main
base: main
Choose a base branch
Loading
from ni/telemetry-hosting-mode

Conversation

Copy link
Collaborator

@nirinchev nirinchev commented Sep 2, 2025

Proposed changes

It's best to review this with whitespace disabled since I removed an unnecessary nesting in the telemetry tests. This hook will be used by vscode to set the "hostingMode" so that we can differentiate between standalone and vscode-hosted servers.

blva reacted with thumbs up emoji
@Copilot Copilot AI review requested due to automatic review settings September 2, 2025 07:24
@nirinchev nirinchev requested a review from a team as a code owner September 2, 2025 07:24
Copy link
Contributor

@Copilot Copilot AI left a 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 exposes a static hook in the Telemetry class to specify a hosting mode, allowing differentiation between standalone and vscode-hosted servers. This enables better categorization of telemetry data based on the runtime environment.

  • Add static hostingMode property to Telemetry class
  • Include hosting_mode in common telemetry properties when set
  • Add comprehensive test coverage for the new hosting mode functionality

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/telemetry/telemetry.ts Adds static hostingMode property and sets it in common properties during telemetry creation
src/telemetry/types.ts Extends CommonProperties type to include optional hosting_mode field
tests/unit/telemetry.test.ts Adds test coverage for hosting mode functionality and removes unnecessary test nesting

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -42,6 +44,7 @@ export class Telemetry {
commonProperties?: CommonProperties;
} = {}
): Telemetry {
Copy link
Preview

Copilot AI Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assignment will throw a TypeError if commonProperties is undefined. The code should check if commonProperties exists or provide a default object before assignment.

Copilot uses AI. Check for mistakes.

Copy link
Collaborator

coveralls commented Sep 2, 2025
edited
Loading

Pull Request Test Coverage Report for Build 17437640718

Details

  • 14 of 14 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 81.107%

Totals Coverage Status
Change from base Build 17434052902: 0.1%
Covered Lines: 4608
Relevant Lines: 5593

💛 - Coveralls

@@ -73,4 +73,5 @@ export type CommonProperties = {
config_atlas_auth?: TelemetryBoolSet;
config_connection_string?: TelemetryBoolSet;
session_id?: string;
hosting_mode?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can we set the accepted strings here?

Copy link
Collaborator Author

@nirinchev nirinchev Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The MCP server does not know them at this point - essentially, I want this to be a field populated by the application that hosts the server and we don't know beforehand what these applications are.

himanshusinghs reacted with thumbs up emoji
@@ -14,6 +14,8 @@ type EventResult = {
};

export class Telemetry {
public static hostingMode?: string;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we default to standalone until updated by vscode?

Copy link
Collaborator Author

@nirinchev nirinchev Sep 2, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, though we would need to treat empty and standalone as identical for historical purposes.

* main:
 feat: add more details about atlas connect flow - MCP-124 (#500)
 chore: extend library interfaces to allow injecting a custom connection error handler MCP-132 (#502)
 fix: start mcp even if connection fails - [MCP-140] (#503)
 fix: allow connect tool on readOnly mode (#499)
 chore: warn about the usage of deprecated cli arguments MCP-107 (#493)
 ci: add ipAccessList after creating project (#496)
Copy link
Collaborator

@himanshusinghs himanshusinghs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers

@blva blva blva left review comments

Copilot code review Copilot Copilot left review comments

@himanshusinghs himanshusinghs himanshusinghs approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /