Telemetry events without attached experiment context (microsoft/vscode-internalbacklog#6275)#277343
Merged
Telemetry events without attached experiment context (microsoft/vscode-internalbacklog#6275)#277343
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements a workaround for an issue where telemetry events were being sent without attached experiment context (microsoft/vscode-internalbacklog#6275). The solution delays the logging of chat entitlement telemetry until the workbench reaches the Eventually lifecycle phase (2-5 seconds after startup).
Key Changes
- Added
ILifecycleServiceandLifecyclePhaseimports to support lifecycle-based execution - Injected
ILifecycleServiceas a constructor parameter - Added a delayed telemetry logging call that waits for
LifecyclePhase.Eventuallybefore sending chat entitlement events
| this.lifecycleService.when(LifecyclePhase.Eventually).then(() => { | ||
| if (this.context?.hasValue) { | ||
| logChatEntitlements(this.context.value.state, this.configurationService, this.telemetryService); | ||
| } |
There was a problem hiding this comment.
The promise returned by lifecycleService.when() should have error handling. If the promise rejects for any reason, it could result in an unhandled promise rejection. Consider adding a .catch() handler to gracefully handle any potential errors.
Suggested change
| } | |
| } | |
| }).catch(error => { | |
| this.logService.error('Error waiting for LifecyclePhase.Eventually in ChatEntitlementService:', error); |
lszomoru
approved these changes
Nov 14, 2025
Member
|
@bpasero, PR build is 🔴 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.