Skip to content

Migrate i_code_review_saved_replies total counts to Internal Events

What does this MR do and why?

The following metrics never reported any values.

counts.i_code_review_saved_replies_count_use
counts.i_code_review_saved_replies_count_create
counts.i_code_review_saved_replies_use_in_mr
counts.i_code_review_saved_replies_use_in_other

They were implemented in anticipation of total counters getting added to Internal Events Tracking.

This MR updates the metric definition so that they will report the total counts.

How to set up and validate locally

  1. Copy this POC of a Internal Events Tracking to e.g. /tmp/monitor.rb
  2. Start the monitor bin/rails runner /tmp/monitor.rb i_code_review_saved_replies_use i_code_review_saved_replies_create i_code_review_saved_replies_use_in_mr i_code_review_saved_replies_use_in_other
  3. Start the Rails console: gdk rails console
  4. Trigger the different events and check that the total count metrics gets updated in the monitor
    1. Gitlab::InternalEvents.track_event("i_code_review_saved_replies_use", user: User.first)
    2. Gitlab::InternalEvents.track_event("i_code_review_saved_replies_create", user: User.first)
    3. Gitlab::InternalEvents.track_event("i_code_review_saved_replies_use_in_mr", user: User.first)
    4. Gitlab::InternalEvents.track_event("i_code_review_saved_replies_use_in_other", user: User.first)

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 #412999 (closed)

Edited by Sebastian Rehm

Merge request reports