Pyroscope

[![ci](https://github.com/grafana/pyroscope/actions/workflows/ci.yml/badge.svg)](https://github.com/grafana/pyroscope/actions/workflows/ci.yml) [![Go Report](https://goreportcard.com/badge/github.com/grafana/pyroscope)](https://goreportcard.com/report/github.com/grafana/pyroscope) [![License: AGPLv3](https://img.shields.io/badge/License-AGPL%20v3-blue.svg)](LICENSE) [![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fgrafana%2Fpyroscope.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fgrafana%2Fpyroscope?ref=badge_shield) [![Latest release](https://img.shields.io/github/release/grafana/pyroscope.svg)](https://github.com/grafana/pyroscope/releases) [![DockerHub](https://img.shields.io/docker/pulls/grafana/pyroscope.svg)](https://hub.docker.com/r/grafana/pyroscope) [![Go Reference](https://pkg.go.dev/badge/github.com/grafana/pyroscope/v2.svg)](https://pkg.go.dev/github.com/grafana/pyroscope/v2) ## πŸŽ‰ **Announcement: Pyroscope 2.0 is here!** Pyroscope 2.0 makes the new **v2 architecture** the default. Profiles are written directly to object storage, removing the need for in-memory ingesters and local disks - simplifying operations and lowering resource usage at scale. Existing v1 deployments can opt in via a flag and migrate without data loss. Read the [2.0 release notes](https://grafana.com/docs/pyroscope/latest/release-notes/v2-0/) and the [v2 architecture overview](https://grafana.com/docs/pyroscope/latest/reference-pyroscope-v2-architecture/). Upgrading from v1? See the [migration guide](https://grafana.com/docs/pyroscope/latest/reference-pyroscope-v2-architecture/migrate-from-v1/). Want the full story? Watch the GrafanaCON 2026 talk [_Pyroscope 2.0: Continuous Profiling Architecture Deep Dive_](https://www.youtube.com/watch?v=vseSm-pzgmc). ## What is Grafana Pyroscope? Grafana Pyroscope is a continuous profiling platform designed to surface performance insights from your applications, helping you optimize resource usage such as CPU, memory, and I/O operations. With Pyroscope, you can both **proactively** and **reactively** address performance bottlenecks across your system. The typical use cases are: - **Proactive:** Reducing resource consumption, improving application performance, or preventing latency issues. - **Reactive:** Quickly resolving incidents with line-level detail and debugging active CPU, memory, or I/O bottlenecks. Pyroscope provides powerful tools to give you a comprehensive view of your application's behavior while allowing you to drill down into specific services for more targeted root cause analysis. ## How Does Pyroscope Work? ![deployment_diagram](https://grafana.com/media/docs/pyroscope/pyroscope_client_server_diagram_11_18_2024.png) Pyroscope consists of three main components: - **Pyroscope Server:** Stores and processes profiling data and serves queries. - **Clients and instrumentation:** Profiling data reaches the server in several ways: the [Pyroscope SDKs](https://grafana.com/docs/pyroscope/latest/configure-client/language-sdks/) (push), [Grafana Alloy](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/) (pull or push), or OTLP from OpenTelemetry-compatible sources such as the [OpenTelemetry eBPF profiler](https://grafana.com/docs/pyroscope/latest/configure-client/opentelemetry/ebpf-profiler/). - **Grafana Profiles Drilldown:** A queryless, intuitive UI for visualizing and analyzing profiling data (formerly Explore Profiles). Under the hood, Pyroscope v2 writes profiles straight to object storageβ€”no ingesters, no local disk. The animations below trace the three parts of the architecture. For the details behind each component, see the [v2 architecture documentation](https://grafana.com/docs/pyroscope/latest/reference-pyroscope-v2-architecture/). **Write path** β€” profiles are routed by service and written straight to object storage: ![Pyroscope v2 write path](images/pyroscope-v2-write-path.gif) **Compaction** β€” compaction-workers merge small segments into larger blocks in the background: ![Pyroscope v2 compaction](images/pyroscope-v2-compaction.gif) **Read path** β€” queries fan out across object storage to build flame graphs in Grafana Profiles Drilldown: ![Pyroscope v2 read path](images/pyroscope-v2-read-path.gif) --- ## [Pyroscope Live Demo](https://play.grafana.org/a/grafana-pyroscope-app/explore) [![Pyroscope GIF Demo](https://github.com/user-attachments/assets/2faeb985-f2b6-4311-ad29-e318e850c025)](https://play.grafana.org/a/grafana-pyroscope-app/explore) --- ## **Quick Start: Run the Pyroscope server locally** ### Docker ```sh docker run -it -p 4040:4040 grafana/pyroscope ``` ### Homebrew (macOS / Linux) ```sh brew install pyroscope-io/brew/pyroscope brew services start pyroscope ``` ### Binary Download the archive for your operating system and architecture from the [latest release](https://github.com/grafana/pyroscope/releases/latest), unpack it, and run the binary: ```sh tar xvf pyroscope_*.tar.gz ./pyroscope ``` Pyroscope listens on port `4040`. For Kubernetes/Helm, Linux packages, building from source, and full configuration options, see the [Get started guide](https://grafana.com/docs/pyroscope/latest/get-started/) and the [server documentation](https://grafana.com/docs/pyroscope/latest/configure-server/). ## **Quick Start: Visualize profiles with Grafana Profiles Drilldown** image [Grafana Profiles Drilldown](https://grafana.com/docs/grafana/latest/visualizations/simplified-exploration/profiles/) (formerly Explore Profiles) is the primary, queryless way to visualize and analyze your profiling data. ### Grafana Cloud / OSS Profiles Drilldown is pre-installed and is the default way to explore your profiles – all you need to do is start sending data. ## Documentation For more information on how to use Pyroscope with other programming languages, install it on Linux, or use it in a production environment, check out our documentation: * [Getting Started](https://grafana.com/docs/pyroscope/latest/get-started/) * [Deployment Guide](https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/) * [Pyroscope v2 Architecture](https://grafana.com/docs/pyroscope/latest/reference-pyroscope-v2-architecture/) ## Send data to the server You can send profiles to Pyroscope with the language SDKs, with [Grafana Alloy](https://grafana.com/docs/pyroscope/latest/configure-client/grafana-alloy/), or over OTLP from OpenTelemetry-compatible sources such as the [OpenTelemetry eBPF profiler](https://grafana.com/docs/pyroscope/latest/configure-client/opentelemetry/ebpf-profiler/). For more documentation on how to add the Pyroscope SDK to your code, see the [client documentation](https://grafana.com/docs/pyroscope/latest/configure-client/) on our website or find language-specific examples and documentation below:

Golang

Documentation
Examples

Java

Documentation
Examples

Python

Documentation
Examples

Ruby

Documentation
Examples

Node.js

Documentation
Examples

.NET

Documentation
Examples

eBPF

Documentation
Examples

Rust

Documentation
Examples
## [Supported Languages][supported languages] Our documentation contains the most recent list of [supported languages] and also an overview over what [profiling types are supported per language][profile-types-languages]. Let us know what other integrations you want to see in [our issues](https://github.com/grafana/pyroscope/issues?q=is%3Aissue+is%3Aopen+label%3Anew-profilers) or in [our slack](https://slack.grafana.com). [supported languages]: https://grafana.com/docs/pyroscope/latest/configure-client/ [profile-types-languages]: https://grafana.com/docs/pyroscope/latest/configure-client/profile-types/ ## Credits Pyroscope is possible thanks to the excellent work of many people, including but not limited to: * Brendan Gregg β€” inventor of Flame Graphs * Julia Evans β€” creator of rbspy β€” sampling profiler for Ruby * Vladimir Agafonkin β€” creator of flamebearer β€” fast flame graph renderer * Ben Frederickson β€” creator of py-spy β€” sampling profiler for Python * Adam Saponara β€” creator of phpspy β€” sampling profiler for PHP * Alexei Starovoitov, Daniel Borkmann, and many others who made BPF based profiling in Linux kernel possible * Jamie Wong β€” creator of speedscope β€” interactive flame graph visualizer ## Contributing To start contributing, check out our [Contributing Guide](docs/internal/contributing/README.md) ### Thanks to the contributors of Pyroscope! [//]: contributor-faces

[//]: contributor-faces