Usage Ping: Use Prometheus recording rules
What does this MR do?
Depends on: omnibus-gitlab!4343 (merged)
We recently introduced Usage Ping functionality that pulls data from the bundled Omnibus Prometheus (assuming it is running.) This is now documented here: https://docs.gitlab.com/ee/development/telemetry/usage_ping.html#prometheus-queries
In the initial iteration that shipped with 13.1, these queries were sent to Prometheus ad-hoc, i.e. for every single data point we wanted to track we had to send one query. This creates complexity in the client and is questionable from a performance perspective (see omnibus-gitlab!4343 (merged) for more details.)
In this MR we implented the client-side counterpart for omnibus-gitlab!4343 (merged), i.e. we are now sending a single PromQL query that pulls all gitlab_usage_ping:...
metrics in one fell swoop, then maps it to usage ping JSON in the client.
There is one additional change, which is that we now also map out the application_requests_per_hour
, which didn't exist before. Outside of that there shouldn't be changes in semantics, it's mostly a structural change.
Apologies for the noisy MR, but most of the diffs should actually be removing code and adding more complete file based Promtheus fixtures, the actual client code is much smaller now.
Does this MR meet the acceptance criteria?
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
-
Tested manually in GCK container -
Tested in Omnibus container
References
- Epic: &3209
- Request volume metric: #217698 (closed)
- Use recording rules: #218548 (closed)