Skip to content

Add ability to create metrics for unique added props

Sarah Yasonik requested to merge sy-add-unique-by-add-prop-metrics into master

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 for unique 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:

Screenshot_2024-09-08_at_6.36.02_PM

The metric metric creation flow looks like:

Screenshot_2024-09-08_at_6.34.33_PM

Screenshot_2024-09-08_at_6.34.41_PM

Screenshot_2024-09-08_at_6.35.25_PM

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

Merge request reports

Loading