From c857fb0d49f50475972644bf7d06afd080218703 Mon Sep 17 00:00:00 2001 From: Marcus Efraimsson Date: Mon, 27 Sep 2021 16:25:55 +0200 Subject: [PATCH] Elasticsearch/Prometheus: Set correct service namespace for SigV4 (#39439) (#39664) Makes sure to set the SigV4 service namespace for Elasticsearch and Prometheus. Fixes #38440 (cherry picked from commit 45a844e77ee667265a8f27bfa683d8ea8196336d) --- pkg/tsdb/elasticsearch/elasticsearch.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pkg/tsdb/elasticsearch/elasticsearch.go b/pkg/tsdb/elasticsearch/elasticsearch.go index 8f74c47a4a5..70683ab3aea 100644 --- a/pkg/tsdb/elasticsearch/elasticsearch.go +++ b/pkg/tsdb/elasticsearch/elasticsearch.go @@ -88,6 +88,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 {