Add Basic Redis HLL module
More context here #232831 (closed)
What does this MR do?
Add a module for tracking events unsing Redis HLL Gitlab::UsageDataCounters::HLLRedisCounter
With this MR
-
Add custom KEY_EXPIRY_LENGTH, the expiry values 6 weeks for weekly and 29 days for daily -
Add a base key format -
Add a yml file with know events -
Add HLLRedisCounter -
Implement feature per event, per actor, user https://docs.gitlab.com/ee/development/feature_flags/development.html#feature-actorsMove this in a separate issue #235954 (closed) -
Add more tests
Example of usage:
Track expand_vulnerabilities event using Redis HLL
Keep in mind to add a feature flag per event with user actor for percentage rollout
# Define the event in known_events.yml
- name: expand_vulnerabilities
category: vulnerabilities
aggregation: daily
# Tracking event
Gitlab::UsageDataCounters::HLLRedisCounter.track_event(visitor_id, 'expand_vulnerabilities')
# Get event data
Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'expand_vulnerabilities', start_date: start_date, end_date: end_date)
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Related #235697 (closed)
Edited by Alina Mihaila