mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-12 16:44:05 -08:00
Backfill: Do not query after --end (#9340)
Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
7ff76ed1ab
commit
bd217c58a7
|
@ -105,11 +105,15 @@ func (importer *ruleImporter) importRule(ctx context.Context, ruleExpr, ruleName
|
||||||
for startWithAlignment.Unix() < currStart {
|
for startWithAlignment.Unix() < currStart {
|
||||||
startWithAlignment = startWithAlignment.Add(grp.Interval())
|
startWithAlignment = startWithAlignment.Add(grp.Interval())
|
||||||
}
|
}
|
||||||
|
end := time.Unix(min(endOfBlock/int64(time.Second/time.Millisecond), end.Unix()), 0).UTC()
|
||||||
|
if end.Before(startWithAlignment) {
|
||||||
|
break
|
||||||
|
}
|
||||||
val, warnings, err := importer.apiClient.QueryRange(ctx,
|
val, warnings, err := importer.apiClient.QueryRange(ctx,
|
||||||
ruleExpr,
|
ruleExpr,
|
||||||
v1.Range{
|
v1.Range{
|
||||||
Start: startWithAlignment,
|
Start: startWithAlignment,
|
||||||
End: time.Unix(min(endOfBlock/int64(time.Second/time.Millisecond), end.Unix()), 0).UTC(),
|
End: end,
|
||||||
Step: grp.Interval(),
|
Step: grp.Interval(),
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue