Implement feature flag per event tracked using Redis HLL counter
Problem to solve
There are Redis performance and scalability concerns.
We want to be able to control tracking of events and be able to identify and enable/disable events that could cause issues.
Events we track using Redis HLL
After several discussion around this topic we got that around 100 events we should consider implementing this
Proposal
Implement feature per event
https://docs.gitlab.com/ee/development/feature_flags/development.html
If we encounter metrics that call Redis often we should be able to disable the feature in order to not affect the application.
Consider using feature type: ops
with actors
Steps for implementing feature actors for events tracking
-
Have an event class with a method flipper_id
example !42466 (diffs) -
Implement known_events API, in order to be used by chatops(Similar with what we have for projects) -
Implement command in chatops(Similar with what we have for projects) -
Migrate exiting features that are now implemented for tracking events to the new feature
Requirements
- Be able to easily enable/disable tracking of a given event.
- Be able to enable feature for tracking all events
Current situation
There are 78 events defined in known_events.yml
- there events having feature flag "usage_data_#{event_name}"
- events in a category having one feature flag per category
- events with no feature flag
By default it is desired to have all events feature flags default_enabled: true
(Continue here with list of feature we have for this case)
Related issue
Relates with #232831 (closed)