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:
Galen Kistler 2023-04-19 08:24:09 -05:00 committed by GitHub
parent 5dac0c9871
commit a90289a193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;