-
Miciah Masters authored
Add an ingress_controller_conditions Prometheus metric that reports the status conditions of ingresscontrollers, and add Prometheus rules to raise alerts if an ingresscontroller is unavailable or degraded. This commit is related to bug 1955854. https://bugzilla.redhat.com/show_bug.cgi?id=1955854 * cmd/ingress-operator/start.go (start): Call StartMetricsListener from the operator package, and call RegisterMetrics from the ingress and canary controller packages. * manifests/0000_90_ingress-operator_03_prometheusrules.yaml: Add alerts using the new ingress_controller_conditions metric to warn if an ingresscontroller is degraded or unavailable. * pkg/manifests/bindata.go: Regenerate. * pkg/operator/controller/canary/metrics.go (registerCanaryMetrics): Rename from this... (RegisterMetrics): ...to this. (StartMetricsListener): Move from here... * pkg/operator/metrics.go: ...to here. New file. * pkg/operator/controller/ingress/metrics.go (ingressControllerConditions): New variable. Define a "ingress_controller_conditions" Prometheus gauge. (metricsList): New variable. Define the list of metrics for this controller. Currently this list comprises ingressControllerConditions. (reportedConditions): New variable. Define the ingresscontroller status conditions that are published in the ingress_controller_conditions metric. (SetIngressControllerConditionsMetric): New function. Update the new "ingress_controller_conditions" gauge with the status conditions of the given ingresscontroller. (RegisterMetrics): New function. Register metricsList with Prometheus. * pkg/operator/controller/ingress/status.go (syncIngressControllerStatus): Call SetIngressControllerConditionsMetric after updating status conditions.
434b24eb