-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #532 from securesign/tturek/SECURESIGN-1275
SECURESIGN-1275: Enable RecoverPanic on controllers
- Loading branch information
Showing
2 changed files
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package metrics | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"sigs.k8s.io/controller-runtime/pkg/metrics" | ||
) | ||
|
||
var ( | ||
// ReconcilePanics is a prometheus counter metrics which holds the total | ||
// number of panic from the Reconciler. | ||
ReconcilePanics = prometheus.NewCounter(prometheus.CounterOpts{ | ||
Name: "controller_runtime_reconcile_panics_total", | ||
Help: "Total number of reconciliation panics per controller", | ||
}) | ||
) | ||
|
||
// init will register metrics with the global prometheus registry | ||
func init() { | ||
metrics.Registry.MustRegister(ReconcilePanics) | ||
} |