diff --git a/rules/manager.go b/rules/manager.go index 9e1661117..afc3afdb7 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -500,6 +500,7 @@ func nameAndLabels(rule Rule) string { // first is matched with the first, second with the second etc. func (g *Group) CopyState(from *Group) { g.evaluationDuration = from.evaluationDuration + g.evaluationTimestamp = from.evaluationTimestamp ruleMap := make(map[string][]int, len(from.rules)) diff --git a/rules/manager_test.go b/rules/manager_test.go index 419b42834..e9deb70ad 100644 --- a/rules/manager_test.go +++ b/rules/manager_test.go @@ -657,6 +657,7 @@ func TestCopyState(t *testing.T) { testutil.Equals(t, want, newGroup.seriesInPreviousEval) testutil.Equals(t, oldGroup.rules[0], newGroup.rules[3]) testutil.Equals(t, oldGroup.evaluationDuration, newGroup.evaluationDuration) + testutil.Equals(t, oldGroup.evaluationTimestamp, newGroup.evaluationTimestamp) testutil.Equals(t, []labels.Labels{{{Name: "l1", Value: "v3"}}}, newGroup.staleSeries) }