Skip to content

Commit

Permalink
Elasticsearch: Fix failing requests when using SigV4 (#61923)
Browse files Browse the repository at this point in the history
fix setting of `es` servicename

(cherry picked from commit c561045)
  • Loading branch information
svennergr authored and grafanabot committed Jan 23, 2023
1 parent 85c62f0 commit 2690e52
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/tsdb/elasticsearch/elasticsearch.go
Expand Up @@ -73,16 +73,16 @@ func newInstanceSettings(httpClientProvider httpclient.Provider) datasource.Inst
return nil, fmt.Errorf("error getting http options: %w", err)
}

httpCli, err := httpClientProvider.New(httpCliOpts)
if err != nil {
return nil, err
}

// Set SigV4 service namespace
if httpCliOpts.SigV4 != nil {
httpCliOpts.SigV4.Service = "es"
}

httpCli, err := httpClientProvider.New(httpCliOpts)
if err != nil {
return nil, err
}

version, err := coerceVersion(jsonData["esVersion"])
if err != nil {
return nil, fmt.Errorf("elasticsearch version is required, err=%v", err)
Expand Down

0 comments on commit 2690e52

Please sign in to comment.