Skip to content

Commit 0138472

Browse files
committed
fix(metrics): include additional check metric labels in canary_check_invalid_count
When --metric-labels-allowlist is configured, OpsInvalidCount was registered with only the base 8 labels while Record() called it with checkMetricLabels that include the additional labels. This caused Prometheus label mismatch panics which were silently swallowed by recover(), resulting in invalid check metrics not being recorded. Fix: use checkLabels (which appends AdditionalCheckMetricLabels) for OpsInvalidCount, matching all other counters that already use it.
1 parent a27b397 commit 0138472

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/metrics/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func SetupMetrics() {
6262
Name: "canary_check_invalid_count",
6363
Help: "The total number of invalid checks",
6464
},
65-
[]string{"type", "endpoint", "canary_name", "canary_namespace", "owner", "severity", "key", "name"},
65+
checkLabels,
6666
)
6767

6868
CanaryCheckInfo = prometheus.NewGaugeVec(

0 commit comments

Comments
 (0)