Skip to content

Commit

Permalink
[ACM-3748] Set max source resolution to auto in Grafana datasource (s…
Browse files Browse the repository at this point in the history
…tolostron#1264)

* Set max source resolution to auto in Grafana datasource

Signed-off-by: Douglas Camata <[email protected]>

* Move custom query parameter into jsondata

Signed-off-by: Douglas Camata <[email protected]>

---------

Signed-off-by: Douglas Camata <[email protected]>
  • Loading branch information
douglascamata authored and subbarao-meduri committed Oct 27, 2023
1 parent 1443931 commit b0593ad
Showing 1 changed file with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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),
},
},
{
Expand All @@ -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),
},
},
},
Expand Down

0 comments on commit b0593ad

Please sign in to comment.