mirror of
https://github.com/prometheus/prometheus.git
synced 2025-08-07 06:37:17 +02:00
Make sure we never call trackStaleness with nil cache entry
Signed-off-by: Lukasz Mierzwa <l.mierzwa@gmail.com>
This commit is contained in:
parent
6687bf5653
commit
bb690a23b9
@ -1820,8 +1820,9 @@ loop:
|
|||||||
// it in the scrape cache because we don't need to emit StaleNaNs for it when it disappears.
|
// it in the scrape cache because we don't need to emit StaleNaNs for it when it disappears.
|
||||||
if !seriesCached && sampleAdded {
|
if !seriesCached && sampleAdded {
|
||||||
ce = sl.cache.addRef(met, ref, lset, hash)
|
ce = sl.cache.addRef(met, ref, lset, hash)
|
||||||
if parsedTimestamp == nil || sl.trackTimestampsStaleness {
|
if ce != nil && (parsedTimestamp == nil || sl.trackTimestampsStaleness) {
|
||||||
// Bypass staleness logic if there is an explicit timestamp.
|
// Bypass staleness logic if there is an explicit timestamp.
|
||||||
|
// But make sure we only do this if we have a cache entry (ce) for our series.
|
||||||
sl.cache.trackStaleness(hash, ce)
|
sl.cache.trackStaleness(hash, ce)
|
||||||
}
|
}
|
||||||
if sampleAdded && sampleLimitErr == nil && bucketLimitErr == nil {
|
if sampleAdded && sampleLimitErr == nil && bucketLimitErr == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user