Exports variables from bpftrace scripts as metrics.
- bpftrace v0.15.0+
./bpftrace_exporter -script bpftrace_script.bt -vars var1:type1,var2:type2,...
Example:
./bpftrace_exporter -script /usr/share/bpftrace/tools/runqlat.bt -vars usecs:hist
vars
is a comma-separated list of bpftrace variable names (without @
) and their type.
Type | Description | bpftrace example |
---|---|---|
(empty) | scalar value | @var = 5; |
counter | counter value | @var = count(); |
map | key/value map | @var[pid] = 1; |
countermap | map with counter values | @var[pid] = count(); |
hist | histogram | @var = hist(retval); |
histmap | keyed histogram | @var[comm] = hist(retval); |
On every scrape the bpftrace exporter sends a SIGUSR1
signal to the bpftrace process, which prints all bpftrace variables in JSON format to stdout.
The exporter parses the output and emits metrics in the OpenMetrics format.
- Performance Co-Pilot bpf PMDA, bcc PMDA, bpftrace PMDA
- ebpf_exporter
Apache License 2.0, see LICENSE.