add metrics to controller-manager
Signed-off-by: LiHui <andrewli@yunify.com>
This commit is contained in:
@@ -98,6 +98,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
|
||||
if err := r.Update(rootCtx, workspace); err != nil {
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
workspaceOperation.WithLabelValues("create", instance.Name).Inc()
|
||||
}
|
||||
} else {
|
||||
// The object is being deleted
|
||||
@@ -111,6 +112,7 @@ func (r *Reconciler) Reconcile(req ctrl.Request) (ctrl.Result, error) {
|
||||
logger.Error(err, "update workspace failed")
|
||||
return ctrl.Result{}, err
|
||||
}
|
||||
workspaceOperation.WithLabelValues("delete", instance.Name).Inc()
|
||||
}
|
||||
// Our finalizer has finished, so the reconciler can do nothing.
|
||||
return ctrl.Result{}, nil
|
||||
|
||||
Reference in New Issue
Block a user