Skip to content

Expose category in internal events

Jonas Larsen requested to merge 435200-expose-category-in-internal-events into master

What does this MR do and why?

This is a first of several MRs to address #435200 (closed). It will allow us to add a "location" from where the event was triggered.

This MR simply category in the track_event method.

In addition the category value is now visible in the Internal Events monitor to make it easier to validate that category is used correct.

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.

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

  1. Start the monitor: rails runner scripts/internal_events/monitor.rb i_code_review_user_create_mr
  2. Start the Rails console (gdk rails console)
  3. Trigger an event without category: Gitlab::InternalEvents.track_event('i_code_review_user_create_mr', user: User.first, project: Project.first)
  4. Trigger an event with category: Gitlab::InternalEvents.track_event('i_code_review_user_create_mr', category: 'MyClass', user: User.first, project: Project.first)
  5. In the Monitor, verify that the category values are correct. category should be InternalEventTracking for the first event and MyClass for the second.

Related to #435200 (closed)

Edited by Jonas Larsen

Merge request reports