🎙️ discussion How do you monitor Rust web applications in production?
Disclosure: I maintain StatLite, an open-source monitoring tool that I use for my own applications running on small VPS.
I've been asked about Rust support, so I started exploring the monitoring options for Axum and Actix Web.
I've added lightweight instrumentation recipes for both frameworks. They collect request counts, HTTP errors, average response time, process CPU, and RSS - without requiring an additional monitoring crate.
In my experiments, these recipes had a smaller binary size, lower memory overhead, and a significantly smaller metrics payload than the Prometheus-based instrumentation I tested.
The recipes and benchmark results are here:
- Actix Web: https://github.com/PVRLabs/statlite/blob/main/docs/integrate/rust/actix-web.md
- Axum: https://github.com/PVRLabs/statlite/blob/main/docs/integrate/rust/axum.md
I'm also considering native integration with existing Prometheus exporters, so users don't need to add custom instrumentation.
I wonder what people here actually use to monitor their Rust applications. Prometheus, OpenTelemetry, something simpler? Are there particular libraries you'd recommend supporting?
I'd be happy to add native integrations if there is interest.
4
u/joshuaclayton 14h ago
OpenTelemetry into Honeycomb for web applications; everything runs on Axum and otel with tracing gives plenty.
HC has a free tier as long as you stay within a certain number of events per day, which for low-traffic apps works totally fine!
5
u/Delicious_Pizza_653 19h ago
I keep things pretty simple, just a few custom endpoints that expose the metrics I actually need. Had a similar experience where bringing in a big observability library added more overhead than I was comfortable with for the tiny servers I run.
Most of the time I'm just watching request counts, error rates, and memory usage, and my own thin wrapper catches all of that without pulling in a dependency tree the size of a phone book. For alerts I've got a cron job that hits the health check every couple minutes and yells at me if response time crosses a threshold.
That lightweight approach you're describing matches what I landed on after a few false starts. I'd be curious if you've got any plans to support pushing metrics directly to a centralized collector without needing a separate exporter daemon, that's the one gap I haven't filled cleanly yet.
2
u/theelderbeever 14h ago
metrics-rswith the Prometheus exporter getting scraped by what I have available. At home standard Prometheus. At work a Vector agent. Then if I'm feeling particularly motivated I'll add OTEL but I don't often do because I often don't need it and I don't like logging into elastic which stores our traces.2
u/Luxalpa 9h ago
I'm using OpenTelemetry and Prometheus. Both for my own Actix Web applications and for our Axum servers at work.
1
u/Proper_Resist_4662 1h ago
OTel :)