mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 10:24:54 -06:00
Datasource: Make sure data proxy timeout applies to HTTP client (#25865)
For backend data sources executing in the backend (not through data proxy) make sure that the timeout applies to cached HTTP client. Fixes #25863 Co-authored-by: Diana Payton <52059945+oddlittlebird@users.noreply.github.com>
This commit is contained in:
parent
383aa21ab6
commit
460b01f1fe
@ -126,7 +126,8 @@ connstr =
|
|||||||
# This enables data proxy logging, default is false
|
# This enables data proxy logging, default is false
|
||||||
logging = false
|
logging = false
|
||||||
|
|
||||||
# How long the data proxy should wait before timing out default is 30 (seconds)
|
# How long the data proxy waits before timing out, default is 30 seconds.
|
||||||
|
# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
|
||||||
timeout = 30
|
timeout = 30
|
||||||
|
|
||||||
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
|
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
|
||||||
|
@ -127,7 +127,8 @@
|
|||||||
# This enables data proxy logging, default is false
|
# This enables data proxy logging, default is false
|
||||||
;logging = false
|
;logging = false
|
||||||
|
|
||||||
# How long the data proxy should wait before timing out default is 30 (seconds)
|
# How long the data proxy waits before timing out, default is 30 seconds.
|
||||||
|
# This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
|
||||||
;timeout = 30
|
;timeout = 30
|
||||||
|
|
||||||
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
|
# If enabled and user is not anonymous, data proxy will add X-Grafana-User header with username into the request, default is false.
|
||||||
|
@ -383,7 +383,9 @@ This enables data proxy logging, default is `false`.
|
|||||||
|
|
||||||
### timeout
|
### timeout
|
||||||
|
|
||||||
How long the data proxy should wait before timing out. Default is `30` (seconds)
|
How long the data proxy should wait before timing out. Default is 30 seconds.
|
||||||
|
|
||||||
|
This setting also applies to core backend HTTP data sources where query requests use an HTTP client with timeout set.
|
||||||
|
|
||||||
### send_user_header
|
### send_user_header
|
||||||
|
|
||||||
|
@ -51,7 +51,7 @@ func (ds *DataSource) GetHttpClient() (*http.Client, error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return &http.Client{
|
return &http.Client{
|
||||||
Timeout: 30 * time.Second,
|
Timeout: time.Duration(setting.DataProxyTimeout) * time.Second,
|
||||||
Transport: transport,
|
Transport: transport,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user