Creating new event based metric for Ci Builds
What does this MR do and why?
Creating new event based metric for Ci Builds
This is due to current metrics being too slow and db intensive
Changelog: other
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Updated at 2024-01-09 19:32:20 UTC [PAUSED]
Monitored events: create_ci_build
+---------------------------------------------------------------------------------------------------------------------------------------------------+
| RELEVANT METRICS |
+------------------------------------------------------------------------+------------------+-----------------------+---------------+---------------+
| Key Path | Monitored Events | Instrumentation Class | Initial Value | Current Value |
+------------------------------------------------------------------------+------------------+-----------------------+---------------+---------------+
| counts.count_total_create_ci_build | create_ci_build | TotalCountMetric | 4 | 15 |
| counts.count_total_create_ci_build_monthly | create_ci_build | TotalCountMetric | 4 | 15 |
| redis_hll_counters.count_distinct_user_id_from_create_ci_build_monthly | create_ci_build | RedisHLLMetric | 1 | 2 |
+------------------------------------------------------------------------+------------------+-----------------------+---------------+---------------+
+--------------------------------------------------------------------------------------------+
| SNOWPLOW EVENTS |
+-----------------+--------------------------+---------+--------------+------------+---------+
| Event Name | Collector Timestamp | user_id | namespace_id | project_id | plan |
+-----------------+--------------------------+---------+--------------+------------+---------+
| create_ci_build | 2024-01-09T19:19:28.852Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:28.840Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:28.827Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:28.785Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:26.371Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:26.278Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:26.257Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:19:26.163Z | 73 | 547 | 266 | default |
| create_ci_build | 2024-01-09T19:13:35.120Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T19:13:33.332Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T19:13:30.968Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T18:49:52.463Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T18:49:52.437Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T18:49:52.420Z | 1 | 1 | 285 | default |
| create_ci_build | 2024-01-09T18:49:52.316Z | 1 | 1 | 285 | default |
+-----------------+--------------------------+---------+--------------+------------+---------+
How to set up and validate locally
Setting up https://docs.gitlab.com/ee/development/internal_analytics/internal_event_instrumentation/local_setup_and_debugging.html#internal-events-monitor and trigging any ci_build will update the counts as shown in the screenshot above
Related to #429063 (closed)