mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 01:38:10 +00:00
pkg: propagate metric providers context
In custom-metrics-apiserver v1.22.0, contexts were added to the metric providers. We can benefit from that by propagating the context given to the provider down to the requests. Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
This commit is contained in:
parent
4264c97f7b
commit
8b85c68c9e
2 changed files with 5 additions and 5 deletions
|
|
@ -51,7 +51,7 @@ func (p *externalPrometheusProvider) GetExternalMetric(ctx context.Context, name
|
|||
return nil, provider.NewMetricNotFoundError(p.selectGroupResource(namespace), info.Metric)
|
||||
}
|
||||
// Here is where we're making the query, need to be before here xD
|
||||
queryResults, err := p.promClient.Query(context.TODO(), pmodel.Now(), selector)
|
||||
queryResults, err := p.promClient.Query(ctx, pmodel.Now(), selector)
|
||||
|
||||
if err != nil {
|
||||
klog.Errorf("unable to fetch metrics from prometheus: %v", err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue