1
0
mirror of https://github.com/rancher/norman.git synced 2025-09-01 23:36:58 +00:00

Merge pull request #202 from ukinau/Add-Generic-Controller-Related-Metrics

Add Generic Controller Related Metrics
This commit is contained in:
Darren Shepherd
2018-10-09 19:31:52 -07:00
committed by GitHub
117 changed files with 24549 additions and 3194 deletions

View File

@@ -9,6 +9,7 @@ import (
"time"
errors2 "github.com/pkg/errors"
"github.com/rancher/norman/metrics"
"github.com/rancher/norman/objectclient"
"github.com/rancher/norman/types"
"github.com/sirupsen/logrus"
@@ -261,7 +262,11 @@ func (g *genericController) syncHandler(s string) (err error) {
var errs []error
for _, handler := range g.handlers {
logrus.Debugf("%s calling handler %s %s", g.name, handler.name, s)
metrics.IncTotalHandlerExecution(g.name, handler.name)
if err := handler.handler(s); err != nil {
if !ignoreError(err, false) {
metrics.IncTotalHandlerFailure(g.name, handler.name, s)
}
errs = append(errs, &handlerError{
name: handler.name,
err: err,