Add metrics for total number of active workspaces
MR: Add metric for active workspaces (!191902 - merged)
Description
Add metrics for active workspace, including both new and existing workspaces combined.
We will use internal event tracking with additional properties to distinguish new and existing workspaces.
The place we trigger events would be at workspace model ee/app/models/remote_development/workspace.rb
, and we use after_save
hook to inject event trigger. We should make sure even if this tracking method goes wrong, then overall operation still goes well (use rescue block).
For metrics, we should have 1 metric for whole event, and 2 separate metric each for started and restarted.
IF `desired_state` changed to `Running`? THEN
IF another `desired_state` changed to `Running` after last `desired_state` changed to `Running`
SKIP
ELSE IF new record
THEN track event with `new`
ELSE
THEN track event with `existing`
Acceptance criteria
-
Define 1 internal event for active workspaces -
Trigger each event using after_save
in workspace model (See pseudo code for reference) -
Define 3 service ping metrics for all, new and existing -
Ensure all metrics as expected in Tableau
Implementation plan
NA
Edited by zli