Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tyrone-wu/bpf-prog-telegraf-plugin
Telegraf input plugin for collecting metadata metrics on BPF programs on the host.
https://github.com/tyrone-wu/bpf-prog-telegraf-plugin
bpf ebpf telegraf telegraf-plugin
Last synced: about 2 months ago
JSON representation
Telegraf input plugin for collecting metadata metrics on BPF programs on the host.
- Host: GitHub
- URL: https://github.com/tyrone-wu/bpf-prog-telegraf-plugin
- Owner: tyrone-wu
- License: apache-2.0
- Created: 2024-07-10T15:11:29.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-14T22:51:28.000Z (6 months ago)
- Last Synced: 2024-10-19T23:55:49.695Z (3 months ago)
- Topics: bpf, ebpf, telegraf, telegraf-plugin
- Language: Go
- Homepage:
- Size: 57.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# `bpf-prog-info` Input Plugin
Collects metadata information on BPF programs loaded on the host.
## Configuration
```toml
# Fetch metadata metrics from BPF programs on the host.
[[inputs.bpf_prog]]
## Optional tags## Hash of the program instructions.
##
## Corresponds to `tag` field in `bpf_prog_info`.
tag = true
## ID of the BTF object.
##
## Corresponds to `btf_id` field in `bpf_prog_info`.
btf_id = true## Optional field
## Size of program's JIT-compiled machine code and translated bytecode in bytes.
##
## Corresponds to `jited_prog_len` & `xlated_prog_len` field in `bpf_prog_info`.
prog_len = true## When the program was loaded since boot time in nanoseconds.
##
## Corresponds to `load_time` field in `bpf_prog_info`.
time_loaded = true## User ID of the process who loaded the program.
##
## Corresponds to `created_by_uid` field in `bpf_prog_info`.
created_by_uid = true## ID of maps used by the program as a string.
##
## Corresponds to `map_ids` field in `bpf_prog_info`.
map_ids = true## Collects runtime (nanoseconds) & run count statistics of the program.
## NOTE: This executes the `BPF_ENABLE_STATS` syscall command.
##
## Corresponds to `run_time` & `run_cnt` field in `bpf_prog_info`.
statistics = true## Amount of times the "recursion prevention" mechanism kicks in.
##
## Corresponds to `recursion_misses` field in `bpf_prog_info`.
recursion_misses = true## Number of verified instructions in the program.
##
## Corresponds to `verified_insns` field in `bpf_prog_info`.
verified_instructions = true
```## Metrics
These metrics are extracted from the `bpf_prog_info` object.
- bpf_prog
- tags:
- id
- type
- name
- tag (optional)
- btf_id (optional)
- fields:
- jited_size (integer, bytes)
- xlated_size (integer, bytes)
- time_loaded (integer, nanoseconds)
- created_by_uid (integer)
- map_ids (string)
- run_time (integer, nanoseconds)
- run_count (integer, count)
- recursion_misses (integer, count)
- verified_instructions (integer, count)## Usage
Build binary:
```golang
go build -o bpf-prog cmd/main.go
```Execute binary:
```golang
sudo ./bpf-prog -config plugin.conf
```