An eBPF hook to count TC packets on the opentelemetry-demo
cd opentelemetry-demo
make start-minimal
Compile the C kernel to count TC packets
go generate
Run the eBPF script
$ go build && sudo ./go-ebpf-tracer
2025/07/27 11:38:45 Counting incoming packets on lo..
2025/07/27 11:38:46 Received 2 packets
2025/07/27 11:38:47 Received 4 packets
2025/07/27 11:38:48 Received 4 packets
2025/07/27 11:38:49 Received 6 packets
2025/07/27 11:38:50 Received 7 packets