Prometheus: mark queries with instant results as invalid for incremental querying (#66846)
mark queries with instant results as invalid for incremental querying
This commit is contained in:
@@ -235,7 +235,7 @@ export class QueryCache {
|
||||
const newTo = request.range.to.valueOf();
|
||||
|
||||
// only cache 'now'-relative queries (that can benefit from a backfill cache)
|
||||
const shouldCache = request.rangeRaw?.to?.toString() === 'now';
|
||||
const shouldCache = request.rangeRaw?.to?.toString() === 'now' && !request.targets.some((targ) => targ.instant);
|
||||
|
||||
// all targets are queried together, so we check for any that causes group cache invalidation & full re-query
|
||||
let doPartialQuery = shouldCache;
|
||||
|
||||
Reference in New Issue
Block a user