Ultra-low-latency asynchronous C++17 logging and metrics library that defers formatting and I/O to a background thread.
hotpath-rs/hotpath
A Rust profiler that measures CPU, memory, async, SQL, HTTP and I/O bottlenecks, with Prometheus and Grafana export.
- Stars
- 1,899
- Forks
- 61
- Open issues
- 8
- Last commit
- 20 hours ago
What is it?
hotpath is a Rust profiling toolkit for finding where code spends time, burns CPU, and allocates memory. It distinguishes functions that are slow because they wait on I/O from those that are CPU-intensive, and it can instrument functions, channels, futures, streams, locks, SQL queries, HTTP calls and byte-level I/O.
Profiling is feature-gated, so instrumentation macros compile to no-ops unless a feature such as hotpath or hotpath-alloc is enabled. Results can be printed as a static report when the program exits, or viewed in a live TUI dashboard. Metrics can also be exported to Prometheus and Grafana for production monitoring.
The project includes an MCP server so AI agents can query profiling data, and a CLI command that sets up profiling in a repository with a coding agent.
Key features
- 01Measures function time, CPU samples and allocations, with per-function reports.
- 02Tracks async futures, channels and streams, including queue depth and latency.
- 03Profiles SQL queries for sqlx and Diesel, and HTTP calls for reqwest and ureq.
- 04Records per-route latency and errors for axum servers.
- 05Exports metrics to Prometheus and Grafana dashboards.
- 06Provides a live TUI dashboard and an MCP server for AI agents.
Use cases
- Finding which functions dominate CPU time or allocate the most memory in a Rust service.
- Telling apart slow code that waits on I/O from code that is CPU-bound.
- Diagnosing lock contention or slow channels in async Tokio applications.
- Monitoring SQL and HTTP latency in production through Prometheus and Grafana.
Quick start
- 1
Install the hotpath CLI
cargo install hotpath --version '^0.28' - 2
Let your AI agent set up profiling in your repo
hotpath init --agent claude - 3
Or add the hotpath dependency to Cargo.toml manually
hotpath = "0.28" - 4
Run your program with profiling enabled
cargo run --features='hotpath,hotpath-alloc'
Things to know
- Core public APIs are stable, but internal report formats, TUI/MCP internals and advanced config options may change between releases.
- Full instrumentation requires adding feature-gated macros and dependencies to your own code.
In collections
Topics
FAQ
- What is hotpath?
- A Rust profiler that measures CPU, memory, async, SQL, HTTP and I/O bottlenecks, with Prometheus and Grafana export. hotpath is a Rust profiling toolkit for finding where code spends time, burns CPU, and allocates memory. It distinguishes functions that are slow because they wait on I/O from those that are CPU-intensive, and it can instrument functions, channels, futures, streams, locks, SQL queries, HTTP calls and byte-level I/O.
- Is hotpath free to use? What license does it have?
- hotpath is open source under the MIT license. Check the license terms before using it in commercial products.
- Is hotpath still maintained?
- Actively maintained. The last commit to hotpath was on Oct 21, 2026.
- What can I use hotpath for?
- Finding which functions dominate CPU time or allocate the most memory in a Rust service. Telling apart slow code that waits on I/O from code that is CPU-bound. Diagnosing lock contention or slow channels in async Tokio applications. Monitoring SQL and HTTP latency in production through Prometheus and Grafana.
- How do I install hotpath?
- Install the hotpath CLI: cargo install hotpath --version '^0.28' Let your AI agent set up profiling in your repo: hotpath init --agent claude Or add the hotpath dependency to Cargo.toml manually: hotpath = "0.28" Run your program with profiling enabled: cargo run --features='hotpath,hotpath-alloc'
- Where can I get hotpath?
- The source code and installation instructions are on GitHub: https://github.com/hotpath-rs/hotpath
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source tracing and profiling suite with SDKs, system daemons and a browser-based UI for analyzing traces on Android, Linux and Chromium.
Horizontally scalable, multi-tenant log aggregation system that indexes only labels, not log contents, from Grafana Labs.
Builds and manages Grafana dashboards and prefilled alerts for common services and infrastructure, so you don't write queries by hand.
A terminal UI (TUI) for viewing and controlling Docker containers, with live stats, logs and exec access.
A memory profiler for Python that tracks allocations in Python code, native extensions, and the interpreter, with several report types.