Skip to content

refactor(telemetry): Instrument telemetry to track code suggestion lifecycle

MR adds tracking to code suggestion lifecycle as requested by https://gitlab.com/gitlab-org/modelops/applied-ml/code-suggestions/ai-assist/-/issues/256

To test locally:

  1. configure snowplow micro following https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/snowplow_micro.md
  2. change snowplow configuration to report to your local collector
diff --git a/src/common/setup_telemetry.ts b/src/common/setup_telemetry.ts
index b82d1ed..05173aa 100644
--- a/src/common/setup_telemetry.ts
+++ b/src/common/setup_telemetry.ts
@@ -9,9 +9,9 @@ export function setupTelemetry(): Snowplow {
 
   const snowplow = Snowplow.getInstance({
     appId: 'gitlab_ide_extension',
-    endpoint: 'https://snowplow.trx.gitlab.net',
+    endpoint: 'http://localhost:9091',
     timeInterval: 5000,
-    maxItems: 10,
+    maxItems: 1,
     enabled: () => isTelemetryEnabled,
   });
 
  1. check if telemetry is enabled in VS Code setting Screenshot_2023-08-25_at_16.40.45
  2. Trigger code suggestion
  3. check that event has been received Screenshot_2023-09-01_at_14.48.53
Edited by Mikołaj Wawrzyniak

Merge request reports