Add ability to create metrics for unique added props
Related to #444410 (closed)
What does this MR do and why?
Adds support for metrics counting unique values for additional properties of events. (ex - count of unique merge requests where change_merge_request_status
occurred.
This MR includes all of:
- logical changes to allow
label
/property
/value
as values forunique
key in metric definition ymls - documentation of the available options
- cli support for creating metrics this way
- a heap of new tests
Adding new items to the metric selection menu in the CLI created a bit of visual noise. To mitigate that, I changed some existing behavior:
- Completely gray out disabled menu options (rather than red x & yellow explanation text)
- Move disabled menu items to the bottom of the list & maintain relative order (rather than keeping the order entirely constant)
- When the filtered & non-filtered versions of a metric are both disabled, dedupe them (rather than keeping two menu items)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
With existing event details like:
The metric metric creation flow looks like:
How to set up and validate locally
Run scripts/internal_events/cli.rb
. Create a metric for an event that has additional properties.
Edited by Sebastian Rehm