mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-23 22:53:27 +00:00
Pass aggregation group identifier through context
This commit is contained in:
parent
d2a0a218aa
commit
03272174f2
@ -204,8 +204,9 @@ func (ag *aggrGroup) run(nf notifyFunc) {
|
||||
// finish before terminating them.
|
||||
ctx, _ := context.WithTimeout(ag.ctx, ag.opts.GroupInterval)
|
||||
|
||||
// Populate context with the destination name.
|
||||
// Populate context with the destination name and group identifier.
|
||||
ctx = context.WithValue(ctx, notify.NotifyName, ag.opts.SendTo)
|
||||
ctx = context.WithValue(ctx, notify.NotifyGroup, ag.String())
|
||||
|
||||
// Wait the configured interval before calling flush again.
|
||||
ag.next.Reset(ag.opts.GroupInterval)
|
||||
|
@ -20,6 +20,7 @@ const (
|
||||
NotifyName notifyKey = iota
|
||||
NotifyRepeatInterval
|
||||
NotifySendResolved
|
||||
NotifyGroup
|
||||
)
|
||||
|
||||
type Notifier interface {
|
||||
|
Loading…
Reference in New Issue
Block a user