Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iogbole/ebpf-network-viz
Getting Started with eBPF
https://github.com/iogbole/ebpf-network-viz
ebpf go golang prometheus tcp
Last synced: 1 day ago
JSON representation
Getting Started with eBPF
- Host: GitHub
- URL: https://github.com/iogbole/ebpf-network-viz
- Owner: iogbole
- License: apache-2.0
- Created: 2023-09-17T14:16:20.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-11-04T21:22:56.000Z (about 1 year ago)
- Last Synced: 2024-01-25T21:45:40.715Z (about 1 year ago)
- Topics: ebpf, go, golang, prometheus, tcp
- Language: C
- Homepage: https://www.israelo.io/blog/ebpf-net-viz/
- Size: 846 KB
- Stars: 9
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Getting Started with eBPF: Monitoring TCP Retransmissions with eBPF, Go and Prometheus
> [!IMPORTANT]
> Refer to this blog post for details on the background and motivation behind this experiment - **[https://www.israelo.io/blog/ebpf-net-viz/](https://www.israelo.io/blog/ebpf-net-viz/)**## Usage
1. `Make` : To compile the eBPF code and run main.go
2. `./run_prom.sh` : To start Prometheus
3. `./create_tcp_chaos.sh` : To start `tc` and generate TCP requests.## How it works
The diagram below depicts the solution.
Read the blog post for details [https://www.israelo.io/blog/ebpf-net-viz/](https://www.israelo.io/blog/ebpf-net-viz/)
## Observe
Head over to your Prometheus interface and type `tcp_retransmissions_total` into the query bar. Switch to the graph view and marvel at the results of your hard work.
### **Using Lima on MacOS**
If you're a MacOS user like me, Lima is an excellent way to emulate a Linux environment. To kick things off with Lima, follow these steps:1. Install Lima and launch it with the [ebpf-vm.yaml](https://github.com/iogbole/ebpf-network-viz/blob/main/ebpf-vm.yaml) file:
```bash
limactl start ebpf-vm.yaml
limactl shell ebpf-vm
```
2. If use use Visual Studio Code, you can connect to the Lima VM via SSH:```bash
limactl show-ssh ebpf-vm
```Subsequently, use the SSH command to link up with the remote server through Visual Studio Code.
3. After establishing the connection, clone the required repository:
```bash
git clone https://github.com/iogbole/ebpf-network-viz.git
```### **Manual Setup on Linux**
If you’re opting for a manual setup on Linux, refer to the script section in the [ebpf-vm.yaml](https://github.com/iogbole/ebpf-network-viz/blob/main/ebpf-vm.yaml#L18) file.
With your environment now primed, you’re all set to delve into the fascinating world of eBPF!