Instrument note related work item events
What does this MR do and why?
Part of the instrumentation that tracks events through direct calls to the tracking service. This MR in particular is a bit larger in scope as it is the first, thus introduces the minimal version of the tracking service itself, the event actions constants, relevant specs and shared examples.
Future MRs for direct calls will ONLY be the calls within the relevant code paths, and specs.
-
::Gitlab::WorkItems::Instrumentation::TrackingServicethis is the service object for tracking all new work item events. It generates the payload programatically if given an event, work item and user ensuring consistency. In future it will also encapsulate logic for more complex tracking, specifically calls to update a work item directly -
Gitlab::WorkItems::Instrumentation::EventActions, essentially a module to constantize the event names so we avoid using brittle strings throughout the codebase -
The calls to the service for tracking create/update/deletes of notes on work items, and create/delete of notes on designs on work items (Plan tracking schema doesn't include instrumentation for modifying notes on designs at the moment)
-
Relevant specs
References
Screenshots or screen recordings
| Before | After |
|---|---|
How to set up and validate locally
-
Run
bin/rails runner scripts/internal_events/monitor.rb work_item_note_create work_item_note_destroy work_item_note_update work_item_design_note_destroy work_item_design_note_create, t his will open up a monitoring view to track emissions of these events from within GDK as well as the relevant metrics. -
Within GDK, trigger all 5 of the events instrumented in this MR, add a note to a work item, update that note, then delete it. Also, add a design to the work item, then click on a coordinate on the design and add a comment, then delete that comment.
-
On each interaction, the
SNOWPLOW EVENTStable in the terminal should update with the new event, theRELEVANT METRICStable will update the counters as well but most important is that you're seeing all of the 5 individual events.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Related to #579672
