Reduce noisy no-alertmanager warning
This commit is contained in:
parent
52e5224f5a
commit
62075aa037
|
@ -155,7 +155,6 @@ func Main() int {
|
|||
prometheus.MustRegister(configSuccess)
|
||||
prometheus.MustRegister(configSuccessTime)
|
||||
|
||||
// go ruleManager.Run()
|
||||
defer ruleManager.Stop()
|
||||
|
||||
go notificationHandler.Run()
|
||||
|
|
|
@ -159,6 +159,11 @@ func (n *Handler) nextBatch() []*model.Alert {
|
|||
|
||||
// Run dispatches notifications continuously.
|
||||
func (n *Handler) Run() {
|
||||
// Just warn one in the beginning to prevent nosiy logs.
|
||||
if n.opts.AlertmanagerURL == "" {
|
||||
log.Warnf("No AlertManager configured, not dispatching any alerts")
|
||||
}
|
||||
|
||||
for {
|
||||
select {
|
||||
case <-n.ctx.Done():
|
||||
|
@ -172,7 +177,6 @@ func (n *Handler) Run() {
|
|||
continue
|
||||
}
|
||||
if n.opts.AlertmanagerURL == "" {
|
||||
log.Warn("No AlertManager configured, not dispatching %d alerts", len(alerts))
|
||||
n.dropped.Add(float64(len(alerts)))
|
||||
continue
|
||||
}
|
||||
|
|
|
@ -15,7 +15,6 @@ package rules
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
// "reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
|
Loading…
Reference in New Issue