diff --git a/controller/metrics/prommetrics.go b/controller/metrics/prommetrics.go index 02ed83af92..3e55ba1ccb 100644 --- a/controller/metrics/prommetrics.go +++ b/controller/metrics/prommetrics.go @@ -58,6 +58,13 @@ var ( nil, ) + MetricRolloutInfoReplicasUpdated = prometheus.NewDesc( + "rollout_info_replicas_updated", + "The number of updated replicas per rollout.", + namespaceNameLabels, + nil, + ) + MetricRolloutEventsTotal = prometheus.NewCounterVec( prometheus.CounterOpts{ Name: "rollout_events_total", diff --git a/controller/metrics/rollout_test.go b/controller/metrics/rollout_test.go index b10af8b184..2afa173b3e 100644 --- a/controller/metrics/rollout_test.go +++ b/controller/metrics/rollout_test.go @@ -113,7 +113,13 @@ rollout_info_replicas_available{name="guestbook-bluegreen",namespace="default"} rollout_info_replicas_desired{name="guestbook-bluegreen",namespace="default"} 1 # HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. # TYPE rollout_info_replicas_unavailable gauge -rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0`, +rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0 +# HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. +# TYPE rollout_info_replicas_unavailable gauge +rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0 +# HELP rollout_info_replicas_updated The number of updated replicas per rollout. +# TYPE rollout_info_replicas_updated gauge +rollout_info_replicas_updated{name="guestbook-bluegreen",namespace="default"} 0`, }, { @@ -131,7 +137,13 @@ rollout_info_replicas_available{name="guestbook-bluegreen",namespace="default"} rollout_info_replicas_desired{name="guestbook-bluegreen",namespace="default"} 1 # HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. # TYPE rollout_info_replicas_unavailable gauge -rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0`, +rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0 +# HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. +# TYPE rollout_info_replicas_unavailable gauge +rollout_info_replicas_unavailable{name="guestbook-bluegreen",namespace="default"} 0 +# HELP rollout_info_replicas_updated The number of updated replicas per rollout. +# TYPE rollout_info_replicas_updated gauge +rollout_info_replicas_updated{name="guestbook-bluegreen",namespace="default"} 0`, }, { fakeCanaryRollout, @@ -148,7 +160,13 @@ rollout_info_replicas_available{name="guestbook-canary",namespace="default"} 1 rollout_info_replicas_desired{name="guestbook-canary",namespace="default"} 1 # HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. # TYPE rollout_info_replicas_unavailable gauge -rollout_info_replicas_unavailable{name="guestbook-canary",namespace="default"} 0`, +rollout_info_replicas_unavailable{name="guestbook-canary",namespace="default"} 0 +# HELP rollout_info_replicas_unavailable The number of unavailable replicas per rollout. +# TYPE rollout_info_replicas_unavailable gauge +rollout_info_replicas_unavailable{name="guestbook-canary",namespace="default"} 0 +# HELP rollout_info_replicas_updated The number of updated replicas per rollout. +# TYPE rollout_info_replicas_updated gauge +rollout_info_replicas_updated{name="guestbook-canary",namespace="default"} 0`, }, } diff --git a/controller/metrics/rollouts.go b/controller/metrics/rollouts.go index 54a0c8af01..3d25de5a72 100644 --- a/controller/metrics/rollouts.go +++ b/controller/metrics/rollouts.go @@ -131,6 +131,7 @@ func collectRollouts(ch chan<- prometheus.Metric, rollout *v1alpha1.Rollout) { addGauge(MetricRolloutInfoReplicasAvailable, float64(rollout.Status.AvailableReplicas)) addGauge(MetricRolloutInfoReplicasUnavailable, float64(rollout.Status.Replicas-rollout.Status.AvailableReplicas)) addGauge(MetricRolloutInfoReplicasDesired, float64(defaults.GetReplicasOrDefault(rollout.Spec.Replicas))) + addGauge(MetricRolloutInfoReplicasUpdated, float64(rollout.Status.UpdatedReplicas)) // DEPRECATED addGauge(MetricRolloutPhase, boolFloat64(calculatedPhase == RolloutCompleted), strategyType, string(RolloutCompleted)) diff --git a/docs/features/controller-metrics.md b/docs/features/controller-metrics.md index 72e2df3561..def8bba734 100644 --- a/docs/features/controller-metrics.md +++ b/docs/features/controller-metrics.md @@ -46,10 +46,12 @@ You can import this Dashboard in your Grafana installation [as a JSON file](http The Argo Rollouts controller publishes the following prometheus metrics about Argo Rollout objects. | Name | Description | -| ----------------------------------- | ----------- | +|-------------------------------------| ----------- | | `rollout_info` | Information about rollout. | | `rollout_info_replicas_available` | The number of available replicas per rollout. | | `rollout_info_replicas_unavailable` | The number of unavailable replicas per rollout. | +| `rollout_info_replicas_desired` | The number of desired replicas per rollout. | +| `rollout_info_replicas_updated` | The number of updated replicas per rollout. | | `rollout_phase` | Information on the state of the rollout. | | `rollout_reconcile` | Rollout reconciliation performance. | | `rollout_reconcile_error` | Error occurring during the rollout. |