#prometheus #rocket #metrics #rocket-web #logging #profiling

rocket_prometheus_logger

Log metrics from your rocket web server to prometheus 🚀

1 unstable release

0.1.0 Feb 10, 2019

#72 in #rocket-web

MIT license

7KB
89 lines

Build Status

rocket_prometheus_logger

Track your rocket endpoint performance in prometheus.

Usage

First, import rocket_prometheus_logger:

extern crate rocket_prometheus_logger;
use rocket_prometheus_logger::prometheus_fairing;

Then, attach to your rocket!

rocket::ignite()
    .attach(prometheus_fairing::PrometheusLogger{
        address: String::from("http://127.0.0.1:9091/"),
        metric_name: String::from("endpoint_logging"),
        username: String::from("user"),
        password: String::from("pass"),
    })

Testing

cargo test --features "test"

0.2.0 Goals

  • Pull based logging
  • Configurable metrics

Dependencies

~26MB
~537K SLoC