mirror of
https://github.com/prometheus/alertmanager
synced 2024-12-24 15:12:37 +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.
|
// finish before terminating them.
|
||||||
ctx, _ := context.WithTimeout(ag.ctx, ag.opts.GroupInterval)
|
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.NotifyName, ag.opts.SendTo)
|
||||||
|
ctx = context.WithValue(ctx, notify.NotifyGroup, ag.String())
|
||||||
|
|
||||||
// Wait the configured interval before calling flush again.
|
// Wait the configured interval before calling flush again.
|
||||||
ag.next.Reset(ag.opts.GroupInterval)
|
ag.next.Reset(ag.opts.GroupInterval)
|
||||||
|
@ -20,6 +20,7 @@ const (
|
|||||||
NotifyName notifyKey = iota
|
NotifyName notifyKey = iota
|
||||||
NotifyRepeatInterval
|
NotifyRepeatInterval
|
||||||
NotifySendResolved
|
NotifySendResolved
|
||||||
|
NotifyGroup
|
||||||
)
|
)
|
||||||
|
|
||||||
type Notifier interface {
|
type Notifier interface {
|
||||||
|
Loading…
Reference in New Issue
Block a user