Skip to content

Commit b83e05f

Browse files
committed
Remove the name label on cluster_version_risk_conditions
1 parent 1bda8e5 commit b83e05f

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
@@ -108,8 +108,8 @@ penultimate completed version for 'completed'.
108108
}, []string{"name", "condition", "reason"}),
109109
clusterVersionRiskConditions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
110110
Name: "cluster_version_risk_conditions",
111-
Help: "Report the risk conditions for cluster versions. 0 is False and 1 is True.",
112-
}, []string{"name", "condition", "risk"}),
111+
Help: "Report the risk conditions for the cluster version. 0 is False and 1 is True.",
112+
}, []string{"condition", "risk"}),
113113
clusterOperatorConditionTransitions: prometheus.NewGaugeVec(prometheus.GaugeOpts{
114114
Name: "cluster_operator_condition_transitions",
115115
Help: "Reports the number of times that a condition on a cluster operator changes status",
@@ -495,7 +495,7 @@ func (m *operatorMetrics) Describe(ch chan<- *prometheus.Desc) {
495495
ch <- m.capability.WithLabelValues("").Desc()
496496
ch <- m.clusterOperatorUp.WithLabelValues("", "", "").Desc()
497497
ch <- m.clusterOperatorConditions.WithLabelValues("", "", "").Desc()
498-
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "", "").Desc()
498+
ch <- m.clusterVersionRiskConditions.WithLabelValues("", "").Desc()
499499
ch <- m.clusterOperatorConditionTransitions.WithLabelValues("", "").Desc()
500500
ch <- m.clusterInstaller.WithLabelValues("", "", "").Desc()
501501
ch <- m.clusterVersionOperatorUpdateRetrievalTimestampSeconds.WithLabelValues("").Desc()
@@ -524,7 +524,7 @@ func (m *operatorMetrics) collectConditionalUpdateRisks(ch chan<- prometheus.Met
524524
continue
525525
}
526526

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

pkg/cvo/metrics_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1019,7 +1019,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10191019
},
10201020
},
10211021
expected: []valueWithLabels{{
1022-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1022+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10231023
}},
10241024
},
10251025
{
@@ -1037,7 +1037,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10371037
},
10381038
expected: []valueWithLabels{{
10391039
value: 1,
1040-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1040+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10411041
}},
10421042
},
10431043
{
@@ -1054,7 +1054,7 @@ func Test_collectConditionalUpdateRisks(t *testing.T) {
10541054
},
10551055
},
10561056
expected: []valueWithLabels{{
1057-
labels: map[string]string{"name": "version", "condition": "Applies", "risk": "RiskX"},
1057+
labels: map[string]string{"condition": "Applies", "risk": "RiskX"},
10581058
}},
10591059
},
10601060
}

0 commit comments

Comments
 (0)