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.

  1. ::Gitlab::WorkItems::Instrumentation::TrackingService this 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

  2. Gitlab::WorkItems::Instrumentation::EventActions, essentially a module to constantize the event names so we avoid using brittle strings throughout the codebase

  3. 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)

  4. Relevant specs

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  1. 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.

  2. 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.

  3. On each interaction, the SNOWPLOW EVENTS table in the terminal should update with the new event, the RELEVANT METRICS table will update the counters as well but most important is that you're seeing all of the 5 individual events.

Screenshot_2025-12-01_at_1.11.55_PM

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

Edited by Nasser Zahrani

Merge request reports

Loading