Implement aggregation of usage data for Container Registry AMAU
requested to merge 404728-implement-aggregation-of-usage-data-for-container-registry-amau into master
What does this MR do and why?
Closes #404728 (closed).
This MR adds two metric definitions on the aggregation of the existing metrics for write operations on the Container Registry that were added in !107918 (merged).
i_container_registry_push_tag_user
i_container_registry_delete_tag_user
i_container_registry_delete_repository_user
i_container_registry_create_repository_user
i_container_registry_push_repository_user
References
Reference Code:
- !108629 (merged)
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_28d/20210216184850_deploy_token_packages_total_unique_counts_monthly.yml
- https://gitlab.com/gitlab-org/gitlab/-/blob/master/config/metrics/counts_7d/20210216184848_deploy_token_packages_total_unique_counts_weekly.yml
Aggregated metrics: https://docs.gitlab.com/ee/development/service_ping/metrics_instrumentation.html#aggregated-metrics
Validation
- In the command prompt, you can validate that the definition is properly read:
curl http://gdk.test:3000/api/v4/usage_data/metric_definitions | grep -C 5 'i_container_registry_writes_user'
- In the rails console, you can also check that the new metrics are part of the usage data:
Open the rails console:
bundle exec rails c
And then query the following:
usage = GitlabServicePingWorker.new.usage_data;nil
usage.dig('redis_hll_counters', 'user_container_registry').keys.include?("i_container_registry_writes_user_weekly")
# => true
usage.dig('redis_hll_counters', 'user_container_registry').keys.include?("i_container_registry_writes_user_monthly")
# => true
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Related to #404728 (closed)
Edited by Adie (she/her)