Add metrics for distinct active workspace users
What does this MR do and why?
Introduce workspace active user metric by utilising our existing events.
- Event for clicking
Open workspace
button defined here, which could fit intoopens a workspace
- Event for tracking workspace creation event defined here, which could fit into
creates a workspace
- Event for tracking active workspace defined here, which could fit into
restarts a suspended workspace
We only count distinct event by user.id
References
Issue - Add metrics for distinct active workspace users (#537568 - closed)
Screenshots or screen recordings
Tried with below approach on the new metric.
- Create one workspace first; click
Open workspace
a few times with the same user; and see only one counter increase on the unique user_id metric introduced. - Then triggered event with different user signed in; and see the counter increased by one again
How to set up and validate locally
- Follow steps for local workspace setup, https://gitlab.com/gitlab-org/workspaces/gitlab-workspaces-docs/-/blob/main/doc/local-development-environment-setup.md?ref_type=heads
- Follow steps for local snowplow micro setup, https://docs.gitlab.com/development/internal_analytics/internal_event_instrumentation/local_setup_and_debugging/#snowplow-micro
- Go to workspace creation page
http://gdk.test:3000/-/remote_development/workspaces/new
, and create one workspace, and see event tracked with started label when workspace is running - Click on button
Open workspace
- Verify only 1 counter increase for the same user
- Sign in with a different user, and repeat above steps
- Verify another 1 counter increase for this new user
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Edited by zli