Use feature from know_events yml files for checking the features
For events tracked using Redis HLL
We added feature attribute in events definition known_events.yml
, now is for information purpose !46853 (merged)
We can now use the check of the features defined there when tracking events. This way we ensure a single source of truth.
Also we could have multiple events under the same feature.
Currently this is set differently for different implementation for tracking, making it hard to maintain, remove or enabled/diable.
Upper layers check for feature flag in Redis HLL tracking
Helpers
-
Update Gitlab::UsageDataCounters::HLLRedisCounter
to check for the feature flag defined for each event. -
app/controllers/concerns/redis_tracking.r -
app/helpers/analytics/unique_visits_helper.rb !54202 (merged) -
lib/gitlab/utils/usage_data.rb !54208 (merged) -
lib/api/helpers.rb
Models
Services
-
app/services/git/branch_hooks_service.rb !60361 (merged) -
app/services/packages/create_event_service.rb
Custom counters implementations
-
/lib/gitlab/usage_data_counters/editor_unique_counter.r !60360 (merged) -
lib/gitlab/usage_data_counters/ci_template_unique_counter.rb -
lib/gitlab/usage_data_counters/issue_activity_unique_counter.rb# -
/lib/gitlab/usage_data_counters/quick_action_activity_unique_counter.rb# !59914 (merged)
Proposal
Try to change this in smaller steps
-
Update
Gitlab::UsageDataCounters::HLLRedisCounter
to check for the feature flag defined for each event. -
This approach would lead to checking 2 times the feature flag one time in upper layer and one time in
Gitlab::UsageDataCounters::HLLRedisCounter
. This is a compromise w could have until we remove the individual check. -
Use default_enabled: :yaml
-
Pick one tracking implementation and remove the individual feature check.
-
Once
Gitlab::UsageDataCounters::HLLRedisCounter
is changed we can remove individual feature checks in separate MRs