-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose kernel ringbuffer errors in metrics #2839
Conversation
✅ Deploy Preview for tetragon ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
There are two metrics counting events lost in the ringbuffer: * tetragon_missed_events_total, collected in BPF based on perf_event_output error * tetragon_ringbuf_perf_event_lost_total, collected in observer based on Record.LostSamples from cilium/ebpf When testing, I saw the former being higher than the latter. This might mean there are failed writes to the ringbuffer that are not lost events seen by Record.LostSamples. To investigate such issues, I'm adding error label to tetragon_missed_events_total, representing kernel error returned by perf_event_output. According to @olsajiri EBUSY and ENOSPC would be the only we could really hit, the rest is most likely due config error. So let's start with counting these two, and aggregating other errors as "unknown". We can always split out more errors in the future if needed. Signed-off-by: Anna Kapuscinska <[email protected]>
607c0bd
to
c270528
Compare
There are a few places where events be "missed", so let's make it clear in the metric name that's it's counting kernel misses. Signed-off-by: Anna Kapuscinska <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
#define SENT_FAILED_UNKNOWN 0 // unknown error | ||
#define SENT_FAILED_EBUSY 1 // EBUSY | ||
#define SENT_FAILED_ENOSPC 2 // ENOSPC | ||
#define SENT_FAILED_MAX 3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit, extra tab screwing the diff in terminal
struct kernel_stats { | ||
__u64 sent_failed[256]; | ||
__u64 sent_failed[256][SENT_FAILED_MAX]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a note.. I think it's ok because it's still small map, but it is per cpu and this change multiplies the memory usage by 3
adding @tpapagian because I think he added those metrics originally |
There are two metrics counting events lost in the ringbuffer:
error
Record.LostSamples from cilium/ebpf
When testing, I saw the former being higher than the latter. This might mean
there are failed writes to the ringbuffer that are not lost events seen by
Record.LostSamples. To investigate such issues, I'm adding error label to
tetragon_missed_events_total, representing kernel error returned by
perf_event_output.
According to @olsajiri EBUSY and ENOSPC would be the only we could really hit,
the rest is most likely due config error. So let's start with counting these
two, and aggregating other errors as "unknown". We can always split out more
errors in the future if needed.