mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
remote client: apply custom headers before sigv4 transport
Signed-off-by: Craig Peterson <192540+captncraig@users.noreply.github.com>
This commit is contained in:
parent
501bc6419e
commit
5b5230deb7
|
@ -141,24 +141,24 @@ func NewWriteClient(name string, conf *ClientConfig) (WriteClient, error) {
|
||||||
}
|
}
|
||||||
t := httpClient.Transport
|
t := httpClient.Transport
|
||||||
|
|
||||||
|
if len(conf.Headers) > 0 {
|
||||||
|
t = newInjectHeadersRoundTripper(conf.Headers, t)
|
||||||
|
}
|
||||||
|
|
||||||
if conf.SigV4Config != nil {
|
if conf.SigV4Config != nil {
|
||||||
t, err = sigv4.NewSigV4RoundTripper(conf.SigV4Config, httpClient.Transport)
|
t, err = sigv4.NewSigV4RoundTripper(conf.SigV4Config, t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if conf.AzureADConfig != nil {
|
if conf.AzureADConfig != nil {
|
||||||
t, err = azuread.NewAzureADRoundTripper(conf.AzureADConfig, httpClient.Transport)
|
t, err = azuread.NewAzureADRoundTripper(conf.AzureADConfig, t)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(conf.Headers) > 0 {
|
|
||||||
t = newInjectHeadersRoundTripper(conf.Headers, t)
|
|
||||||
}
|
|
||||||
|
|
||||||
httpClient.Transport = otelhttp.NewTransport(t)
|
httpClient.Transport = otelhttp.NewTransport(t)
|
||||||
|
|
||||||
return &Client{
|
return &Client{
|
||||||
|
|
Loading…
Reference in a new issue