Expand description
Rust integration for Pyroscope.
Quick Start
Add the Pyroscope Library and the pprof-rs backend to Cargo.toml
[dependencies]
pyroscope = "0.5"
pyroscope_pprofrs = "0.2"
Configure a Pyroscope Agent
ⓘ
let agent =
PyroscopeAgent::builder("http://localhost:4040", "myapp")
.backend(Pprof::new(PprofConfig::new().sample_rate(100)))
.build()?;
Start/Stop profiling
To start profiling code and sending data.
ⓘ
let agent_running = agent.start()?;
To stop profiling code. You can restart the profiling at a later point.
ⓘ
let agent_ready = agent.stop()?;
Before you drop the variable, make sure to shutdown the agent.
ⓘ
agent_ready.shutdown();
Re-exports
pub use crate::pyroscope::PyroscopeAgent;
pub use error::PyroscopeError;
pub use error::Result;