Skip to content

feat(telemetry): Add status code

Mikołaj Wawrzyniak requested to merge mwaw/add_error_code_to_tracking into main

Description

It solves 2nd point from proposed solution at https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/1024 by adding status code to suggestion_error events

Related Issues

Resolves https://gitlab.com/gitlab-org/gitlab-vscode-extension/-/issues/1024

How has this been tested?

  1. Change snowplow config on local env to report to snowplow micro
diff --git a/src/common/snowplow/snowplow_options.ts b/src/common/snowplow/snowplow_options.ts
index c0b43b9c..30946a28 100644
--- a/src/common/snowplow/snowplow_options.ts
+++ b/src/common/snowplow/snowplow_options.ts
@@ -10,7 +10,7 @@ export type SnowplowOptions = {
 
 export const snowplowBaseOptions: Omit<SnowplowOptions, 'enabled'> = {
   appId: 'gitlab_ide_extension',
-  endpoint: 'https://snowplow.trx.gitlab.net',
+  endpoint: 'http://localhost::9091',//, 'https://snowplow.trx.gitlab.net',
   timeInterval: 5000,
   maxItems: 10,
 };
(END
  1. Add gitlab account with PAT that only has read_api scope
  2. Try to get any suggestion (that will fail since scope is missing)
  3. Check snowplow micro at http://localhost:9091/micro/good
  4. Find "api_status_code": 403

Screenshots (if appropriate):

Screenshot_2023-10-13_at_11.20.46

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation
  • Chore (Related to CI or Packaging to platforms)
  • Test gap

Merge request reports