diff --git a/npc/metrics/metrics.go b/npc/metrics/metrics.go index 5c6149b8..cad65531 100644 --- a/npc/metrics/metrics.go +++ b/npc/metrics/metrics.go @@ -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())