Skip to content

Commit

Permalink
Set max source resolution to auto in Grafana datasource
Browse files Browse the repository at this point in the history
Signed-off-by: Douglas Camata <[email protected]>
  • Loading branch information
douglascamata committed Oct 19, 2023
1 parent bc2dc3d commit f3c427f
Showing 1 changed file with 16 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@ type GrafanaDatasources struct {
}

type GrafanaDatasource struct {
Access string `yaml:"access,omitempty"`
BasicAuth bool `yaml:"basicAuth,omitempty"`
BasicAuthPassword string `yaml:"basicAuthPassword,omitempty"`
BasicAuthUser string `yaml:"basicAuthUser,omitempty"`
Editable bool `yaml:"editable,omitempty"`
IsDefault bool `yaml:"isDefault,omitempty"`
Name string `yaml:"name,omitempty"`
OrgID int `yaml:"orgId,omitempty"`
Type string `yaml:"type,omitempty"`
URL string `yaml:"url,omitempty"`
Version int `yaml:"version,omitempty"`
JSONData *JsonData `yaml:"jsonData,omitempty"`
SecureJSONData *SecureJsonData `yaml:"secureJsonData,omitempty"`
Access string `yaml:"access,omitempty"`
BasicAuth bool `yaml:"basicAuth,omitempty"`
BasicAuthPassword string `yaml:"basicAuthPassword,omitempty"`
BasicAuthUser string `yaml:"basicAuthUser,omitempty"`
Editable bool `yaml:"editable,omitempty"`
IsDefault bool `yaml:"isDefault,omitempty"`
Name string `yaml:"name,omitempty"`
OrgID int `yaml:"orgId,omitempty"`
Type string `yaml:"type,omitempty"`
URL string `yaml:"url,omitempty"`
CustomQueryParameters string `yaml:"customQueryParameters,omitempty"`
Version int `yaml:"version,omitempty"`
JSONData *JsonData `yaml:"jsonData,omitempty"`
SecureJSONData *SecureJsonData `yaml:"secureJsonData,omitempty"`
}

type JsonData struct {
Expand Down Expand Up @@ -94,6 +95,7 @@ func GenerateGrafanaDataSource(
config.ProxyServiceName,
config.GetDefaultNamespace(),
),
CustomQueryParameters: "max_source_resolution=auto",
JSONData: &JsonData{
QueryTimeout: "300s",
TimeInterval: fmt.Sprintf("%ds", mco.Spec.ObservabilityAddonSpec.Interval),
Expand All @@ -109,6 +111,7 @@ func GenerateGrafanaDataSource(
config.ProxyServiceName,
config.GetDefaultNamespace(),
),
CustomQueryParameters: "max_source_resolution=auto",
JSONData: &JsonData{
QueryTimeout: "300s",
TimeInterval: fmt.Sprintf("%ds", DynamicTimeInterval),
Expand Down

0 comments on commit f3c427f

Please sign in to comment.