From 0011bba19b1fe5f933b2827c455f846cd2efd626 Mon Sep 17 00:00:00 2001 From: Julien Pivotto Date: Fri, 10 Jan 2020 09:28:17 +0100 Subject: [PATCH] Query Log: add origin of the rules (#6592) * Query Log: add origin of the rules We don't set rule name and rule kind because the added value would be quite low, given we have now the file, the group and the query. Signed-off-by: Julien Pivotto --- rules/manager.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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