Skip to content

Switch GH telemetry to use vscode extension telemetry (exp roll out)#3331

Draft
vijayupadya wants to merge 4 commits intomainfrom
vijayu/ghTelUpdate
Draft

Switch GH telemetry to use vscode extension telemetry (exp roll out)#3331
vijayupadya wants to merge 4 commits intomainfrom
vijayu/ghTelUpdate

Conversation

@vijayupadya
Copy link
Contributor

Fixes https://github.com/microsoft/vscode-internalbacklog/issues/6549

Adds support for routing GitHub telemetry events through @vscode/extension-telemetry library instead of existing applicationinsights SDK. The routing is controlled by an experiment flag, enabling A/B testing of the new implementation.

@vijayupadya vijayupadya added this to the February 2026 milestone Jan 30, 2026
@vijayupadya vijayupadya added the enhancement New feature or request label Jan 30, 2026
@vijayupadya vijayupadya requested a review from Copilot January 30, 2026 21:16
@vijayupadya vijayupadya changed the title Switch GH telemetry to use vscode extention telemetry (exp roll out) Switch GH telemetry to use vscode extension telemetry (exp roll out) Jan 30, 2026
Copy link
Contributor

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

Adds an experiment-gated path for routing GitHub telemetry through @vscode/extension-telemetry instead of the legacy applicationinsights sender, enabling A/B rollout of the new pipeline.

Changes:

  • Introduces an experiment flag (chat.advanced.telemetry.useVSCodeTelemetryLibForGH) to toggle the new GH telemetry sender behavior.
  • Adds a GH telemetry TelemetrySender adapter that can route events to either the legacy AzureInsightReporter or the new TelemetryReporter.
  • Updates @vscode/extension-telemetry dependency to ^1.4.0.

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/platform/telemetry/vscode-node/telemetryServiceImpl.ts Injects IInstantiationService and lazily evaluates the experiment flag to decide GH telemetry routing.
src/platform/telemetry/vscode-node/githubTelemetrySender.ts Adds adapter that chooses between legacy and new telemetry reporters and constructs the new TelemetryReporter config.
src/platform/telemetry/common/ghTelemetrySender.ts Adjusts token store handling and adds a tagOverrides field into the payload returned for logging.
src/platform/configuration/common/configurationService.ts Adds the new experiment-backed config key controlling GH telemetry routing.
package.json Bumps @vscode/extension-telemetry to ^1.4.0.
package-lock.json Locks dependency bump to @vscode/extension-telemetry@1.4.0.
Comments suppressed due to low confidence (1)

src/platform/telemetry/vscode-node/githubTelemetrySender.ts:22

  • The new experiment-gated routing logic (TelemetryReporterAdapter choosing old vs new reporter and unwrapping event names) isn’t covered by existing telemetry tests. Add unit tests that exercise both flag states and verify the final event name and destination match the legacy behavior, especially for wrapEventNameForPrefixRemoval(...) events.
/**
 * Adapter that wraps both old and new telemetry reporters to implement VS Code's TelemetrySender interface.
 * Supports lazy flag evaluation to avoid circular dependencies during service initialization.
 */
class TelemetryReporterAdapter implements TelemetrySender {

Copy link
Contributor

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.

Copy link
Contributor

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

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.

Comment on lines +84 to +88
if (this.useNewTelemetryLib && this.newReporter) {
// Remove the wrapped-telemetry-event-name marker if present.
// This marker is used to signal that the event name should not be re-namespaced.
const unwrappedEventName = unwrapEventNameFromPrefix(eventName);

Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

When routing to the new @vscode/extension-telemetry reporter, the event name is only unwrapped but never re-namespaced with the extension name (equivalent of AzureInsightReporter.massageEventName). This changes GitHub telemetry event names (e.g. previously "<extensionName>/<event>" unless wrapped) and breaks the existing wrapEventNameForPrefixRemoval contract used by callers (e.g. completionsTelemetryServiceBridge). Consider passing extensionName into the adapter and applying the same prefixing logic: if the name was wrapped, unwrap and send as-is; otherwise, prefix with ${extensionName}/ unless already prefixed.

Copilot uses AI. Check for mistakes.
Comment on lines +46 to +50
if (this.cachedFlagValue === undefined) {
this.cachedFlagValue = this.useNewTelemetryLibGetter();
}
return this.cachedFlagValue;
}
Copy link

Copilot AI Jan 30, 2026

Choose a reason for hiding this comment

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

This PR adds experiment-gated routing (old Application Insights reporter vs new @vscode/extension-telemetry reporter) plus special handling for wrapped event names. There are existing telemetry unit tests under src/platform/telemetry/test/, but none cover this new adapter logic—please add tests to lock down the routing decision and event-name handling (wrapped vs non-wrapped).

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant