Skip to content

Latest commit

 

History

History
36 lines (27 loc) · 1.19 KB

README.md

File metadata and controls

36 lines (27 loc) · 1.19 KB

Metrics Server

CI Version Docs License

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.

Usage

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);

TODO

  • Add integration tests.
  • Add Prometheus examples.
  • Better URL matching.