From 6117200658d9d00e61a70f7a8e5d92b4d375824e Mon Sep 17 00:00:00 2001 From: peter leeh Date: Sat, 20 Jul 2024 11:45:21 +0200 Subject: [PATCH 1/2] document push gateway mode --- README.md | 4 ++++ src/lib.rs | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index 1702e40..fb481c3 100644 --- a/README.md +++ b/README.md @@ -125,6 +125,10 @@ Let's note that since `metrics-exporter-prometheus = "0.13"` that crate [introdu requires openssl support. The `axum_prometheus` crate __does not__ rely on, nor enable this feature by default — if you need it, you may enable it through the `"push-gateway"` feature in `axum_prometheus`. +## Prometheus push gateway feature + +This crate currently has no higher level API for the `push-gateway` feature. If you plan to use it, enable the `push-gateway` feature in `axum-prometheus`, use `BaseMetricLayer`, and setup your recorder manually, similar to the [`base-metric-layer-example`](./examples/base-metric-layer-example/src/main.rs). + ## Using a different exporter than Prometheus This crate may be used with other exporters than Prometheus. First, disable the default features: diff --git a/src/lib.rs b/src/lib.rs index 04ac2ce..e5c6f0d 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -88,6 +88,11 @@ //! axum_http_requests_duration_seconds_count{method="GET",status="200",endpoint="/metrics"} 4 //! ``` //! +//! ## Prometheus push gateway feature +//! This crate currently has no higher level API for the `push-gateway` feature. If you plan to use it, enable the +//! `push-gateway` feature in `axum-prometheus`, use `BaseMetricLayer`, and setup your recorder manually, similar to +//! the `base-metric-layer-example`. +//! //! ## Using a different exporter than Prometheus //! //! This crate may be used with other exporters than Prometheus. First, disable the default features: From 2143908e2161ffd6dbc2499e10dfda6921c277ca Mon Sep 17 00:00:00 2001 From: peter leeh Date: Sat, 20 Jul 2024 11:47:54 +0200 Subject: [PATCH 2/2] run fmt --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index e5c6f0d..2b0df42 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,9 +90,9 @@ //! //! ## Prometheus push gateway feature //! This crate currently has no higher level API for the `push-gateway` feature. If you plan to use it, enable the -//! `push-gateway` feature in `axum-prometheus`, use `BaseMetricLayer`, and setup your recorder manually, similar to +//! `push-gateway` feature in `axum-prometheus`, use `BaseMetricLayer`, and setup your recorder manually, similar to //! the `base-metric-layer-example`. -//! +//! //! ## Using a different exporter than Prometheus //! //! This crate may be used with other exporters than Prometheus. First, disable the default features: