A hassle-free, single-responsibility, safe HTTP server used to easily expose metrics in your application.
Note: this library is NOT production ready! Use with caution and submit bugs where possible.
Include the lib in your Cargo.toml
dependencies:
[dependencies]
metrics_server = "0.1"
In your application:
use metrics_server::MetricsServer;
// Create a new server and start it in the background.
let server = MetricsServer::new();
server.serve("localhost:8001");
// Publish you application metrics periodically.
let bytes = server.update(Vec::from([1, 2, 3, 4]));
assert_eq!(bytes, 4);
- Add integration tests.
- Add Prometheus examples.