cloudflare / cloudflare/ebpf_exporter
Per-cpu for histogram metrics
- Dominant language
- Go
- Stars
- 2.6k
- Forks
- 282
- Avg merge
- 5d 7h
- Merged PRs (30d)
- 8
Description
@bobrik, hi!
I'm trying to monitor per-CPU latency histograms for NET_RX softirqs using a configuration inspired by the percpu-softirq example. The idea is to observe histogram distributions (e.g., softirq_wait_seconds and softirq_runtime_seconds) on a per-CPU basis in environments where different CPUs handle traffic from different network interfaces.
I used the following config snippet:
```
metrics:
histograms:
- name: softirq_wait_seconds
help: Latency histogram for how long it takes from NET_RX softirq raise to entry aka wait time
bucket_type: exp2
bucket_min: 0
bucket_max: 31
bucket_multiplier: 0.000000001 # nano to seconds
labels:
- name: bucket
size: 4
decoders:
- name: uint
- name: cpu
size: 2
decoders:
- name: uint
```
However, the output only contains the bucket label, and not cpu, like this:
```
ebpf_exporter_softirq_runtime_seconds_bucket{bucket="6",le="0.536870912"} 0
ebpf_exporter_softirq_runtime_seconds_bucket{bucket="6",le="1.073741824"} 0
ebpf_exporter_softirq_runtime_seconds_bucket{bucket="6",le="2.147483648"} 0
ebpf_exporter_softirq_runtime_seconds_bucket{bucket="6",le="+Inf"} 0
```
Expected behavior would be to have:
```
ebpf_exporter_softirq_runtime_seconds_bucket{cpu="3",le="0.536870912"} 0
...
```
Question:
Does ebpf_exporter currently support per-CPU labels for histograms (similar to how it works for counter types in the percpu-softirq example)? If not, is it something that could be added, or is there a suggested workaround?
Thanks in advance for any guidance!
Contributor guide
Research direction
Start by comparing the histogram configuration with the percpu-softirq example and trace how histogram labels are handled. Confirm whether per-CPU histogram labels are supported; done means exposing the cpu label in histogram output, with tests covering the expected metric labels.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, linux, yaml
- Domain
- observability, operating-systems
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100