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
- Set up Product Analytics devkit to be able to receive the events into ClickHouse.
-
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
- Set
GITLAB_ANALYTICS_ID
andGITLAB_ANALYTICS_URL
to values provided after Product Analytics onboarding for that project. - Send an event supported by the internal events framework (such as changing an issue description, closing/reopening or locking an issue).
- Visit ClickHouse query interface at
http://localhost:8123/play
and runselect * from gitlab_project_<PROJECT_ID>.snowplow_events where useragent = 'GitLab Analytics Ruby SDK/0.2.3'
to see the events. - 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.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Piotr Skorupa