diff --git a/metrics-exporter-prometheus/CHANGELOG.md b/metrics-exporter-prometheus/CHANGELOG.md index 88aa1d30..5b6fa14b 100644 --- a/metrics-exporter-prometheus/CHANGELOG.md +++ b/metrics-exporter-prometheus/CHANGELOG.md @@ -11,6 +11,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - Users can now configure the number of buckets, and bucket widths, for rolling summaries. ([#444](https://github.com/metrics-rs/metrics/pull/444)) +- Added support to run exporter "upkeep" in the background to periodically drain histograms and help + avoid unbounded memory growth over time. ([#460](https://github.com/metrics-rs/metrics/pull/460)) + +### Changed + +- Upgrade to `hyper` 1.x. ([#450](https://github.com/metrics-rs/metrics/pull/450)) +- Enabled upkeep by default, with a five second interval. ([#460](https://github.com/metrics-rs/metrics/pull/460)) ## [0.13.1] - 2024-02-11 diff --git a/metrics-exporter-prometheus/src/lib.rs b/metrics-exporter-prometheus/src/lib.rs index 7553a334..fb221e13 100644 --- a/metrics-exporter-prometheus/src/lib.rs +++ b/metrics-exporter-prometheus/src/lib.rs @@ -43,7 +43,8 @@ //! //! Using the exporter is straightforward: //! -//! ```ignore +//! ```no_run +//! # use metrics_exporter_prometheus::PrometheusBuilder; //! // First, create a builder. //! // //! // The builder can configure many aspects of the exporter, such as changing the @@ -66,6 +67,7 @@ //! // endpoint on.. no problem! You can build the recorder and install it, and get //! // back a handle that can be used to generate the Prometheus scrape output on //! // demand: +//! # let builder = PrometheusBuilder::new(); //! let handle = builder.install_recorder().expect("failed to install recorder"); //! //! // Maybe you have a more complicated setup and want to be handed back the recorder @@ -74,11 +76,13 @@ //! // //! // As this is a more advanced method, it _must_ be called from within an existing //! // Tokio runtime when the exporter is running in HTTP listener/scrape endpoint mode. +//! # let builder = PrometheusBuilder::new(); //! let (recorder, exporter) = builder.build().expect("failed to build recorder/exporter"); //! //! // Finally, maybe you literally only want to build the recorder and nothing else, //! // and we've got you covered there, too: -//! let recorder = builder.build_recorder().expect("failed to build recorder"); +//! # let builder = PrometheusBuilder::new(); +//! let recorder = builder.build_recorder(); //! ``` //! //! ## Features @@ -109,6 +113,7 @@ pub use distribution::{Distribution, DistributionBuilder}; mod exporter; pub use self::exporter::builder::PrometheusBuilder; #[cfg(any(feature = "http-listener", feature = "push-gateway"))] +#[cfg_attr(docsrs, doc(cfg(any(feature = "http-listener", feature = "push-gateway"))))] pub use self::exporter::ExporterFuture; pub mod formatting; diff --git a/metrics-util/CHANGELOG.md b/metrics-util/CHANGELOG.md index d5fb70e2..ef668282 100644 --- a/metrics-util/CHANGELOG.md +++ b/metrics-util/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] - ReleaseDate +### Added + +- New set of methods on `Registry` for getting a metric handle if it exists. ([#457](https://github.com/metrics-rs/metrics/pull/457)) +- New set of methods on `Registry` for retaining metric handles that match a given predicate. ([#461](https://github.com/metrics-rs/metrics/pull/461)) + ### Fixed - Bump `ahash` back to `0.8.8` to remove range constraint after an upstream fix was provided to diff --git a/metrics-util/src/lib.rs b/metrics-util/src/lib.rs index c3052858..4b0ac324 100644 --- a/metrics-util/src/lib.rs +++ b/metrics-util/src/lib.rs @@ -5,9 +5,11 @@ #[cfg(feature = "handles")] mod bucket; #[cfg(feature = "handles")] +#[cfg_attr(docsrs, doc(cfg(feature = "handles")))] pub use bucket::AtomicBucket; #[cfg(feature = "debugging")] +#[cfg_attr(docsrs, doc(cfg(feature = "debugging")))] pub mod debugging; #[cfg(feature = "handles")] @@ -17,6 +19,7 @@ mod quantile; pub use quantile::{parse_quantiles, Quantile}; #[cfg(feature = "registry")] +#[cfg_attr(docsrs, doc(cfg(feature = "registry")))] pub mod registry; mod common; @@ -37,6 +40,7 @@ pub use recoverable::RecoverableRecorder; #[cfg(feature = "summary")] mod summary; #[cfg(feature = "summary")] +#[cfg_attr(docsrs, doc(cfg(feature = "summary")))] pub use summary::Summary; pub mod layers; diff --git a/metrics-util/src/registry/mod.rs b/metrics-util/src/registry/mod.rs index 99683925..06e00609 100644 --- a/metrics-util/src/registry/mod.rs +++ b/metrics-util/src/registry/mod.rs @@ -15,6 +15,7 @@ pub use storage::{AtomicStorage, Storage}; mod recency; #[cfg(feature = "recency")] +#[cfg_attr(docsrs, doc(cfg(feature = "recency")))] pub use recency::{ Generation, Generational, GenerationalAtomicStorage, GenerationalStorage, Recency, };