-
Notifications
You must be signed in to change notification settings - Fork 342
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
backport/vscode/1.50: chore(telemetry): remove legacy back-compat (#6265
) (#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)
- Loading branch information
1 parent
71a6a43
commit ff9c201
Showing
21 changed files
with
18 additions
and
685 deletions.
There are no files selected for viewing
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
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
15 changes: 0 additions & 15 deletions
15
...indings/kotlin/lib/src/main/kotlin/com/sourcegraph/cody/agent/protocol_generated/Event.kt
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
...tlin/lib/src/main/kotlin/com/sourcegraph/cody/agent/protocol_generated/EventProperties.kt
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
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
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
Oops, something went wrong.