Adding a metric without a definition doesn't fail `ee/spec/config/metrics/every_metric_definition_spec.rb` specs
Problem
There's an MR that added a new metric without a definition and it didn't fail guard specs - !91335 (comment 1015494251).
This is because we test in ee/spec/config/metrics/every_metric_definition_spec.rb
against ServicePing::BuildPayload
, which has already filtered out invalid keys, instead of Gitlab::Usage::ServicePingReport
.
The filtering in BuildPayload
is supposed to prevent dynamically-added metrics from adding some random metrics and creating problems for the data warehouse import, since it has a strict schema. However, we stopped tracking metrics without definitions entirely by testing against this already-filtered payload.
Solution
-
Make Every metric definition
specs fail on metrics without metric definitions by modifying the specs to test againstGitlab::Usage::ServicePingReport
or otherwise -
Add all possible missing metric definitions due to this bug
Edited by Michał Wielich