I put up a sample project for creating a custom Prometheus exporter using the Rust programming language: https://github.com/rahul-thakoor/balena-custom-rust-exporter
You can export metrics for your rust applications or even build binaries for other use cases.
Check out the
main.rs file in
src. The sample code is based on Francesco Cogno excellent
prometheus_exporter_base library(crate) and example project to calculate the size of a folder. You can tweak it to suit your use case.
The project provisions Prometheus and Grafana too, so you can collect and visualise your data like this:
Let me know if you find this helpful or have any suggestions. I appreciate any feedback or reviews.