Elasticsearch/Prometheus: Set correct service namespace for SigV4 (#39439)

Makes sure to set the SigV4 service namespace for Elasticsearch and Prometheus.

Fixes #38440
pull/39653/head
Marcus Efraimsson 4 years ago committed by GitHub
parent bbf64722e4
commit 45a844e77e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 5
      pkg/tsdb/elasticsearch/elasticsearch.go
  2. 5
      pkg/tsdb/prometheus/prometheus.go

@ -84,6 +84,11 @@ func newInstanceSettings() datasource.InstanceFactoryFunc {
return nil, fmt.Errorf("error getting http options: %w", err)
}
// Set SigV4 service namespace
if httpCliOpts.SigV4 != nil {
httpCliOpts.SigV4.Service = "es"
}
version, err := coerceVersion(jsonData["esVersion"])
if err != nil {

@ -94,6 +94,11 @@ func newInstanceSettings() datasource.InstanceFactoryFunc {
return nil, fmt.Errorf("error getting http options: %w", err)
}
// Set SigV4 service namespace
if httpCliOpts.SigV4 != nil {
httpCliOpts.SigV4.Service = "aps"
}
httpMethod, ok := jsonData["httpMethod"].(string)
if !ok {
httpMethod = defaultHttpMethod

Loading…
Cancel
Save