Skip to content

Add instrumenting backend internal events to dogfood Product Analytics

What does this MR do and why?

Related to #413064 (closed).

This adds sending backend events from the internal events framework to Product Analytics to dogfood it, similarly to frontend events, using the Gitlab Ruby SDK for Product Analytics.

There already are environment variables GITLAB_ANALYTICS_ID and GITLAB_ANALYTICS_URL which are used by frontend events for credentials, and I just reuse them.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  1. Set up Product Analytics devkit to be able to receive the events into ClickHouse.
  2. Enable Product Analytics for a project in your GDK instance, for example gitlab-org/gitlab-shell by visiting <GDK-ROOT>/gitlab-org/gitlab-shell/-/analytics/dashboards/product-analytics-onboarding
  3. Set GITLAB_ANALYTICS_ID and GITLAB_ANALYTICS_URL to values provided after Product Analytics onboarding for that project.
  4. Send an event supported by the internal events framework (such as changing an issue description, closing/reopening or locking an issue).
  5. Visit ClickHouse query interface at http://localhost:8123/play and run select * from gitlab_project_<PROJECT_ID>.snowplow_events where useragent = 'GitLab Analytics Ruby SDK/0.2.3' to see the events.
  6. If you see no events, try disabling ad-block plugins and browser tracking protection.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Piotr Skorupa

Merge request reports

Loading