Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dorkamotorka/ebpf-map-metrics
eBPF Map Prometheus Exporter
https://github.com/dorkamotorka/ebpf-map-metrics
Last synced: about 1 month ago
JSON representation
eBPF Map Prometheus Exporter
- Host: GitHub
- URL: https://github.com/dorkamotorka/ebpf-map-metrics
- Owner: dorkamotorka
- License: bsd-2-clause
- Created: 2024-07-29T07:05:09.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-08-09T09:42:54.000Z (5 months ago)
- Last Synced: 2024-08-10T10:52:49.105Z (5 months ago)
- Language: C
- Homepage:
- Size: 2.98 MB
- Stars: 5
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# eBPF Map Metrics Prometheus Exporter
## Development Status
This project is currently under development.
It requires `6.6+` Linux Kernel, due to `bpf_map_sum_elem_count` kfunc.
![Infra-9](https://github.com/user-attachments/assets/de0a70c1-1fbb-498c-b3de-80c1d1c0bf7b)
## How to Run
To run the program, follow these steps:
- First build and run the docker container with all the dependencies:
```
docker buildx create --name mybuilder --bootstrap --use
docker buildx build --push --platform linux/arm64,linux/amd64 --tag dorkamotorka/ubuntu-ebpf -f Dockerfile .
docker run --rm -it -v ~/ebpf-map-metrics/src:/ebpf-map-metrics --privileged -h test --name test --env TERM=xterm-color dorkamotorka/ubuntu-ebpf
```- Exec into the container:
```
cd ebpf-map-metrics
go generate
go build
sudo ./map-exporter
```- You can then test trigger actions on eBPF map using:
```
sudo bpftool map
sudo bpftool map update id key 0 0 0 0 value 1 0 0 0
sudo bpftool map delete id key 0 0 0 0
sudo bpftool map lookup id key 0 0 0 0
```## eBPF Iterators
eBPF Iterators are a powerful feature that allows developers to iterate over kernel data structures efficiently.
They facilitate detailed inspection and analysis by enabling safe traversal of complex data structures,
making it easier to collect metrics, debug, and perform various monitoring tasks within the kernel space (and send it back to the user space).