chore: make trackingUrl (telemetry) configurable for local testing
Description
All our testing strategies for testing telemetry include this instruction:
-
Provide the
trackingUrl
for the local Snowplow collector in the Client config for the LS heretelemetry: { trackingUrl: 'http://localhost:9091', actions: [{ action: TRACKING_EVENTS.ACCEPTED }], }
This MR implements a non-public setting that will allow us to set the trackingUrl
in VS Code Extension settings rather than having to change the code.
How has this been tested?
-
Run snowplow micro locally
podman run --name snowplow-micro --rm -e MICRO_IGLU_REGISTRY_URL="https://gitlab-org.gitlab.io/iglu" -p 127.0.0.1:9091:9090 snowplow/snowplow-micro:latest
- Side note: SP micro basic usage https://docs.snowplow.io/docs/testing-debugging/snowplow-micro/basic-usage/
-
set the
gitlab.trackingUrl
setting tohttp://localhost:9091
-
See in snowplow micro that the code suggestion events are sent to the local snowplow
2024-07-12T12:57:43:751 [debug]: fetch: request to http://localhost:9091/com.snowplowanalytics.snowplow/tp2 returned HTTP 200 after 81 ms
-
remove the
gitlab.trackingUrl
setting -
See in LS debug logs that we submit the events to our public gitlab snowplow
2024-07-12T12:56:23:899 [debug]: fetch: request for https://snowplow.trx.gitlab.net/com.snowplowanalytics.snowplow/tp2 made with https agent.
Screenshots (if appropriate)
What CHANGELOG entry will this MR create?
-
fix:
Bug fix fixes - a user-facing issue in production - included in changelog -
feature:
New feature - a user-facing change which adds functionality - included in changelog -
BREAKING CHANGE:
(fix or feature that would cause existing functionality to change) - should bump major version, mentioned in the changelog -
None - other non-user-facing changes
Edited by Tomas Vik