#profiler #pprof


Pyroscope Profiler Agent for continuous profiling of Rust, Python and Ruby applications

12 releases

0.5.7 Aug 4, 2023
0.5.6 May 19, 2023
0.5.5 Apr 27, 2023
0.5.3 Jun 27, 2022
0.1.0 Dec 17, 2021

#17 in Profiling

Download history 28674/week @ 2024-01-28 29495/week @ 2024-02-04 34414/week @ 2024-02-11 33056/week @ 2024-02-18 38878/week @ 2024-02-25 28523/week @ 2024-03-03 35310/week @ 2024-03-10 33167/week @ 2024-03-17 36253/week @ 2024-03-24 48193/week @ 2024-03-31 39732/week @ 2024-04-07 34075/week @ 2024-04-14 33658/week @ 2024-04-21 26650/week @ 2024-04-28 25661/week @ 2024-05-05 32919/week @ 2024-05-12

119,994 downloads per month
Used in 9 crates (8 directly)



Rust 2.5K SLoC // 0.1% comments Python 325 SLoC // 0.0% comments Ruby 210 SLoC // 0.0% comments Forge Config 73 SLoC Jsonnet 73 SLoC Shell 58 SLoC // 0.2% comments Bazel 3 SLoC

Pyroscope Profiler

Pyroscope Profiler for Rust. Profile your Rust applications.

license tests build Crate

You may be looking for:

Table of Contents

Quick Start

Add this to your Cargo.toml:

pyroscope = "0.5.4"
pyroscope_pprofrs = "0.2"

Include Pyroscope and pprof-rs dependencies:

use pyroscope::PyroscopeAgent;
use pyroscope_pprofrs::{pprof_backend, PprofConfig};

Configure the Pyroscope agent:

 let agent =
     PyroscopeAgent::builder("http://localhost:4040", "myapp-profile")

Profile your code:

 let agent_running = agent.start()?;

 // Computation to profile 

 let agent_ready = agent_running.stop()?;

Pyroscope Server

The Pyroscope Agent send the profiling data to a Pyroscope Server. You need to have a Pyroscope Server running in order to consume and visualize this data. It's not possible, currently, to forward the data to another endpoint.


The Pyroscope Agent and the pprof-rs backend can profile and report data from a multi-threaded program. pprof-rs, however, does not track child-processes and thus profiling is limited to a single process.

Profiling Backends

The Pyroscope Agent doesn't do any profiling. The agent role is to orchestrate a profiling backend, and report the profiling data to the Pyroscope Server. The Agent can support external backends (in fact, all current backends are independent crates) and you can make your own. Backends can also be used seperately. The currently available backends are:

Native Integration

Pyroscope can be used directly from your projects with native integration. No agent or external programs are required.


  • Backend: The Pyroscope Agent uses pprof-rs as a backend. As a result, the limitations for pprof-rs also applies.
  • Tagging: As of 0.5.0, the Pyroscope Agent support tagging within threads. Check the Tags and Multi-Thread examples for usage.
  • Timer: epoll (for Linux) and kqueue (for macOS) are required for a more precise timer.
  • Shutdown: The Pyroscope Agent might take some time (usually less than 10 seconds) to shutdown properly and drop its threads. For a proper shutdown, it's recommended that you run the shutdown function before dropping the Agent.

Getting help

You can read the Docs or check the examples for detailed usage of the library. You can also join the Slack channel if you have questions.

Major Contributors

We'd like to give a big thank you to the following contributors who have made significant contributions to this project:


Pyroscope is distributed under the Apache License (Version 2.0).

See LICENSE for details.


~277K SLoC