diff --git a/cluster-autoscaler/core/static_autoscaler.go b/cluster-autoscaler/core/static_autoscaler.go index 0e3dd869fce1..cfbf2c249f54 100644 --- a/cluster-autoscaler/core/static_autoscaler.go +++ b/cluster-autoscaler/core/static_autoscaler.go @@ -260,7 +260,9 @@ func (a *StaticAutoscaler) RunOnce(currentTime time.Time) errors.AutoscalerError } // Call CloudProvider.Refresh before any other calls to cloud provider. + refreshStart := time.Now() err = a.AutoscalingContext.CloudProvider.Refresh() + metrics.UpdateDurationFromStart(metrics.CloudProviderRefresh, refreshStart) if err != nil { klog.Errorf("Failed to refresh cloud provider config: %v", err) return errors.ToAutoscalerError(errors.CloudProviderError, err) diff --git a/cluster-autoscaler/metrics/metrics.go b/cluster-autoscaler/metrics/metrics.go index 9580ee3344c0..41b7fb7a9d97 100644 --- a/cluster-autoscaler/metrics/metrics.go +++ b/cluster-autoscaler/metrics/metrics.go @@ -90,6 +90,7 @@ const ( FindUnneeded FunctionLabel = "findUnneeded" UpdateState FunctionLabel = "updateClusterState" FilterOutSchedulable FunctionLabel = "filterOutSchedulable" + CloudProviderRefresh FunctionLabel = "cloudProviderRefresh" Main FunctionLabel = "main" Poll FunctionLabel = "poll" Reconfigure FunctionLabel = "reconfigure"