Skip to content

Additional internal event properties handling

Michał Wielich requested to merge michold-internal-extras into master

What does this MR do and why?

Related to #434504 (closed)

Make it possible to pass property, value & label to InternalEvents.

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

How to set up and validate locally

  1. Enable snowplow micro
  2. Trigger an event that has the new attributes: for example, open the console and perform Gitlab::InternalEvents.track_event('user_viewed_dashboard_list', user: User.first, additional_properties: { label: 'event_label', property: 'event_prop', value: 123 })
  3. Check if a new event with that includes the sent property, label and value has been registered at localhost:9090/micro/good
  4. Add an event with mapping: following the new instructions in the internal_event_instrumentation/quick_start.md file, add a properties section to a new or an existing event file. For example, add this segment into the user_viewed_dashboard_list.yml file:
properties:
  user_role:
    external_key: label
  1. Clean up the memoized events library by running reload! in the console
  2. Trigger this event using the mapped keys, for example: Gitlab::InternalEvents.track_event('user_viewed_dashboard_list', user: User.first, additional_properties: { user_role: 'admin', value: 14 })
  3. Check if a new event with that includes the sent property, label and/or value has been registered at localhost:9090/micro/good
Edited by Michał Wielich

Merge request reports