prometheus_exporter

Build Status crates.io docs.rs

Helper libary to export prometheus metrics using hyper. It's intended to help writing prometheus exporters without the need to setup and maintain a http webserver. If the program also uses a http server for other purposes this package is probably not the best way and rust-prometheus should be used directly.

It uses rust-prometheus for collecting and rendering the prometheus metrics and hyper for exposing the metrics through http.

NOTICE: You have to use the same prometheus crate version that is used by this crate to make sure that the global registrar use by the prometheus macros works as expected. Currently this crate uses prometheus version 0.7.

Usage

Add this to your Cargo.toml:

toml [dependencies] prometheus_exporter = "0.4"

There are three ways on how to use the exporter:

For examples on how to use prometheus_exporter see the examples folder.