Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lawouach/ebpf-2021-talk
Code for my talk at ebpf 2021 conference
https://github.com/lawouach/ebpf-2021-talk
devops ebpf reliability reliably sre
Last synced: 3 months ago
JSON representation
Code for my talk at ebpf 2021 conference
- Host: GitHub
- URL: https://github.com/lawouach/ebpf-2021-talk
- Owner: Lawouach
- License: gpl-2.0
- Created: 2021-07-28T14:10:41.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-08-04T11:02:07.000Z (over 3 years ago)
- Last Synced: 2024-01-29T20:58:23.352Z (12 months ago)
- Topics: devops, ebpf, reliability, reliably, sre
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 5
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ebpf as a SRE datasource with Reliably
This repository contains the code of my lightning talk at the ebpf 2021
conference. It is made of a very basic ebpf program that simply discards
anything non TCP packets on an interface we attach to. At the application
level we filter any packet not going or coming from a target port we
are interested in. We then use this data to measure latency and error rates
of requests/response to said server. The server is intended to return
errors from time to time.We are prototyping how SRE can directly benefit from ebpf events to gain
visibility over their system. By transforming these events into indicators
to publish to service level objects.## Requirements
* a recent Linux kernel (> 5.10)
* Python 3.8+
* BCC and BCC python for your system installed. Indeed the Python package
for BCC is not pip-installable so make you install with your system
package manager. On Ubuntu for example: `sudo apt install bpfcc python3-bpfcc`
* A virtual environment:
```
$ python3 -m venv --system-site-packages .venv
```
* Python dependencies:
```
$ ./.venv/bin/pip install -r requirements.txt
```
* An authenticated [Reliably](https://reliably.com/docs/getting-started/) CLI
* The [hey](https://github.com/rakyll/hey) load test program## Running
Once you have installed all the dependencies and authenticated against
Reliably, run the following commands.* The application server:
```
$ ./.venv/bin/uvicorn --port=8000 server:app
```* The `hey` program to induce some mild load on the server:
```
$ hey -c 3 -q 10 -z 600s http://localhost:8000/
```* The reliably's CLI. Run first the following
`$ reliably slo sync -m reliably.yaml`. This needs to be run only once.
Then run this command to watch your SLO:```
$ reliably slo report -m reliably.yaml -w
```* The ebpf program:
```
$ sudo .venv/bin/python3 script.py --reliably-config $HOME/.config/reliably/config.yaml
```This must run as root.
Once this is done, watch your SLO changing dependning on how the server
replies.