Skip to content

Commit

Permalink
Change datasource timeout config for Grafana and add matching timeout…
Browse files Browse the repository at this point in the history
… annotation for Route (#1304) (#1308)

Signed-off-by: Philip Gough <[email protected]>
  • Loading branch information
philipgough authored Jan 31, 2024
1 parent 93cd75a commit 98d4fcb
Showing 1 changed file with 9 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,10 @@ type GrafanaDatasource struct {
}

type JsonData struct {
TLSAuth bool `yaml:"tlsAuth,omitempty"`
TLSAuthCA bool `yaml:"tlsAuthWithCACert,omitempty"`
QueryTimeout string `yaml:"queryTimeout,omitempty"`
TLSAuth bool `yaml:"tlsAuth,omitempty"`
TLSAuthCA bool `yaml:"tlsAuthWithCACert,omitempty"`
// Timeout is the request timeout in seconds for an HTTP datasource.
Timeout string `yaml:"timeout,omitempty"`
HttpMethod string `yaml:"httpMethod,omitempty"`
TimeInterval string `yaml:"timeInterval,omitempty"`
CustomQueryParameters string `yaml:"customQueryParameters,omitempty"`
Expand Down Expand Up @@ -96,7 +97,7 @@ func GenerateGrafanaDataSource(
config.GetDefaultNamespace(),
),
JSONData: &JsonData{
QueryTimeout: "300s",
Timeout: "300",
CustomQueryParameters: "max_source_resolution=auto",
TimeInterval: fmt.Sprintf("%ds", mco.Spec.ObservabilityAddonSpec.Interval),
},
Expand All @@ -112,7 +113,7 @@ func GenerateGrafanaDataSource(
config.GetDefaultNamespace(),
),
JSONData: &JsonData{
QueryTimeout: "300s",
Timeout: "300",
CustomQueryParameters: "max_source_resolution=auto",
TimeInterval: fmt.Sprintf("%ds", DynamicTimeInterval),
},
Expand Down Expand Up @@ -192,6 +193,9 @@ func GenerateGrafanaRoute(
ObjectMeta: metav1.ObjectMeta{
Name: config.GrafanaRouteName,
Namespace: config.GetDefaultNamespace(),
Annotations: map[string]string{
"haproxy.router.openshift.io/timeout": "300s",
},
},
Spec: routev1.RouteSpec{
Port: &routev1.RoutePort{
Expand Down

0 comments on commit 98d4fcb

Please sign in to comment.