mirror of
https://github.com/kubernetes-sigs/prometheus-adapter.git
synced 2026-04-06 17:57:51 +00:00
add endTime variable for promeClient.Series api
Signed-off-by: 屈骏 <qujun@tiduyun.com>
This commit is contained in:
parent
6e05ab938e
commit
5e169f5b0d
3 changed files with 6 additions and 3 deletions
|
|
@ -84,6 +84,7 @@ func (l *basicMetricLister) ListAllMetrics() (MetricUpdateResult, error) {
|
|||
}
|
||||
|
||||
startTime := pmodel.Now().Add(-1 * l.lookback)
|
||||
endTime := pmodel.Now().Add(1 * l.lookback)
|
||||
|
||||
// these can take a while on large clusters, so launch in parallel
|
||||
// and don't duplicate
|
||||
|
|
@ -99,7 +100,7 @@ func (l *basicMetricLister) ListAllMetrics() (MetricUpdateResult, error) {
|
|||
}
|
||||
selectors[sel] = struct{}{}
|
||||
go func() {
|
||||
series, err := l.promClient.Series(context.TODO(), pmodel.Interval{startTime, 0}, sel)
|
||||
series, err := l.promClient.Series(context.TODO(), pmodel.Interval{startTime, endTime}, sel)
|
||||
if err != nil {
|
||||
errs <- fmt.Errorf("unable to fetch metrics for query %q: %v", sel, err)
|
||||
return
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue