Is your feature request related to a problem? Please describe.
With perf buffers, we can monitor for lost samples via https://github.com/cilium/ebpf/blob/e4d11b5080301912e47c99b84bb522681d600b62/perf/reader.go#L49.
Even then, there's no reporting from the eBPF program when writing to the buffer fails.
Describe the solution you'd like
Metrics for lost events should reflect both fails to write to the ring buffer/perf buffer as well as lost reports from userspace.
Additional context
It is difficult to tune the ring buffer size and sampling rate without knowing if any reports are being dropped.
Is your feature request related to a problem? Please describe.
With perf buffers, we can monitor for lost samples via https://github.com/cilium/ebpf/blob/e4d11b5080301912e47c99b84bb522681d600b62/perf/reader.go#L49.
Even then, there's no reporting from the eBPF program when writing to the buffer fails.
Describe the solution you'd like
Metrics for lost events should reflect both fails to write to the ring buffer/perf buffer as well as lost reports from userspace.
Additional context
It is difficult to tune the ring buffer size and sampling rate without knowing if any reports are being dropped.