mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-26 13:11:11 -08:00
Rules: simplify map key for stale series detection
The rules manager keeps a note of which series were generated by the last run, so it can write a stale marker to those that disappeared. Since the keys are not for human eyes, we can use a simpler format and save the effort of quoting label values. Signed-off-by: Bryan Boreham <bjboreham@gmail.com>
This commit is contained in:
parent
628211c25a
commit
26d8ae0e41
|
@ -652,7 +652,8 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) {
|
||||||
level.Warn(g.logger).Log("msg", "Rule evaluation result discarded", "err", err, "sample", s)
|
level.Warn(g.logger).Log("msg", "Rule evaluation result discarded", "err", err, "sample", s)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
seriesReturned[s.Metric.String()] = s.Metric
|
buf := [1024]byte{}
|
||||||
|
seriesReturned[string(s.Metric.Bytes(buf[:]))] = s.Metric
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if numOutOfOrder > 0 {
|
if numOutOfOrder > 0 {
|
||||||
|
@ -672,7 +673,7 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) {
|
||||||
// Do not count these in logging, as this is expected if series
|
// Do not count these in logging, as this is expected if series
|
||||||
// is exposed from a different rule.
|
// is exposed from a different rule.
|
||||||
default:
|
default:
|
||||||
level.Warn(g.logger).Log("msg", "Adding stale sample failed", "sample", metric, "err", err)
|
level.Warn(g.logger).Log("msg", "Adding stale sample failed", "sample", lset.String(), "err", err)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue