Add ci catalog component usage tracking
What does this MR do and why?
Tracking using ci catalog event: cicd_component_usage
.
Feature issue.
How to set up and validate locally
- Checkout my branch
- Verify the event exist:
service_ping_payload = Gitlab::Usage::ServicePingReport.for(output: :non_sql_metrics_values)
service_ping_payload['redis_hll_counters']['pipeline_authoring']
See count_cicd_component_usage_monthly
and count_cicd_component_usage_weekly
present in the list.
-
Check the count of events for
::Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'cicd_component_usage', start_date: Date.today - 1, end_date: Date.today + 7.days)
-
Create and use a ci catalog component
-
Check again the count of events have gone up by one
::Gitlab::UsageDataCounters::HLLRedisCounter.unique_events(event_names: 'cicd_component_usage', start_date: Date.today - 1, end_date: Date.today + 7.days)
-
If you'd like to see the Service Ping payload counters incremented, then you can track a mocked event set to a week ago and then check the Service Ping payload output.
::Gitlab::UsageDataCounters::HLLRedisCounter.track_event('cicd_component_usage', values: "component_location", time: Date.today - 7.days)
service_ping_payload = Gitlab::Usage::ServicePingReport.for(output: :non_sql_metrics_values)
service_ping_payload['redis_hll_counters']['pipeline_authoring']
Once this is merged
you can see the query in: https://metrics.gitlab.com/?q=cicd_component_usage, and then use that to add a widget to Sisense.
Exisiting pipeline authoring metrics.
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.