Skip to content

Make event definition required for Internal events

What does this MR do and why?

Currently event definitions are not required for Internal Events. This leads to a lack of documentation for newly instrumented events, as well as the problem that it makes it impossible to create further validations around internal events, like making sure that the event name stays unique or reusing the event through the generator.

This MR adds a test that will fail if any metric definition with data_source: internal_events is refers to an event that doesn't have an event definition.

The following event names are currently missing event definitions. They will be added in a follow up MR and the allowlist (events_that_needs_definitions) will be removed.

g_compliance_dashboard
g_project_management_users_epic_issue_added_from_epic
i_analytics_dev_ops_adoption
i_analytics_dev_ops_score
user_edited_cluster_configuration
user_viewed_cluster_configuration
user_viewed_dashboard_list
user_viewed_instrumentation_directions
user_visited_dashboard

How to set up and validate locally

  1. Remove the an event definition (rm ee/config/events/user_viewed_custom_dashboard.yml)
  2. Run the spec (rspec spec/lib/gitlab/tracking/event_definition_spec.rb)
  3. Verify that the spec fails

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #428014 (closed)

Edited by Jonas Larsen

Merge request reports