mirror of
https://github.com/prometheus/prometheus
synced 2025-03-31 07:49:19 +00:00
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(configSuccess)
|
||||||
prometheus.MustRegister(configSuccessTime)
|
prometheus.MustRegister(configSuccessTime)
|
||||||
|
|
||||||
// go ruleManager.Run()
|
|
||||||
defer ruleManager.Stop()
|
defer ruleManager.Stop()
|
||||||
|
|
||||||
go notificationHandler.Run()
|
go notificationHandler.Run()
|
||||||
|
@ -159,6 +159,11 @@ func (n *Handler) nextBatch() []*model.Alert {
|
|||||||
|
|
||||||
// Run dispatches notifications continuously.
|
// Run dispatches notifications continuously.
|
||||||
func (n *Handler) Run() {
|
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 {
|
for {
|
||||||
select {
|
select {
|
||||||
case <-n.ctx.Done():
|
case <-n.ctx.Done():
|
||||||
@ -172,7 +177,6 @@ func (n *Handler) Run() {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if n.opts.AlertmanagerURL == "" {
|
if n.opts.AlertmanagerURL == "" {
|
||||||
log.Warn("No AlertManager configured, not dispatching %d alerts", len(alerts))
|
|
||||||
n.dropped.Add(float64(len(alerts)))
|
n.dropped.Add(float64(len(alerts)))
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,6 @@ package rules
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
// "reflect"
|
|
||||||
"strings"
|
"strings"
|
||||||
"testing"
|
"testing"
|
||||||
"time"
|
"time"
|
||||||
|
Loading…
Reference in New Issue
Block a user