-
Notifications
You must be signed in to change notification settings - Fork 242
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add metric for tracking failure to start the controller-runtime manag…
…er (#1860) Signed-off-by: Evan Baker <[email protected]>
- Loading branch information
Showing
2 changed files
with
25 additions
and
1 deletion.
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,23 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/prometheus/client_golang/prometheus" | ||
"sigs.k8s.io/controller-runtime/pkg/metrics" | ||
) | ||
|
||
// managerStartFailures is a monotic counter which tracks the number of times the controller-runtime | ||
// manager failed to start. To drive alerting based on this metric, it is recommended to use the rate | ||
// of increase over a period of time. A positive rate of change indicates that the CNS is actively | ||
// failing and retrying. | ||
var managerStartFailures = prometheus.NewCounter( | ||
prometheus.CounterOpts{ | ||
Name: "manager_start_failures_total", | ||
Help: "Number of times the controller-runtime manager failed to start.", | ||
}, | ||
) | ||
|
||
func init() { | ||
metrics.Registry.MustRegister( | ||
managerStartFailures, | ||
) | ||
} |