silence: Don't add silence action to resolved alerts
This commit is contained in:
parent
0a3ead8b6e
commit
1b986078f0
1 changed files with 2 additions and 2 deletions
4
main.go
4
main.go
|
@ -110,7 +110,7 @@ func (rcv *receiver) singleAlertNotifications(p *payload) []*notification {
|
||||||
|
|
||||||
n.tags = strings.Join(tags, ",")
|
n.tags = strings.Join(tags, ",")
|
||||||
|
|
||||||
if rcv.cfg.am.SilenceDuration != 0 {
|
if rcv.cfg.am.SilenceDuration != 0 && alert.Status == "firing" {
|
||||||
if rcv.cfg.BaseURL == "" {
|
if rcv.cfg.BaseURL == "" {
|
||||||
rcv.logger.Error("Failed to create silence action: No base-url set")
|
rcv.logger.Error("Failed to create silence action: No base-url set")
|
||||||
}
|
}
|
||||||
|
@ -199,7 +199,7 @@ func (rcv *receiver) multiAlertNotification(p *payload) *notification {
|
||||||
n.priority = priority
|
n.priority = priority
|
||||||
n.tags = tagString
|
n.tags = tagString
|
||||||
|
|
||||||
if rcv.cfg.am.SilenceDuration != 0 {
|
if rcv.cfg.am.SilenceDuration != 0 && p.Status == "firing" {
|
||||||
if rcv.cfg.BaseURL == "" {
|
if rcv.cfg.BaseURL == "" {
|
||||||
rcv.logger.Error("Failed to create silence action: No base-url set")
|
rcv.logger.Error("Failed to create silence action: No base-url set")
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue