Skip to content

Add additional properties to monitor

What does this MR do and why?

It makes additional_properties sent to Internal Events visible in the monitor since it is practical for debugging purposes.

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.

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After
image image

How to set up and validate locally

  1. Start the monitor in one terminal: rails runner scripts/internal_events/monitor.rb perform_epics_action.
  2. Create a few events in gdk rails console:
    Gitlab::InternalEvents.track_event('perform_epics_action', user: User.first, project: Project.first, additional_properties: {label: 'abc', property: 'created', value: 42})
    Gitlab::InternalEvents.track_event('perform_epics_action', additional_properties: {label: 'foo'})
    Gitlab::InternalEvents.track_event('perform_epics_action')
  3. The Snowplow events table in the monitor should now look something like this:
+-------------------------------------------------------------------------------------------------------------------------------------------------+
|                                                                 SNOWPLOW EVENTS                                                                 |
+----------------------+--------------------------+-----------------------+---------+--------------+------------+------+-------+----------+-------+
| Event Name           | Collector Timestamp      | Category              | user_id | namespace_id | project_id | plan | Label | Property | Value |
+----------------------+--------------------------+-----------------------+---------+--------------+------------+------+-------+----------+-------+
| perform_epics_action | 2024-05-02T20:14:52.127Z | InternalEventTracking | 1       | 22           | 1          | free |       |          |       |
| perform_epics_action | 2024-05-02T20:14:47.092Z | InternalEventTracking | 1       | 22           | 1          | free | abc   |          |       |
| perform_epics_action | 2024-05-02T20:13:28.627Z | InternalEventTracking | 1       | 22           | 1          | free | abc   | created  | 42.0  |
+----------------------+--------------------------+-----------------------+---------+--------------+------------+------+-------+----------+-------+

Related to #435338 (closed)

Edited by Jonas Larsen

Merge request reports