Commit 314c607e authored by Geoff Simmons's avatar Geoff Simmons

Add the monitor_result counter.

parent 54e82059
......@@ -76,6 +76,13 @@ var (
Help: "Current number of known admin secrets",
})
monResultCtr = prometheus.NewCounterVec(prometheus.CounterOpts{
Namespace: namespace,
Subsystem: subsystem,
Name: "monitor_result_total",
Help: "Total number of monitor results",
}, []string{"service", "status", "result"})
addr2instMetrics map[string]*instanceMetrics = make(map[string]*instanceMetrics)
instMetricsMtx = &sync.Mutex{}
......@@ -92,6 +99,7 @@ func initMetrics() {
prometheus.Register(svcsGauge)
prometheus.Register(instsGauge)
prometheus.Register(secretsGauge)
prometheus.Register(monResultCtr)
}
func getInstanceMetrics(addr string) *instanceMetrics {
......
......@@ -55,6 +55,7 @@ func (vc *VarnishController) infoEvt(svc, reason, msgFmt string,
vc.log.Infof(msgFmt, args...)
vc.svcEvt.SvcInfoEvent(svc, reason, msgFmt, args...)
monResultCtr.WithLabelValues(svc, "info", reason).Inc()
}
func (vc *VarnishController) warnEvt(svc, reason, msgFmt string,
......@@ -62,6 +63,7 @@ func (vc *VarnishController) warnEvt(svc, reason, msgFmt string,
vc.log.Warnf(msgFmt, args...)
vc.svcEvt.SvcWarnEvent(svc, reason, msgFmt, args...)
monResultCtr.WithLabelValues(svc, "warning", reason).Inc()
}
func (vc *VarnishController) errorEvt(svc, reason, msgFmt string,
......@@ -69,6 +71,7 @@ func (vc *VarnishController) errorEvt(svc, reason, msgFmt string,
vc.log.Errorf(msgFmt, args...)
vc.svcEvt.SvcWarnEvent(svc, reason, msgFmt, args...)
monResultCtr.WithLabelValues(svc, "error", reason).Inc()
}
func (vc *VarnishController) checkInst(svc string, inst *varnishInst) bool {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment