diff --git a/rules/manager.go b/rules/manager.go index 8aa33d775b..31ed2683e2 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -287,6 +287,11 @@ func (g *Group) run(ctx context.Context) { return } + ctx = promql.NewOriginContext(ctx, map[string]string{ + "groupFile": g.File(), + "groupName": g.Name(), + }) + iter := func() { g.metrics.iterationsScheduled.Inc() @@ -612,7 +617,6 @@ func (g *Group) Eval(ctx context.Context, ts time.Time) { g.staleSeries = nil } } - } // RestoreForState restores the 'for' state of the alerts