Additional internal event properties handling
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
- Enable snowplow micro
- 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 })
- Check if a new event with that includes the sent property, label and value has been registered at
localhost:9090/micro/good
- Add an event with mapping: following the new instructions in the
internal_event_instrumentation/quick_start.md
file, add aproperties
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
- Clean up the memoized events library by running
reload!
in the console - 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 })
- 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