Fix Service Ping every metric definition test
What does this MR do and why?
Related to #354134 (closed)
This MR is meant to serve two purposes:
- Use
BuildPayloadService
instead ofServicePingReport
because payload fromServicePingReport
is later filtered byBuildPayloadService
before being reported - Add a new test assuring that there are no unused instrumentation classes
I also fixed a typo in a comment of lib/gitlab/usage/service_ping/instrumented_payload.rb
.
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
- Add a new
Gitlab::Usage::Metrics::Instrumentations
class - Run the spec added in this MR. It should fail now.
- Use the new metrics class when building service ping payload, eg invoke
add_metric('YourMetricClassName')
in a UsageData method. - Run the spec added in this MR. It should pass now.
The same steps should also work for a metrics class nested inside a module, eg Gitlab::Usage::Metrics::Instrumentations::TestModule1::TestModule2::TestMetric
.
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.
Edited by Michał Wielich