Skip to content

Conversation

nirinchev
Copy link
Collaborator

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.

@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.

eventCache?: EventCache;
commonProperties?: CommonProperties;
} = {}
): Telemetry {
Copy link

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.

@coveralls
Copy link
Collaborator

coveralls commented Sep 2, 2025

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

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

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.

};

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

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 🚀

@nirinchev nirinchev merged commit 1f68c3e into main Sep 4, 2025
18 checks passed
@nirinchev nirinchev deleted the ni/telemetry-hosting-mode branch September 4, 2025 21:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants