Skip to content

Support filtering metrics in the internal events cli

What does this MR do and why?

Adds support for defining metrics which the filter by the event's additional properties in the Internal Events CLI. For events without additional properties or metrics without filters, the flow stays mostly the same.

Changes in the metric creation flow:

  • adds filter-based options to the metric selection screen (Scope)
    • adds the list of selected metrics at the top of the screen with an indicator of which additional properties are available for each event
  • adds an extra step for users to manually set the key_path/filename for metrics with filters
  • prompts users to manually set the key_path/filename when the filename is too long or there are key_path conflicts
  • when writing descriptions for metrics, a simplified metric description is used instead of a "technical" description
    • the list of selected events is now at the top of the page shown alongside the event descriptions & filters (where applicable)
  • when a user creates a metric with filters that includes multiple events, the user is prompted to confirm inclusion of the event in the metric

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

Full flow for metric for a single event filtering on label

Screenshot_2024-07-16_at_5.52.49_PM Screenshot_2024-07-16_at_5.52.57_PM Screenshot_2024-07-16_at_5.55.05_PM Screenshot_2024-07-16_at_6.26.56_PM Screenshot_2024-07-16_at_5.57.18_PM Screenshot_2024-07-16_at_5.58.04_PM Screenshot_2024-07-16_at_5.59.08_PM Screenshot_2024-07-16_at_5.59.48_PM Screenshot_2024-07-16_at_5.59.58_PM Screenshot_2024-07-16_at_5.58.37_PM Screenshot_2024-07-16_at_6.00.08_PM Screenshot_2024-07-16_at_6.00.17_PM Screenshot_2024-07-16_at_6.00.27_PM Screenshot_2024-07-16_at_6.00.54_PM

Flow for metric for a multiple events, filtering on different properties with the same meaning

Screenshot_2024-07-16_at_8.18.39_PM Screenshot_2024-07-16_at_8.34.33_PM Screenshot_2024-07-16_at_8.34.46_PM Screenshot_2024-07-16_at_8.36.37_PM Screenshot_2024-07-16_at_8.37.15_PM Screenshot_2024-07-16_at_8.37.57_PM Screenshot_2024-07-16_at_8.38.16_PM Screenshot_2024-07-16_at_8.38.36_PM Screenshot_2024-07-16_at_8.38.54_PM Screenshot_2024-07-16_at_8.39.08_PM Screenshot_2024-07-16_at_8.39.19_PM Screenshot_2024-07-16_at_8.39.46_PM

Flow for metric for a multiple events, with some events not filterable

Screenshot_2024-07-16_at_8.41.47_PM Screenshot_2024-07-16_at_8.42.05_PM Screenshot_2024-07-16_at_8.42.13_PM Screenshot_2024-07-16_at_8.42.41_PM Screenshot_2024-07-16_at_8.43.08_PM Screenshot_2024-07-16_at_8.43.33_PM Screenshot_2024-07-16_at_8.43.39_PM Screenshot_2024-07-16_at_8.43.51_PM Screenshot_2024-07-16_at_8.44.03_PM Screenshot_2024-07-16_at_8.44.10_PM Screenshot_2024-07-16_at_8.44.19_PM Screenshot_2024-07-16_at_8.44.29_PM Screenshot_2024-07-16_at_8.44.49_PM

How to set up and validate locally

  1. run ruby scripts/internal_events/cli.rb
  2. follow the above screenshots to walk through the new flows
Edited by Sarah Yasonik

Merge request reports