Skip to content

chore: make trackingUrl (telemetry) configurable for local testing

Tomas Vik requested to merge tv/2024-07/make-telemetry-url-configurable into main

Description

All our testing strategies for testing telemetry include this instruction:


  1. Provide the trackingUrl for the local Snowplow collector in the Client config for the LS here

    telemetry: {
       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?

  1. 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
  2. set the gitlab.trackingUrl setting to http://localhost:9091

  3. 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
  4. remove the gitlab.trackingUrl setting

  5. 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

Merge request reports