add flag to disable event metrics#4926
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
68ba7ab to
faa361e
Compare
|
Hey @kkourt ! sure! that's already done. Thanks for the suggestion |
mtardy
left a comment
There was a problem hiding this comment.
Overall looks good thanks, just a few comments.
Also I know the patch is quite simple but the first one could have been also sliced into two, your commit description is a hint for this, your commit does two things:
Add --enable-event-metrics flag (default: true) to allow disabling
event metrics while keeping health and resource metrics available.
Split InitAllMetrics into InitHealthMetrics and InitEventsMetrics.
Health metrics and resource metrics are always initialized when
--metrics-server is set.
I would have split first, and then added the flag in two separate commits.
| metricsconfig.InitHealthMetrics(metricsconfig.GetRegistry()) | ||
| metricsconfig.InitEventsMetrics(metricsconfig.GetRegistry()) |
There was a problem hiding this comment.
question: we don't want to respect the flag from testing?
There was a problem hiding this comment.
This was intentional as this file contains only tests helper functions, and maybe any test could use the event metrics too
Please let me know if my assumption is wrong and if we should respect the flag here too
| By default, Tetragon exposes both health and events metrics. You can disable events metrics while keeping | ||
| health metrics by adding `--enable-event-metrics=false`. |
There was a problem hiding this comment.
nit: wrapping is a bit wrong here (like in the rest of that doc btw)
| By default, Tetragon exposes both health and events metrics. You can disable events metrics while keeping | |
| health metrics by adding `--enable-event-metrics=false`. | |
| By default, Tetragon exposes both health and events metrics. You can disable | |
| events metrics while keeping health metrics by adding `--enable-event-metrics=false`. |
| 1. Monitoring the health of Tetragon itself | ||
| 2. Monitoring the activity of processes observed by Tetragon |
There was a problem hiding this comment.
I feel like you could add a note there just after 1. and 2. instead of later in the ## Enable/Disable Metrics and ### Non-Kubernetes section.
faa361e to
b7c3966
Compare
|
Thanks @mtardy for the suggestions. I updated the PR |
I believe what Mahè meant here is to:
In the current split, the flag is introduced in the first patch, and then used in the second patch, which I find more confusing that having both changes in a single patch (as originally). |
b7c3966 to
db0bfe1
Compare
Split InitAllMetrics in two functions, InitHealthMetrics and InitEventsMetrics. Signed-off-by: Daniel Gomez <dangome3@cisco.com>
Add --enable-event-metrics flag (default: true) to allow disabling event metrics while keeping health and resource metrics available. Signed-off-by: Daniel Gomez <dangome3@cisco.com>
Unit tests for metrics config added in 'pkg/metrics/metricwithpod_test.go' Covered tests for health only metrics and halth+event metrics enabled. Signed-off-by: Daniel Gomez <dangome3@cisco.com>
Signed-off-by: Daniel Gomez <dangome3@cisco.com>
db0bfe1 to
4a8498b
Compare
That's 💯 right, sorry for the confusion. That should be fixed now |
Description
Add --enable-event-metrics flag (default: true) to allow disabling event metrics while keeping health and resource metrics available.
Split InitAllMetrics into InitHealthMetrics and InitEventsMetrics. Health metrics and resource metrics are always initialized when --metrics-server is set.
Unit tests for metrics config added in 'pkg/metrics/metricwithpod_test.go' also manually tested in a no-k8s environment.
Changelog