prometheus: Implement mgmt_checkapply_total metric

Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
Julien Pivotto
2017-02-12 21:24:58 +01:00
parent bdb8368e89
commit e8855f7621
6 changed files with 113 additions and 22 deletions

View File

@@ -224,6 +224,12 @@ func (g *Graph) Process(v *Vertex) error {
// if this fails, don't UpdateTimestamp()
checkOK, err = obj.CheckApply(!noop)
if obj.Prometheus() != nil {
if promErr := obj.Prometheus().UpdateCheckApplyTotal(obj.Kind(), !noop, !checkOK, err != nil); promErr != nil {
// TODO: how to error correctly
log.Printf("%s[%s]: Prometheus.UpdateCheckApplyTotal() errored: %v", v.Kind(), v.GetName(), err)
}
}
// TODO: Can the `Poll` converged timeout tracking be a
// more general method for all converged timeouts? this
// would simplify the resources by removing boilerplate