metrics-exporter-prometheus
A metrics-compatible exporter for sending metrics to Prometheus.
0.18.3
43M downloads/mo
#1367 most downloaded on crates.io
metrics-rs/metrics
What this package is like to depend on
Last release 3 months ago
30 Apr 2026
Ships fairly regularly
a new release about every 2 months
Nearly every release is documented
notes for 29 of 29 stable releases
3 versions withdrawn
withdrawn after publishing
6 years old
42 releases · first in 2020
4 releases in the last 12 months
see the full history below
Release timeline
42 releases · Jun 2020 to Apr 2026Releases
latest 42-
0.18.330 Apr 2026Release notes
Open source →Fixed
- Tightened the
metricsdependency constraint to^0.24.5to avoid build failures when an oldermetrics 0.24.xis locked. (#692)
- Tightened the
-
0.18.228 Apr 2026 withdrawnRelease notes
Open source →Added
- New
PrometheusHandle::render_protobuf_to_writemethod to render the Protocol Buffers payload directly into aWriteimplementation. (#661)
Changed
- Descriptions are now stored in a lock-free
evmap, eliminating writer contention with the rendering hot path. (#672) PrometheusRecorderusesKey::to_retained()for more efficient long-lived key storage. (#688)- License updated to reflect the bundled Prometheus protobuf schema. (#683)
- Use
write!inwrite_metric_linefor a small rendering perf improvement. (#658)
- New
-
0.18.107 Dec 2025Release notes
Open source →Fixed
- Fixed a bug where native histograms were incorrectly skipped when serialized the Protocol Buffers payload. (#649)
-
0.18.028 Nov 2025Release notes
Open source →Added
- Added
with_recommended_namingtoPrometheusBuilder, which when set totruewill use the recommended naming convention for Prometheus metrics: suffixing counters with_totaland ensuring unit suffixes are present. Users should prefer this going forward, andset_enable_unit_suffixis deprecated and will be removed in a future release in favor ofwith_recommended_naming. (#596) - Added support for emitting metrics in the Protocol Buffers-based scrape format. The exporter automatically detects
which format to render responses in based on the presence/value of the
Acceptheader in requests. Additionally, a new method,PrometheusHandle::render_protobuf, has been added to render metrics in this format, similar toPrometheusHandle::render. (#602) - Added
LabelSet, which provides a wrapper around label key/value pairs to ensure consistent sanitization. (#605) - Added anew feature flag,
push-gateway-no-tls-provider, to allow enabling push gateway support without including a default TLS provider viarustls. Users enabling this flag must install a default TLS provider forrustlsviarustls::crypto::CryptoProvider::install_default. (#607) - Added experimental support for native histograms. Users can enable native histograms using the existing matcher
approach by calling
PrometheusBuilder::set_native_histogram_for_metric. Native histograms are only rendered when the Protocol Buffers-based scrape format is in use. (#610) - Added a new method (
render_to_write) toPrometheusHandlethat allows writing directly to aWriteimplementation. (#641)
Changed
- Slightly updated the logic for rendering Prometheus outputs to be more incremental where possible to allow
render_to_writeto be roughly constant memory usage regardless of the overall number of metrics being rendered. (#641)
Fixed
- Fixed a bug where the
_totalsuffix for counters was not being appended to the HELP or TYPE lines for counters. (#597)
- Added
-
0.17.220 Jun 2025 -
0.17.118 Jun 2025Release notes
Open source →Fixed
- Apply unit suffixes in the correct portion of metric names when unit suffixing is enabled. (#582)
-
0.17.020 Apr 2025Release notes
Open source →Changed
- Updated
randto0.9. (#556) - Bumped
thiserrorto2.0. (#572) - Added new flag,
use_http_post_method, toPrometheusBuilder::with_push_gateway, to allow changing the HTTP method used for pushing from PUT to POST. This enables usage with systems like Vector which don't natively support PUT. (#574) - Render scrape endpoint/push gateway payloads in a blocking thread to avoid blocking regular Tokio executor threads. (#576)
- Updated
-
0.16.231 Jan 2025Release notes
Open source →Fixed
- Fixed a bug where the configurable unit suffix was not properly applied to the "sum" and "count" lines for histograms. The prior release will be yanked as this represented a backwards-incompatible change.
-
0.16.106 Jan 2025 withdrawnRelease notes
Open source →Changed
- Updated the crate-level documentation, and the documentation for
PrometheusBuilder::build_recorderandPrometheusBuilder::install_recorder, to call out the requirements around running upkeep periodically. (#537) - Updated to new version of
metrics-util.
Added
- Added support for suffixing metric names based on their configured units. (#535)
- Updated the crate-level documentation, and the documentation for
-
0.16.012 Oct 2024 -
0.15.313 Jul 2024 -
0.15.213 Jul 2024 withdrawnRelease notes
Open source →Added
- Added support to use a UDS listener for the HTTP gateway mode. (#498)
Changed
- Update the
Content-Typeresponse header totext/plain, matching the Exposition format specification. (#496)
-
0.15.124 Jun 2024 -
0.15.027 May 2024 -
0.14.016 Mar 2024Release notes
Open source →Added
- Users can now configure the number of buckets, and bucket widths, for rolling summaries. (#444)
- Added support to run exporter "upkeep" in the background to periodically drain histograms and help avoid unbounded memory growth over time. (#460)
Changed
-
0.13.111 Feb 2024Release notes
Open source →Added
- A new scrape endpoint path,
/health, which returns a a basic response to indicate endpoint health. (#435)
Changed
- Bumped the
indexmapdependency to the latest version. (#439)
- A new scrape endpoint path,
-
0.13.024 Dec 2023Release notes
Open source → -
0.12.213 Dec 2023 -
0.12.109 May 2023Release notes
Open source →Added
- Support for specifying a username/password for HTTP Basic Authentication when pushing to a Push Gateway. (#366)
-
0.12.016 Apr 2023Release notes
Open source →Changed
- Bump MSRV to 1.61.0.
- Switch to
metrics-exposed version ofAtomicU64.
-
0.11.021 Jul 2022Release notes
Open source →Changed
-
Aggregated summaries are now rolling, allowing oldering data points to expire and quantile values to reflect the recent past rather than the lifetime of a histogram. (#306)
They have a default width of three buckets, with each bucket being 20 seconds wide. This means only the last 60 seconds of a histogram -- in 20 second granularity -- will contribute to the quantiles emitted.
We'll expose the ability to tune these values in the future.
-
Switched to using
portable_atomicfor 64-bit atomics on more architectures. (#313)
-
-
0.10.030 May 2022Release notes
Open source → -
0.9.011 Mar 2022Release notes
Open source →Added
- New top-level module,
formatting, which exposes many of the helper methods used to sanitize and render the actual Prometheus exposition format. (#285)
- New top-level module,
-
0.8.015 Jan 2022Release notes
Open source →Added
- New builder method,
PrometheusBuilder::install_recorder, which builds and installs the recorder and returns aPrometheusHandlethat can be used to interact with the recorder.
Changed
- Updated various dependencies in order to properly scope dependencies to only the necessary feature flags, and thus optimize build times and reduce transitive dependencies.
- Updated to the new handle-based design of
metrics. - Renamed
tokio-exporterfeature flag tohttp-listener. - Renamed
PrometheusBuilder::buildtobuild_recorder. - Renamed
PrometheusBuilder::build_with_exportertobuild. InstallErroris nowBuildError, and contains many more variants with hopefully) better error messages for understanding when something went wrong.- Most builder methods are now fallible to help avoid runtime panics for invalid data given when building, and to better surface this upfront to users.
- Rendered output for histograms is now stable, based on the order in which a given key (name/labels) was recorded.
Fixed
- Label keys and values, as well as metric descriptions, are now correctly sanitized according to the Prometheus data model and exposition format. (#248)
- Metric descriptions are correctly mapped to metrics whose names have been modified during sanitization.
- Histograms are now correctly removed when they exceed the idle timeout.
- New builder method,
-
0.7.016 Dec 2021Release notes
Open source →Changed
- Calling
PrometheusBuilder::installinside a Tokio runtime will spawn the exporter on that runtime rather than spawning a new runtime. (#251)
- Calling
-
0.6.116 Sep 2021 -
0.6.015 Jul 2021 -
0.5.018 May 2021Release notes
Open source →Added
PrometheusBuilder::add_allowed, which enables the exporter to be configured with a list of IP addresses or subnets that are allowed to connect. By default, no restrictions are enforced.
-
0.4.003 May 2021Release notes
Open source →Changed
- Bumped
metricsdependency to0.15and updated the necessary APIs.
- Bumped
-
0.3.003 Feb 2021 -
0.2.024 Jan 2021Release notes
Open source →Changed
- Switched from
MetricKindforMetricKindMaskforPrometheusBuilder::idle_timeout.
- Switched from
-
0.1.022 Jan 2021 -
0.1.0-alpha.1312 Jan 2021 pre-releaseNothing published for this version
-
0.1.0-alpha.1218 Dec 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.1025 Nov 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.925 Nov 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.703 Nov 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.624 Oct 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.416 Sep 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.322 Jul 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.217 Jun 2020 pre-releaseNothing published for this version
-
0.1.0-alpha.117 Jun 2020 pre-releaseNothing published for this version