Skip to content

andreasgerstmayr/bpftrace_exporter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bpftrace-exporter

Exports variables from bpftrace scripts as metrics.

Requirements

  • bpftrace v0.15.0+

Usage

./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.

Supported bpftrace variable types

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);

Internals

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.

Related Projects

License

Apache License 2.0, see LICENSE.

About

Export variables from bpftrace scripts as metrics.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published