prometheus/rules
James Ravn e15d8c5802 reload: copy state on both name and labels (#5368)
* reload: copy state on both name and labels

Fix https://github.com/prometheus/prometheus/issues/5193

Using just name causes the linked issue - if new rules are inserted with
the same name (but different labels), the reordering will cause stale
markers to be inserted in the next eval for all shifted rules, despite
them not being stale.

Ideally we want to avoid stale markers for time series that still exist
in the new rules, with name and labels being the unique identifer.

This change adds labels to the internal map when copying the old rule
data to the new rule data. This prevents the problem of staling rules
that simply shifted order.

If labels change, it is a new time series and the old series will stale
regardless. So it should be safe to always match on name and labels when
copying state.

Signed-off-by: James Ravn <james@r-vn.org>
2019-03-15 15:23:36 +00:00
..
fixtures Make TestUpdate() do some work (#4306) 2018-06-22 15:21:04 +01:00
alerting.go *: use latest release of staticcheck (#5057) 2019-01-04 14:47:38 +01:00
alerting_test.go *: apply gofmt -s 2019-01-16 17:28:14 -05:00
manager.go reload: copy state on both name and labels (#5368) 2019-03-15 15:23:36 +00:00
manager_test.go reload: copy state on both name and labels (#5368) 2019-03-15 15:23:36 +00:00
recording.go Fix spelling/typos (#4921) 2018-11-27 17:44:29 +01:00
recording_test.go WIP: keep track of samples per query, set a max # of samples (#4513) 2018-10-02 12:59:19 +01:00