introduce weavenpc_policy_enforcement_errors prometheus metric

to track number of errors occured during enforcing network policies

Fixes #3791
This commit is contained in:
Murali Reddy authored and Bryan Boreham committed 2020-05-22 09:54:11 +00:00
1 parent 2f235daa1c
commit 77fbb2c12b
1 file changed
+9
+9
View File
@@ -22,6 +22,12 @@ var (
},
[]string{"protocol", "dport"},
)
PolicyEnforcementErrors = prometheus.NewCounter(
prometheus.CounterOpts{
Name: "weavenpc_policy_enforcement_errors",
Help: "Errors occured in enforcing the network policies.",
},
)
)
func gatherMetrics() {
@@ -95,6 +101,9 @@ func Start(addr string) error {
if err := prometheus.Register(blockedConnections); err != nil {
return err
}
if err := prometheus.Register(PolicyEnforcementErrors); err != nil {
return err
}
http.Handle("/metrics", promhttp.Handler())