metrics-util
Helper types/functions used by the metrics ecosystem.
0.20.4
86M downloads/mo
#890 most downloaded on crates.io
metrics-rs/metrics
What this package is like to depend on
Last release 3 months ago
13 May 2026
Ships fairly regularly
a new release about every 3 months
Nearly every release is documented
notes for 37 of 38 stable releases
2 versions withdrawn
withdrawn after publishing
7 years old
50 releases · first in 2019
4 releases in the last 12 months
see the full history below
Release timeline
50 releases · Apr 2019 to May 2026Releases
latest 50-
0.20.413 May 2026Release notes
Open source →Fixed
- Tightened the
metricsdependency constraint to^0.24.6so that consumers ofmetrics-utilresolve a fixedmetrics. Themetrics 0.24.6release fixes a duplicate-entry regression inmetrics::KeyHasherthat affectedmetrics_util::registry::Registryin versions 0.19.0 through 0.20.1.metrics-util 0.20.2+carries its own no-opKeyHasherand is unaffected bymetrics::KeyHasher's behavior, but the dep bump documents the intended pairing. (#694)
- Tightened the
-
0.20.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.20.228 Apr 2026 withdrawnRelease notes
Open source →Added
- New
metrics_util::common::KeyHasher, replacing the now-deprecatedmetrics::KeyHasher. (#669) Drain::count()andDrain::sum()methods to expose true-value counts/sums on reservoir-sampled storage. (#681)- Blanket
Storage<K>implementation forArc<T> where T: Storage<K>. (#657) Summary::sum()method to retrieve the running sum of recorded values. (#650)
Changed
DebuggingRecorderusesKey::to_retained()for more efficient long-lived key storage. (#688)
- New
-
0.20.128 Nov 2025Release notes
Open source →Fixed
- Fixed an atomicity violation in
AtomicSamplingReservoir::consume. (#606)
- Fixed an atomicity violation in
-
0.20.020 Jun 2025Release notes
Open source →Changed
- No changes. This release replaces 0.19.2, as #588 introduced a breaking change that should not have been released as a patch version.
-
0.19.218 Jun 2025 withdrawnRelease notes
Open source →Changed
- Taking a snapshot from
DebuggingRecordernow has "consume" semantics for counters and gauges, matching the behavior observed for histograms. (#588)
Fixed
- Use the
AtomicU64type exposed frommetrics::atomicsinAtomicSamplingReservoirto allow building on 32-bit platforms. (#585)
- Taking a snapshot from
-
0.19.120 Apr 2025 -
0.19.006 Jan 2025Release notes
Open source →Added
- Added new module
storage-- behind a feature flag of the same name -- which contains all storage implementations such asSummary,Histogram,AtomicBucket, etc. - Added new histogram storage type,
AtomicSamplingReservoir, which provides a memory-bounded histogram storage container utilizing reservoir sampling for statistically accurate sampling.
Changed
FanoutBuilderandRouterBuildernow both require recorders to beSyncto facilitate usage with being installed as the global recorder.- Moved
AtomicBucket,Histogram, andSummaryto newstoragemodule.
Removed
- Removed
handlesfeature which has been subsumed by the newstoragefeature flag.
- Added new module
-
0.18.012 Oct 2024 -
0.17.027 May 2024 -
0.16.316 Mar 2024Release notes
Open source →Added
- New set of methods on
Registryfor getting a metric handle if it exists. (#457) - New set of methods on
Registryfor retaining metric handles that match a given predicate. (#461)
Fixed
- Bump
ahashback to0.8.8to remove range constraint after an upstream fix was provided to remove the unnecessary MSRV bump.
- New set of methods on
-
0.16.211 Feb 2024 -
0.16.024 Dec 2023Release notes
Open source →Fixed
- Fixed the
Debugimplementation forbucket::Block<T>which represented both an unsafe and logically incorrect usage ofcrossbeam-epoch.
Changed
- Bump MSRV to 1.65.0.
RecoverableRecorderno longer functions as a drop guard itself, and instead returns a new type,RecoveryHandle<R>, which provides that functionality. (#414)
Removed
- Support for per-thread mode in
DebuggingRecorder. Users should now usemetrics::with_local_recorderinstead, which is inherently per-thread.
- Fixed the
-
0.15.102 Jul 2023Release notes
Open source →Added
- Added a new helper type,
RecoverableRecorder, that allows installing a recorder and then recovering it later.
Changed
- Update
aho-corasickto1.0. - Pinned
hashbrownto0.13.1to avoid MSRV bump.
- Added a new helper type,
-
0.15.016 Apr 2023Release notes
Open source →Changed
- Bump MSRV to 1.61.0.
- Switch to
metrics-exposed version ofAtomicU64.
-
0.14.021 Jul 2022Release notes
Open source →Changed
- Updated
sketches-ddsketchto0.2.0. - Switched to using
portable_atomicfor 64-bit atomics on more architectures. (#313)
- Updated
-
0.13.030 May 2022Release notes
Open source →Fixed
- In
Summary, some quantiles were previously mapped to an incorrect rank at low sample counts, leading to large swings in estimated values. (#304)
Changed
- Bumped the dependency on
metricsto deal with a public API change.
- In
-
0.12.102 May 2022Release notes
Open source →Added
- A new per-thread mode for
DebuggingRecorderthat allows recording metrics on a per-thread basis to better supporting the testing of metrics in user applications where many tests are concurrently emitting metrics.
- A new per-thread mode for
-
0.12.011 Mar 2022Release notes
Open source →Added
- New storage type,
GenerationalStorage, that provides the generational behavior ofGenerationalAtomicStorage, neeGenerationalPrimitives, without being inherently coupled to using atomic storage.
Changed
- Renamed
PrimitivestoStorage, and publicly exposed it so that users can implement their own storage strategies. - Renamed
StandardPrimitivesandGenerationalPrimitivestoAtomicStorageandGenerationalAtomicStorage, respectively. - Created a new top-level module,
registry, that encompassesRegistryand allRegistry-related and dependent types. - Exposed
DefaultHashablepublicly. - Debugging utilities have been moved to a new
debuggingmodule, andSnapshotis now public.
- New storage type,
-
0.11.120 Feb 2022Release notes
Open source →Fixed
Recencyincorrectly failed to keep track of the latest generation when a previously-observed metric had changed generations since the first time it was observed.
-
0.11.015 Jan 2022Release notes
Open source →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.
- Many types are now behind their own feature flags to allow for optimizing build times and dependency tree.
- Updated to the new handle-based design of
metrics. - Updated
AtomicBucketto useMaybeUninitand better documented the safety invariants in the various areas that useunsafe. AtomicBucketnow correctly drops only initialized slots in aBlock.
-
0.10.212 Dec 2021 -
0.10.116 Sep 2021 -
0.10.013 Jul 2021Release notes
Open source →Changed
- Bumped
metricsdependency to correspond to the change in key hasher.
- Bumped
-
0.9.124 May 2021Release notes
Open source →Changed
- Pin
crossbeam-epochto the correct version whereAtomic::compare_exchangesupport was added.
- Pin
-
0.9.019 May 2021Release notes
Open source →Changed
- Reworked
Registryto make generation tracking a configurable property at the type level.
- Reworked
-
0.8.018 May 2021Release notes
Open source →Added
- New layer --
Router-- for routing specific metrics to target downstream recorders. Registry::clearallows clearing all metrics from the registry.
Changed
- Updated all deprecated usages of
crossbeam_epoch::Atomic<T>::compare_and_settocompare_exchange.
- New layer --
-
0.7.003 May 2021Release notes
Open source →Changed
- Switched
Registryover to supporting&Key. - Switched from
dashmaptohashbrown/parking_lotforRegistry. - Updated all layers to support the change from
Keyto&Keyinmetrics::Recorder.`
Added
- Support for using the pre-hashed value of
Keyto speed upRegistryoperations.
- Switched
-
0.6.208 Mar 2021 -
0.6.107 Feb 2021Release notes
Open source →Added
- Added
AbsoluteLayerfor supporting counters reported via absolute value.
- Added
-
0.6.003 Feb 2021 -
0.5.024 Jan 2021Release notes
Open source →Changed
MetricKindis nowMetricKindMask, andMetricKindis used to define the source side i.e.MetricKindMaskis used to match againstMetricKind.
-
0.4.122 Jan 2021 -
0.4.022 Jan 2021Release notes
Open source →Added
- Added multiple utility layers: prefix, filter, and fanout.
- Added
CompositeKeyfor defining a metric kind/key combination. - Added
Histogramfor defining a bucket-based histogram. - Added
Registryfor storing metric handles mapped to a given key. - Added
Summary, based on DDSketch, as a more lightweight alternative tohdrhistogram. - Added
DebuggingRecorderto help tet various types that depend on aRecorder. - Added
Recencyfor tracking idle metrics.
Removed
- Removed
StreamingIntegersas we no longer use it, andcompressed_vecis a better option. - Removed
MetricsTreeas we no longer use it.
Changed
AtomicBucketnow exposesclearandclear_withfor both emptying the bucket and reading the values that were cleared, allowing behavior similiar to atomically swapping a fresh data structure in for another.
-
0.4.0-alpha.1122 Jan 2021 pre-releaseNothing published for this version
-
0.4.0-alpha.1018 Dec 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.825 Nov 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.725 Nov 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.624 Oct 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.524 Oct 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.408 Oct 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.316 Sep 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.227 Jul 2020 pre-releaseNothing published for this version
-
0.4.0-alpha.117 Jun 2020 pre-releaseNothing published for this version
-
0.3.217 Nov 2020Nothing published for this version
-
0.3.121 Nov 2019Release notes
Open source →Changed
- Updated to crossbeam-epoch 0.8 and switched directly to crossbeam-utils for tests.
-
0.3.030 Jul 2019Release notes
Open source →Added
MetricTreeallows storing hierarchical metric values while being serializable by serde. (#38)
-
0.2.113 Jun 2019 -
0.2.011 Jun 2019Release notes
Open source →Added
StreamingIntegersallows holding a set of integers in a compressed format in-memory. (#13)AtomicBucketprovides an append-only list of items that can be snapshot without stopping writes. (#13)
-
0.1.023 Apr 2019