Implement new Redis HLL Counters for Work Items
Problem to solve
We need a more scalable redis counter schema for work items that is inclusive of Plan xMAU, Project Management xMAU, and Product Planning xMAU. We cannot aggregate and dedupe events across features within a group or at the stage level with our current redis slot schema.
All three Plan product groups will be using the same base object -- work item. Each product group still needs to track MAU. Is there a better way to approach this given the current constraints and behaviors of our Redis HLL counters?
Proposal
- Implement new counter schema
- Schema is based on individual actions which are then added to aggregate counters depending on what action was taken and which product groups the xMAU most strongly aligns to.
- Use
users
as a sharedredis_slot
to allow de-duplication of unique users across all events within Plan. This will allow us to achieve a single, de-duplicated stage-level xMAU while also having the same level of visibility among product groups. If we want to expand to categories, this same pattern would work for that as well. - Once epics have been migrated to work items, remove all legacy Plan xMAU Redis HLL counters.
Acceptance
-
Service Ping schema approved -
Add schema to https://docs.gitlab.com/ee/development/work_items.html#362400 (closed) -
Implement the first batch of the new counters for the tasks MVC.
Counter Schema for Work Items
Field | Possible Values |
---|---|
name |
unique, descriptive action name |
category |
most relevant object name to provide context on where the action was taken (ex: work_item , milestone , iteration , namespace ...) |
redis_slot |
users (when tracking xMAU), count (when tracking aggregate action counts) |
aggregation |
weekly |
feature_flag |
name of feature flag gating this particular counter (optional) |
graph TD
Event[Specific Interaction Counter] --> AC[Aggregate Counters]
AC --> Plan[Plan xMAU]
AC --> PM[Project Management xMAU]
AC --> PP[Product Planning xMAU]
AC --> Cer[Certify xMAU]
AC --> WI[Work Items Users]
Proposed template for issues that need new counters as part of their acceptance criteria:
- **name:** `replace with unique, descriptive action name`
- **category:** `replace with relevant object name`
- **redis_slot:** `users`
- **include in the following aggregation counters:**
- [ ] `xmau_plan`
- [ ] `xmau_project_management`
- [ ] `xmau_product_planning`
- [ ] `xmau_certify`
- [ ] `users_work_items`
- [ ] new aggregate counter (name: `replace with name of new aggregate counter here`)
- **documentation:** [Service Ping Implementation](https://docs.gitlab.com/ee/development/service_ping/implement.html), [Redis HLL Counters](https://docs.gitlab.com/ee/development/service_ping/implement.html#redis-hll-counters)
Implementation Steps
See https://docs.gitlab.com/ee/development/service_ping/implement.html and https://docs.gitlab.com/ee/development/service_ping/implement.html#redis-hll-counters
Tasks Example
User creating work item
We will maintain counters for each individual type of interaction on a work item, but we will not segment these interactions by product group. This avoids having to implement and maintain 3x as many counters. We can also track all interactions on a work item by product group in an aggregate counter.
name: users_creating_work_items
category: work_item
redis_slot: users
aggregation: weekly
feature_flag: track_work_items_activity ## optional
YAML Metric Definition:
key_path: users_creating_work_items
description: Unique users creating work items
product_category: team planning
product_section: dev
product_stage: plan
product_group: group::project management
value_type: number
status: active
milestone: TBD
introduced_by_url: TBD
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
User updating work item title
name: users_updating_work_item_title
category: work_item
redis_slot: users
aggregation: weekly
feature_flag: track_work_items_activity ## optional
YAML Metric Definition:
key_path: users_updating_work_item_title
description: Unique users updating a work item's title
product_category: team planning
product_section: dev
product_stage: plan
product_group: group::project management
value_type: number
status: active
milestone: TBD
introduced_by_url: TBD
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
Aggregate counters
Important: Every time a new counter is added, it must also be included in the relevant aggregate counters!
Plan xMAU:
Store in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/common.yml
- name: xmau_plan
operator: OR
source: redis
time_frame: [7d, 28d]
events:
- users_creating_work_items
- users_updating_work_item_title
YAML Metric Definition:
key_path: xmau_plan
description: Unique users interacting with Plan features
product_category: team planning
product_section: dev
product_stage: plan
product_group: group::project management
value_type: number
status: active
milestone: TBD
introduced_by_url: TBD
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
Project Management xMAU:
Store in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/common.yml
- name: xmau_project_management
operator: OR
source: redis
time_frame: [7d, 28d]
events:
- users_creating_work_items
- users_updating_work_item_title
YAML Metric Definition:
key_path: xmau_project_management
description: Unique users interacting with Project Management features
product_category: team planning
product_section: dev
product_stage: plan
product_group: group::project management
value_type: number
status: active
milestone: TBD
introduced_by_url: TBD
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate
Work Items Users:
Store in https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/aggregates/common.yml
- name: users_work_items
operator: OR
source: redis
time_frame: [7d, 28d]
events:
- users_creating_work_items
- users_updating_work_item_title
YAML Metric Definition:
key_path: users_work_items
description: Unique users interacting with work items
product_category: team planning
product_section: dev
product_stage: plan
product_group: group::project management
value_type: number
status: active
milestone: TBD
introduced_by_url: TBD
time_frame: 28d
data_source: redis_hll
distribution:
- ce
- ee
tier:
- free
- premium
- ultimate