bpftrace_exporter

command module
v0.0.0-...-8909d99 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 29, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

README

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.

License

Apache License 2.0, see LICENSE.

Documentation

Overview

based on haproxy_exporter https://github.com/prometheus/haproxy_exporter

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL