Skip to content

Commit 5c4a331

Browse files
committed
Remove the name label on cluster_version_risk_conditions
1 parent 2822b83 commit 5c4a331

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
@@ -111,8 +111,8 @@ penultimate completed version for 'completed'.
111111
}, []string{"name", "condition", "reason"}),
112112
clusterVersionRiskConditions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
113113
Name: "cluster_version_risk_conditions",
114-
Help: "Report the risk conditions for cluster versions. 0 is False and 1 is True.",
115-
}, []string{"name", "condition", "risk"}),
114+
Help: "Report the risk conditions for the cluster version. 0 is False and 1 is True.",
115+
}, []string{"condition", "risk"}),
116116
clusterOperatorConditionTransitions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
117117
Name: "cluster_operator_condition_transitions",
118118
Help: "Reports the number of times that a condition on a cluster operator changes status",
@@ -441,7 +441,7 @@ func (m *operatorMetrics) Describe(ch chan<- *prometheus.Desc) {
441441
ch <- m.capability.WithLabelValues("").Desc()
442442
ch <- m.clusterOperatorUp.WithLabelValues("", "", "").Desc()
443443
ch <- m.clusterOperatorConditions.WithLabelValues("", "", "").Desc()
444-
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "", "").Desc()
444+
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "").Desc()
445445
ch <- m.clusterOperatorConditionTransitions.WithLabelValues("", "").Desc()
446446
ch <- m.clusterInstaller.WithLabelValues("", "", "").Desc()
447447
ch <- m.clusterVersionOperatorUpdateRetrievalTimestampSeconds.WithLabelValues("").Desc()
@@ -470,7 +470,7 @@ func (m *operatorMetrics) collectConditionalUpdateRisks(ch chan<- prometheus.Met
470470
continue
471471
}
472472

473-
g := m.clusterVersionRiskConditions.WithLabelValues("version", condition.Type, risk.Name)
473+
g := m.clusterVersionRiskConditions.WithLabelValues(condition.Type, risk.Name)
474474
if condition.Status == metav1.ConditionTrue {
475475
g.Set(1)
476476
} 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)