Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

600 B
Raw Blame
use crate::pprof::{
    handle_allocation_flamegraph, handle_allocation_report, handle_profile_flamegraph,
    handle_profile_report,
};
use axum::{routing::get, Router};

// Call this method when building your axum::Router in your Rust service
pub fn apply_pprof_routes(router: Router) -> Router {
    router
        .route("/pprof/profile/report", get(handle_profile_report))
        .route("/pprof/profile/flamegraph", get(handle_profile_flamegraph))
        .route("/pprof/heap/report", get(handle_allocation_report))
        .route("/pprof/heap/flamegraph", get(handle_allocation_flamegraph))
}