github.com/grafana/pyroscope@v1.18.0/examples/grafana-alloy-auto-instrumentation/ebpf/kubernetes/README.md (about) 1 # Grafana Alloy eBPF profiling via auto-instrumentation in Kubernetes 2 3 This repository provides a practical demonstration of leveraging Grafana Alloy for continuous application profiling 4 using eBPF and Pyroscope in Kubernetes. It illustrates a seamless approach to profiling Golang and Python processes, 5 aiding in performance optimization. 6 7 ## Overview 8 9 eBPF profiling via Grafana Alloy is based on a few components: 10 - `discovery.kubernetes` for discovering Kubernetes pods 11 - `discovery.relabel` for detecting and filtering target processes and setting up labels 12 - `pyroscope.ebpf` for enabling eBPF profiling for specific applications 13 - `pyroscope.write` for writing the profiles data to a remote endpoint 14 15 Refer to the [official documentation](https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.ebpf/) for an in-depth understanding and additional configuration options for eBPF with Grafana Alloy. 16 Also, check the [Grafana Alloy Components reference](https://grafana.com/docs/alloy/latest/reference/components/) for more details on each used component. 17 18 19 20 ## Getting started 21 22 To use this example: 23 24 1. Set up a local kubernetes cluster using Kind or a similar tool. 25 2. Clone this repository and navigate to this example's directory. 26 3. Deploy the manifests: 27 ```shell 28 kubectl apply -f alloy.yaml -f grafana.yaml -f pyroscope.yaml -f python-fast-slow.yaml 29 ``` 30 4. Port-forward the Grafana service to access the Explore Profiles app: 31 ```shell 32 kubectl port-forward -n pyroscope-ebpf service/grafana 3000:3000 33 ``` 34 5. Explore profiles http://localhost:3000/a/grafana-pyroscope-app/profiles-explore 35 36 After the deployment is operational, the Grafana Alloy will profile the Go and Python applications using `pyroscope.ebpf` component. 37 38 ## Documentation 39 40 Refer to the [official documentation](https://grafana.com/docs/alloy/latest/reference/components/pyroscope/pyroscope.ebpf/) for an in-depth understanding and additional configuration options for eBPF profiling with Grafana Alloy.