Skip to content

Commit 2b5364a

Browse files
committed
Remove the name label on cluster_version_risk_conditions
1 parent 0d1ee9c commit 2b5364a

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

pkg/cvo/metrics.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ penultimate completed version for 'completed'.
106106
}, []string{"name", "condition", "reason"}),
107107
clusterVersionRiskConditions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
108108
Name: "cluster_version_risk_conditions",
109-
Help: "Report the risk conditions for cluster versions. 0 is False and 1 is True.",
110-
}, []string{"name", "condition", "risk"}),
109+
Help: "Report the risk conditions for the cluster version. 0 is False and 1 is True.",
110+
}, []string{"condition", "risk"}),
111111
clusterOperatorConditionTransitions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
112112
Name: "cluster_operator_condition_transitions",
113113
Help: "Reports the number of times that a condition on a cluster operator changes status",
@@ -493,7 +493,7 @@ func (m *operatorMetrics) Describe(ch chan<- *prometheus.Desc) {
493493
ch <- m.capability.WithLabelValues("").Desc()
494494
ch <- m.clusterOperatorUp.WithLabelValues("", "", "").Desc()
495495
ch <- m.clusterOperatorConditions.WithLabelValues("", "", "").Desc()
496-
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "", "").Desc()
496+
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "").Desc()
497497
ch <- m.clusterOperatorConditionTransitions.WithLabelValues("", "").Desc()
498498
ch <- m.clusterInstaller.WithLabelValues("", "", "").Desc()
499499
ch <- m.clusterVersionOperatorUpdateRetrievalTimestampSeconds.WithLabelValues("").Desc()
@@ -522,7 +522,7 @@ func (m *operatorMetrics) collectConditionalUpdateRisks(ch chan<- prometheus.Met
522522
continue
523523
}
524524

525-
g := m.clusterVersionRiskConditions.WithLabelValues("version", condition.Type, risk.Name)
525+
g := m.clusterVersionRiskConditions.WithLabelValues(condition.Type, risk.Name)
526526
if condition.Status == metav1.ConditionTrue {
527527
g.Set(1)
528528
} else {

pkg/cvo/metrics_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,7 +1017,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10171017
},
10181018
},
10191019
expected: []valueWithLabels{{
1020-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1020+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10211021
}},
10221022
},
10231023
{
@@ -1035,7 +1035,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10351035
},
10361036
expected: []valueWithLabels{{
10371037
value: 1,
1038-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1038+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10391039
}},
10401040
},
10411041
{
@@ -1052,7 +1052,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10521052
},
10531053
},
10541054
expected: []valueWithLabels{{
1055-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1055+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10561056
}},
10571057
},
10581058
}

0 commit comments

Comments
 (0)