Expose category in internal events
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.
- Start the monitor:
rails runner scripts/internal_events/monitor.rb i_code_review_user_create_mr - Start the Rails console (
gdk rails console) - Trigger an event without category:
Gitlab::InternalEvents.track_event('i_code_review_user_create_mr', user: User.first, project: Project.first) - Trigger an event with category:
Gitlab::InternalEvents.track_event('i_code_review_user_create_mr', category: 'MyClass', user: User.first, project: Project.first) - In the Monitor, verify that the category values are correct.
categoryshould beInternalEventTrackingfor the first event andMyClassfor the second.
Related to #435200 (closed)
Edited by Jonas Larsen