From a1ad8623866f0f1b980e0cd72b45cac7c4716030 Mon Sep 17 00:00:00 2001 From: Douglas Camata <159076+douglascamata@users.noreply.github.com> Date: Thu, 26 Oct 2023 17:55:44 +0200 Subject: [PATCH] [ACM-3748] Set max source resolution to auto in Grafana datasource (#1264) * Set max source resolution to auto in Grafana datasource Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> * Move custom query parameter into jsondata Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --------- Signed-off-by: Douglas Camata <159076+douglascamata@users.noreply.github.com> --- .../multiclusterobservability/grafana.go | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go b/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go index a88d5720a..832f316ad 100644 --- a/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go +++ b/operators/multiclusterobservability/controllers/multiclusterobservability/grafana.go @@ -54,11 +54,12 @@ type GrafanaDatasource struct { } type JsonData struct { - TLSAuth bool `yaml:"tlsAuth,omitempty"` - TLSAuthCA bool `yaml:"tlsAuthWithCACert,omitempty"` - QueryTimeout string `yaml:"queryTimeout,omitempty"` - HttpMethod string `yaml:"httpMethod,omitempty"` - TimeInterval string `yaml:"timeInterval,omitempty"` + TLSAuth bool `yaml:"tlsAuth,omitempty"` + TLSAuthCA bool `yaml:"tlsAuthWithCACert,omitempty"` + QueryTimeout string `yaml:"queryTimeout,omitempty"` + HttpMethod string `yaml:"httpMethod,omitempty"` + TimeInterval string `yaml:"timeInterval,omitempty"` + CustomQueryParameters string `yaml:"customQueryParameters,omitempty"` } type SecureJsonData struct { @@ -94,8 +95,9 @@ func GenerateGrafanaDataSource( config.GetDefaultNamespace(), ), JSONData: &JsonData{ - QueryTimeout: "300s", - TimeInterval: fmt.Sprintf("%ds", mco.Spec.ObservabilityAddonSpec.Interval), + QueryTimeout: "300s", + CustomQueryParameters: "max_source_resolution=auto", + TimeInterval: fmt.Sprintf("%ds", mco.Spec.ObservabilityAddonSpec.Interval), }, }, { @@ -109,8 +111,9 @@ func GenerateGrafanaDataSource( config.GetDefaultNamespace(), ), JSONData: &JsonData{ - QueryTimeout: "300s", - TimeInterval: fmt.Sprintf("%ds", DynamicTimeInterval), + QueryTimeout: "300s", + CustomQueryParameters: "max_source_resolution=auto", + TimeInterval: fmt.Sprintf("%ds", DynamicTimeInterval), }, }, },