From cf5c7ad2d6d4bf672375024d4d8b17ba19a27320 Mon Sep 17 00:00:00 2001 From: Ling Lan Date: Thu, 24 Mar 2022 18:55:42 -0500 Subject: [PATCH] set dynamic interval (#967) Signed-off-by: Marco llan@redhat.com --- .../controllers/observabilityendpoint/metrics_collector.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/operators/endpointmetrics/controllers/observabilityendpoint/metrics_collector.go b/operators/endpointmetrics/controllers/observabilityendpoint/metrics_collector.go index 78f7c8821..cc2f9dd22 100644 --- a/operators/endpointmetrics/controllers/observabilityendpoint/metrics_collector.go +++ b/operators/endpointmetrics/controllers/observabilityendpoint/metrics_collector.go @@ -57,6 +57,10 @@ func createDeployment(clusterID string, clusterType string, if fmt.Sprint(obsAddonSpec.Interval) == "" { interval = defaultInterval } + evaluateInterval := "30s" + if obsAddonSpec.Interval < 30 { + evaluateInterval = interval + } volumes := []corev1.Volume{ { @@ -116,6 +120,7 @@ func createDeployment(clusterID string, clusterType string, "--to-upload-cert=/tlscerts/certs/tls.crt", "--to-upload-key=/tlscerts/certs/tls.key", "--interval=" + interval, + "--evaluate-interval=" + evaluateInterval, "--limit-bytes=" + strconv.Itoa(limitBytes), fmt.Sprintf("--label=\"cluster=%s\"", hubInfo.ClusterName), fmt.Sprintf("--label=\"clusterID=%s\"", clusterID),