Skip to content

Commit

Permalink
enforcer: add docs for missed notifications metric
Browse files Browse the repository at this point in the history
Signed-off-by: Kornilios Kourtis <[email protected]>
  • Loading branch information
kkourt committed Oct 16, 2024
1 parent 976faaf commit 48e51a7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
10 changes: 10 additions & 0 deletions docs/content/en/docs/reference/metrics.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions pkg/metrics/enforcermetrics/enforcermetrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ func (st *state) newCollector() metrics.CollectorWithInit {
st.missedNotifications,
},
st.collect,
collectForDocs,
st.collectForDocs,
)
}

Expand Down Expand Up @@ -141,5 +141,6 @@ func (st *state) unregisterPolicy(policy string) {
delete(st.policies, policy)
}

func collectForDocs(_ chan<- prometheus.Metric) {
func (st *state) collectForDocs(ch chan<- prometheus.Metric) {
ch <- st.missedNotifications.MustMetric(0, "reason", "policy-name", "syscall")
}

0 comments on commit 48e51a7

Please sign in to comment.