Skip to content

Let Internal Events Tracking generator work with existing events

What does this MR do and why?

The Internal Events Tracking generator doesn't work if the provided event already exist.

It is a common use-case to add multiple metrics for the same event so that should be fixed.

How to set up and validate locally

  1. Switch to master
  2. Run the following command
bin/rails g gitlab:analytics:internal_events \
  --time_frames=7d \
  --group=project_management \
  --stage=plan --section=dev \
  --event=ci_templates_unique \
  --unique=user.id \
  --mr=https://gitlab.com/gitlab-org/gitlab/-/merge_requests/1337
  1. Watch it fail
  2. Switch to this branch
  3. Fill out the description for the metric definition with this text: Why did the text cross the road? To hit fifty chars!
  4. Verify that only config/metrics/counts_7d/count_distinct_user_id_from_ci_templates_unique_7d.yml was created

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #415446 (closed)

Edited by Jonas Larsen

Merge request reports

Loading