# Grafana Pyroscope — Continuous Profiling Backend > Open-source continuous profiling backend from Grafana Labs that ingests pprof and eBPF profiles, supports label-based queries, and links traces to flamegraphs. ## Install Save in your project root: # Grafana Pyroscope — Continuous Profiling for Production ## Quick Use ```bash # Run the single-binary all-in-one docker run -d --name pyroscope -p 4040:4040 grafana/pyroscope:latest # Profile a Go service (push mode) go get github.com/grafana/pyroscope-go # in main.go: # pyroscope.Start(pyroscope.Config{ # ApplicationName: "my.svc", # ServerAddress: "http://pyroscope:4040", # }) # Or scrape Go pprof endpoints (pull mode) via pyroscope.yaml ``` ## Introduction Pyroscope is a continuous profiling backend that records CPU, memory, goroutine, and lock profiles from production services and lets you slice them by label like a time-series. After joining the Grafana Labs family, it was merged with Phlare into a single Grafana-integrated backend that supports both pull (pprof-scrape) and push (agent SDK) ingestion. ## What Pyroscope Does - Collects pprof-compatible profiles from Go, Java, Python, Ruby, .NET, Node.js, Rust, and eBPF. - Provides a flamegraph-first UI with "diff" mode for comparing time ranges or deployments. - Exposes profiles under labels (service, region, deployment) like Prometheus time series. - Integrates natively with Grafana for dashboards combining metrics, logs, traces, and profiles. - Supports "span profiles" — traces linked to the specific flamegraph frames that ran in them. ## Architecture Overview Pyroscope v1 is a horizontally-scalable backend derived from Grafana Phlare. Distributors accept push ingestion; Ingesters build time-partitioned profile blocks in object storage (S3/GCS/Azure); Queriers fan out reads across block metadata, with Compactors merging blocks for long-term retention. A single-binary mode collapses all roles for dev and small clusters. On the agent side, Grafana Alloy (or the standalone Pyroscope agent) handles scraping pprof endpoints and running eBPF profilers node-wide. ## Self-Hosting & Configuration - Helm chart: `helm install pyroscope grafana/pyroscope` (single-binary by default). - Configure storage in `pyroscope.yaml` — set `storage.backend=s3` and an S3 bucket for prod. - Push SDKs auto-profile at 100 Hz by default; tune `SampleRate` for heavy workloads. - eBPF profiler DaemonSet runs CPU profiles across a node for uninstrumented languages. - Grafana plugin ships built-in — add Pyroscope as a data source to get flamegraphs. ## Key Features - pprof-compatible format — dump, diff, and inspect with standard tooling. - Label-based profile queries with PromQL-like selectors. - eBPF whole-node profiling without touching application code. - Trace-to-profile linking: click a trace span to see the exact flamegraph for that span. - Scales from single binary to multi-service HA on object storage. ## Comparison with Similar Tools - **Parca** — open-source eBPF continuous profiling; Pyroscope is broader in language support. - **Datadog Continuous Profiler** — SaaS, similar capabilities; Pyroscope is self-hostable. - **Polar Signals Cloud** — managed Parca; same idea, hosted. - **elastic/otel-profiling-agent** — eBPF profiler feeding Elastic; Pyroscope supports pprof and OTel profiles. - **Classic pprof** — CLI only; Pyroscope makes it a continuous time-series system. ## FAQ **Q:** Do I have to instrument code to use it? A: Not for CPU: the eBPF profiler covers Go, Rust, C/C++, Python, Java, .NET without code changes. **Q:** How much storage does it use? A: Profiles are small and compress well; typical services cost far less than their metrics stream. **Q:** Can I diff two deployments? A: Yes, the UI supports flamegraph diff across arbitrary label sets. **Q:** Is it part of Grafana Cloud? A: Yes; the open-source code here is the same engine that powers the Grafana Cloud Profiles product. ## Sources - https://github.com/grafana/pyroscope - https://grafana.com/docs/pyroscope/latest/ --- Source: https://tokrepo.com/en/workflows/138e4edf-38d7-11f1-9bc6-00163e2b0d79 Author: AI Open Source