feat: Enable code suggestions telemetry in browser environment (Web IDE)
What does this MR do?
It sets up Snowplow for Code Suggestions in the Web IDE. We need a separate initializer function because the Web IDE disables telemetry globally. See https://gitlab.com/gitlab-org/gitlab-web-ide/-/issues/277 for a detailed discussion (internal issue).
How to test?
- Configure snowplow micro in your GDK following https://gitlab.com/gitlab-org/gitlab-development-kit/-/blob/main/doc/howto/snowplow_micro.md
- Check out the gitlab-web-ide!235 (merged) branch in the Web IDE.
- Check out this branch in the
vscode-workflow-extension
submodule in the Web IDE. - Apply the following patch in the
vscode-workflow-extension
submodule
diff --git a/src/common/snowplow/snowplow_options.ts b/src/common/snowplow/snowplow_options.ts
index c0b43b9c..1d24ac13 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',
timeInterval: 5000,
- maxItems: 10,
+ maxItems: 1,
};
- Use the code suggestions feature in the Web IDE. Check the web browser's network inspector for snowplow HTTP requests.
Edited by Enrique Alcántara