Prometheus: Use contextual middleware for req headers and simplify client creation (#51061)

* Use contextual middleware and simplify client creation

* Fix tests

* Add test for the header propagation

* Fix tests and lint

* Update pkg/tsdb/prometheus/prometheus.go

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>

Co-authored-by: ismail simsek <ismailsimsek09@gmail.com>
This commit is contained in:
Andrej Ocenas
2022-06-23 14:48:16 +02:00
committed by GitHub
co-authored by ismail simsek
parent a8eb29f1d7
commit d20afa2a39
17 changed files with 394 additions and 697 deletions
+2 -1
View File
@@ -136,8 +136,9 @@ func runQuery(response []byte, query PrometheusQuery) (*backend.QueryDataRespons
tracer: tracer,
TimeInterval: "15s",
log: &fakeLogger{},
client: api,
}
return s.runQueries(context.Background(), api, []*PrometheusQuery{&query})
return s.runQueries(context.Background(), []*PrometheusQuery{&query})
}
type fakeLogger struct {