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 <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto 2020-01-10 09:28:17 +01:00 committed by Brian Brazil
parent 3885562587
commit 0011bba19b

View file

@ -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