Skip to content

Commit 688bf45

Browse files
committed
pkg/cvo/metrics: Serve cluster_version_available_updates when channel is set
Since 8b91189 (cvo: Add prometheus metrics to the CVO for current update state, 2018-11-05, #45), cluster_version_available_updates is only served when there are unconditionally-recommended updates and retrieval is succeeding. This makes it hard to understand at the fleet level when: cluster_operator_conditions{name="version", condition="RetrievedUpdates", reason="VersionNotFound"} == 0 is because of a misconfigured channel, or a misbehaving Update Service, or otherwise. We should always export cluster_version_available_updates whenever a channel is set, to make it easier to isolate the “because the cluster-admin has somehow selected a channel not compatible with their current version” (which we can’t do much about other than keep serving our existing CannotRetrieveUpdates alert) from the other possibilities (which we might be able to do something about).
1 parent 6d31e54 commit 688bf45

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pkg/cvo/metrics.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ func (m *operatorMetrics) Collect(ch chan<- prometheus.Metric) {
629629
ch <- g
630630
}
631631

632-
if len(cv.Spec.Upstream) > 0 || len(cv.Status.AvailableUpdates) > 0 || resourcemerge.IsOperatorStatusConditionTrue(cv.Status.Conditions, configv1.RetrievedUpdates) {
632+
if len(cv.Spec.Channel) > 0 {
633633
upstream := "<default>"
634634
if len(m.optr.updateService) > 0 {
635635
upstream = string(m.optr.updateService)

0 commit comments

Comments
 (0)