-
Notifications
You must be signed in to change notification settings - Fork 349
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
backport/vscode/1.50: chore(telemetry): remove legacy back-compat (#6265) #6276
Merged
Conversation
This file contains 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
When V2 telemetry first launched, we had to be careful to support older instances with V1 event logs, and shortly after the launch there were a series of bug fixes that necessitated several compatibility modes from 5.2.0 to 5.2.5, which was released in December 2023. After 5.2.5, we never committed to removing this back-compat as we waited for customers to slowly upgrade past 5.2.5. Sadly, this came back to haunt us when 5.10.0 came out a few days ago, and our compatibility mode detector [sorted 5.10.0 < 5.2.5](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1733430008785369?thread_ts=1733425399.918999&cid=C03JR7S7KRP), causing V2T to be exported as old event logs, which prevented them from being exported. After finding the bug and discussing it a bit, we've decided to [remove this back-compat entirely](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1733507755279819?thread_ts=1733425399.918999&cid=C03JR7S7KRP) since most Cody customers have upgraded past 5.2.5. This simplifies the code significantly. With the backcompat gone, this basically removes the need for _any_ of the old log-event-to-dotcom stuff, which allowed for the removal for quite a lot of unused code, which simplifies even more stuff. Closes https://linear.app/sourcegraph/issue/CORE-103/vscodetelemetry-remove-legacy-v1-fallback-exporter CI, plus a manual test: Apply a simple patch to make telemetry export in dev without fenangling configuration (this diff is not in this PR): ```diff diff --git a/vscode/src/services/telemetry-v2.ts b/vscode/src/services/telemetry-v2.ts index a2857b565..6dcf1e9ad 100644 --- a/vscode/src/services/telemetry-v2.ts +++ b/vscode/src/services/telemetry-v2.ts @@ -43,27 +43,11 @@ export function createOrUpdateTelemetryRecorderProvider( const initialize = telemetryRecorderProvider === undefined - /** - * In testing, send events to the mock server. - */ - if (process.env.CODY_TESTING === 'true') { - logDebug(debugLogLabel, 'using mock exporter') - updateGlobalTelemetryInstances( - new MockServerTelemetryRecorderProvider({ - configuration, - clientState, - }) - ) - } else if (isExtensionModeDevOrTest) { - logDebug(debugLogLabel, 'using no-op exports') - updateGlobalTelemetryInstances(defaultNoOpProvider) - } else { updateGlobalTelemetryInstances( new TelemetryRecorderProvider( { configuration, auth, clientState }, ) ) - } /** * On first initialization, also record some initial events. ``` Run the extension: ``` pnpm install && pnpm build && cd vscode && pnpm run dev ``` In logs: ``` █ telemetry-v2 recordEvent: cody.auth/connected: ``` in the instance: ![image](https://github.com/user-attachments/assets/5f7a40b2-662b-4447-992d-27393c9effc7) (cherry picked from commit 717c1d7)
kalanchan
approved these changes
Dec 6, 2024
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.
Approved by Grace (thread) as emergency patch release to address telemetry issues related to billing metrics.
dominiccooney
pushed a commit
that referenced
this pull request
Dec 10, 2024
) (#6276) When V2 telemetry first launched, we had to be careful to support older instances with V1 event logs, and shortly after the launch there were a series of bug fixes that necessitated several compatibility modes from 5.2.0 to 5.2.5, which was released in December 2023. After 5.2.5, we never committed to removing this back-compat as we waited for customers to slowly upgrade past 5.2.5. Sadly, this came back to haunt us when 5.10.0 came out a few days ago, and our compatibility mode detector [sorted 5.10.0 < 5.2.5](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1733430008785369?thread_ts=1733425399.918999&cid=C03JR7S7KRP), causing V2T to be exported as old event logs, which prevented them from being exported. After finding the bug and discussing it a bit, we've decided to [remove this back-compat entirely](https://sourcegraph.slack.com/archives/C03JR7S7KRP/p1733507755279819?thread_ts=1733425399.918999&cid=C03JR7S7KRP) since most Cody customers have upgraded past 5.2.5. This simplifies the code significantly. With the backcompat gone, this basically removes the need for _any_ of the old log-event-to-dotcom stuff, which allowed for the removal for quite a lot of unused code, which simplifies even more stuff. Closes https://linear.app/sourcegraph/issue/CORE-103/vscodetelemetry-remove-legacy-v1-fallback-exporter ## Test plan CI, plus a manual test: Apply a simple patch to make telemetry export in dev without fenangling configuration (this diff is not in this PR): ```diff diff --git a/vscode/src/services/telemetry-v2.ts b/vscode/src/services/telemetry-v2.ts index a2857b565..6dcf1e9ad 100644 --- a/vscode/src/services/telemetry-v2.ts +++ b/vscode/src/services/telemetry-v2.ts @@ -43,27 +43,11 @@ export function createOrUpdateTelemetryRecorderProvider( const initialize = telemetryRecorderProvider === undefined - /** - * In testing, send events to the mock server. - */ - if (process.env.CODY_TESTING === 'true') { - logDebug(debugLogLabel, 'using mock exporter') - updateGlobalTelemetryInstances( - new MockServerTelemetryRecorderProvider({ - configuration, - clientState, - }) - ) - } else if (isExtensionModeDevOrTest) { - logDebug(debugLogLabel, 'using no-op exports') - updateGlobalTelemetryInstances(defaultNoOpProvider) - } else { updateGlobalTelemetryInstances( new TelemetryRecorderProvider( { configuration, auth, clientState }, ) ) - } /** * On first initialization, also record some initial events. ``` Run the extension: ``` pnpm install && pnpm build && cd vscode && pnpm run dev ``` In logs: ``` █ telemetry-v2 recordEvent: cody.auth/connected: ``` in the instance: ![image](https://github.com/user-attachments/assets/5f7a40b2-662b-4447-992d-27393c9effc7) (cherry picked from commit 717c1d7)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When V2 telemetry first launched, we had to be careful to support older instances with V1 event logs, and shortly after the launch there were a series of bug fixes that necessitated several compatibility modes from 5.2.0 to 5.2.5, which was released in December 2023. After 5.2.5, we never committed to removing this back-compat as we waited for customers to slowly upgrade past 5.2.5.
Sadly, this came back to haunt us when 5.10.0 came out a few days ago, and our compatibility mode detector sorted 5.10.0 < 5.2.5, causing V2T to be exported as old event logs, which prevented them from being exported. After finding the bug and discussing it a bit, we've decided to remove this back-compat
entirely since most Cody customers have upgraded past 5.2.5. This simplifies the code significantly.
With the backcompat gone, this basically removes the need for any of the old log-event-to-dotcom stuff, which allowed for the removal for quite a lot of unused code, which simplifies even more stuff.
Closes
https://linear.app/sourcegraph/issue/CORE-103/vscodetelemetry-remove-legacy-v1-fallback-exporter
Test plan
CI, plus a manual test:
Apply a simple patch to make telemetry export in dev without fenangling configuration (this diff is not in this PR):
Run the extension:
In logs:
in the instance:
(cherry picked from commit 717c1d7)