NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #1492 most downloaded on crates.io
Open Metrics client library allowing users to natively instrument applications.
Latest stable
0.26.0
Last release 11 days ago
11 Nov 2026
Release timing varies
gaps range from 8 days to 8 months
Nearly every release is documented
notes for 23 of 24 stable releases
Nothing withdrawn
no release was ever pulled
5 years old
26 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
Implement PartialEq , Eq and Hash for metrics::MetricType and registry::Unit . See PR 366 .
PartialEq, Eq and Hash for metrics::MetricType and registry::Unit. See PR 366.encoding::prometheus_text::encode to encode a Registry in the Prometheus text exposition format (version 0.0.4). See Issue 367 and PR 368.{} or a stray , in the text output. See PR 370.Counter with a name ending in _total now panics when debugfoo_total ->foo); encoding adds it automatically. In this example, the exported namefoo_total_total to foo_total, so update affected queries andPartialEq, Eq and Hash for metrics::MetricType and registry::Unit. See PR 366.encoding::prometheus_text::encode to encode a Registry in the Prometheus text exposition format (version 0.0.4). See Issue 367 and PR 368.encoding::negotiate::negotiate to choose the exposition format of a response from the Accept header of an HTTP request. See PR 381.{} or a stray , in the text output. See PR 370.Counter with a name ending in _total now panics when debug
assertions are enabled, including default development and test builds. When
upgrading, remove the suffix from registered names (for example, foo_total ->
foo); encoding adds it automatically. In this example, the exported name
changes from foo_total_total to foo_total, so update affected queries and
dashboards. The new check is disabled in builds without debug assertions,
including default release builds. See PR 371.Your coding agent can read these notes before it upgrades. Set up the MCP server →
Label values in the text format are now escaped ( \ , " and newlines), as the exposition format requires. See PR 347 .
\, " and newlines), as the exposition format requires. See PR 347.Histogram overflow bucket now uses +Inf instead of f64::MAX as its upper bound, and Histogram::new drops non-finite bucket bounds, so an explicit f64::INFINITY no longer produces a duplicate le="+Inf" series. See PR 343.protox build dependency to v0.10.The EncodeLabelSet and EncodeLabelValue derive macros now emit spanned compile errors for invalid input instead of panicking, so diagnostics point at
EncodeLabelSet and EncodeLabelValue derive macros now emit spanned compile errors for invalid input instead of panicking, so diagnostics point at the offending type or attribute rather than at the derive site. See PR 307.prometheus-client-derive-encode to v0.5.1, which updates its syn dependency to v3.The protobuf and openmetrics_protobuf features retain the now- deprecated OpenMetrics protobuf support, which will be removed in a future release.
protobuf-protox feature to build protobuf support without requiring an external protoc binary.prometheus_protobuf now generates and encodes Prometheus io.prometheus.client protobuf messages (from metrics.proto) instead of the OpenMetrics protobuf data model (prometheus/OpenMetrics/issues/296). The protobuf and openmetrics_protobuf features retain the now-deprecated OpenMetrics protobuf support, which will be removed in a future release.prost, prost-build, and prost-types to v0.14.Full Changelog: v0.24.1...v0.25.0
Added native histogram support, including native-only histograms and histograms with both classic and native buckets.
Added an off-by-default protobuf-protox feature to build protobuf support
without requiring an external protoc binary.
prost, prost-build, and prost-types dependencies to v0.14.prometheus_protobuf feature generates and encodes Prometheus
io.prometheus.client protobuf messages from metrics.proto rather than the
OpenMetrics protobuf data model.
See Issue for more context.
The protobuf and openmetrics_protobuf features retain the old, deprecated, OpenMetrics protobuf support which will
be removed in a future release.refactor(encoding): remove as casts by @jalil-salame in #281
as casts by @jalil-salame in #281count() and sum() accessors by @cratelyn in #242contains() checks if metrics exist by @cratelyn in #245len() returns the number of metrics by @cratelyn in #246Full Changelog: v0.23.1...v0.24.1
EncodeGaugeValue is implemented for usize and isize, and
EncodeCounterValue is implemented for usize. See PR 282.EncodeGaugeValue, EncodeCounterValue and EncodeExemplarValue now use
fewer as casts in their implementation. This caught an issue where
EncodeGaugeValue would not error when encoding some u64s that don't fit
in a i64. See PR 281.Histogram now exposes count() and sum() methods when the test-util
feature is enabled. See PR 242.Family now exposes a contains() method when the test-util feature
is enabled. See PR 245.Family now exposes len() and is_empty() methods when the
test-util feature is enabled. See PR 246.feat(encoding)!: EncodeLabelSet::encode() uses reference by @cratelyn in #257
EncodeLabelSet::encode() uses reference by @cratelyn in #257Family::get_or_create_owned() by @cratelyn in #244Full Changelog: v0.23.1...v0.24.0
EncodeLabelSet is now implemented for tuples (A: EncodeLabelSet, B: EncodeLabelSet).
See PR 257.
Family::get_or_create_owned can access a metric in a labeled family. This
method avoids the risk of runtime deadlocks at the expense of creating an
owned type. See PR 244.
impl<T: Collector> Collector for std::sync::Arc<T>.
See PR 273.
EncodeLabelSet::encode() now accepts a mutable reference to its encoder parameter.convert_classic_histograms_to_nhcb: true
in Prometheus scraping. See PR 276.See changelog for details.
See changelog for details.
Histogram::new now accepts an IntoIterator argument, rather than an Iterator.
See PR 243.See changelog for details.
See changelog for details.
ConstCounter::new now requires specifying the type of literal arguments, like this: ConstCounter::new(42u64);.
See PR 173.
Update prost dependencies to v0.12.
See PR 198.
Implement Atomic<u64> for AtomicU64 for gauges.
See PR 226.
Implement EnableLabelValue for bool.
See PR 237
Support i32/f32 for Gauge and u32/f32 for Counter/CounterWithExemplar.
See PR 173 and PR 216.
Supoort Arc<String> for EncodeLabelValue.
See PR 217.
Add histogram::exponential_buckets_range.
See PR 233.
Added get method to Family.
See PR 234.
, when encoding empty family label set.
See PR 175.See changelog for details.
See changelog for details.
See changelog for details.
See changelog for details.
See changelog for details.
EncodeLabelValue and EncodeLabelKey implementations for Arc,
Rc, and Box.
See PR 188.See changelog for details.
See changelog for details.
Collector trait by enabling Collector::collect to encode metrics directly with a DescriptorEncoder.
See PR 149 for details.See changelog for details.
Implement EncodeLabelValue for Option . See [PR 137].
EncodeLabelValue for Option<T>.
See PR 137.See changelog for details.
See changelog for details.
impl EncodeMetric for RefCell<T> with a new type ConstFamily implementing EncodeMetric.See changelog for details.
See changelog for details.
Introduce Collector abstraction allowing users to provide additional metrics
and their description on each scrape. See PR 82.
Introduce a #[prometheus(flatten)] attribute which can be used when deriving EncodeLabelSet, allowing
a nested struct to be flattened during encoding. See PR 118.
For example:
#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
struct CommonLabels {
a: u64,
b: u64,
}
#[derive(EncodeLabelSet, Hash, Clone, Eq, PartialEq, Debug)]
struct Labels {
unique: u64,
#[prometheus(flatten)]
common: CommonLabels,
}
Would be encoded as:
my_metric{a="42",b="42",unique="42"} 42
See changelog for details.
See changelog for details.
This is a large release including multiple breaking changes. Major user-facing improvement of this release is support for the OpenMetrics Protobuf format.
Don't box before registering.
registry.register(
"my_metric",
"This is my metric",
- Box::new(my_metric.clone()),
+ my_metric.clone(),
);
Gauge uses i64 instead of u64.
my_gauge
- .set(42u64);
+ .set(42i64);
Derive EncodeLabelSet for struct and EncodeLabelValue for enum instead of just Encode for all and require Debug.
- #[derive(Clone, Hash, PartialEq, Eq, Encode)]
+ #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelSet, Debug)]
struct Labels {
path: String,
method: Method,
some_number: u64,
}
- #[derive(Clone, Hash, PartialEq, Eq, Encode)]
+ #[derive(Clone, Hash, PartialEq, Eq, EncodeLabelValue, Debug)]
enum Method {
Get,
#[allow(dead_code)]
Put,
}
Encode as utf-8 and not as [u8].
- let mut buffer = vec![];
+ let mut buffer = String::new();
encode(&mut buffer, ®istry).unwrap();
For details on each of these, see changelog entries below.
remove method to Family to allow the removal of a specified label
set from a family. See PR 85.clear method to Family to allow the removal of all label sets
from a family. See PR 85.TypedMetric for CounterWithExemplar and HistogramWithExemplar, so that they can be used with Family. See PR 96.Registry, i.e. remove generic type parameter M from Registry. See PR 105.EncodeCounterValue)EncodeLabelSet), derivable for structs via prometheus-client-derive-encodeEncodeLabel)EncodeLabelKey)EncodeLabelValue), derivable for enums via prometheus-client-derive-encodestd::fmt::Write instead of std::io::Write.Gauge for compliance with OpenMetrics protobuf
format. See PR 105.See changelog for details.
See changelog for details.
See changelog for details.
See changelog for details.
Thanks to @nox for https://github.com/prometheus/client_rust/pull/102.
Thanks to @nox for https://github.com/prometheus/client_rust/pull/102.
See changelog for details.
See changelog for details.
See changelog for details.
Use parking_lot instead of std::sync::*.
Before proemtheus-client would use the owning_ref crate to map the target
of a std::sync::RwLockReadGuard. owning_ref has multiple unsoundness
issues, see https://rustsec.org/advisories/RUSTSEC-2022-0040.html. Instead of
replacing owning_ref with a similar crate, we switch to locking via
parking_lot which supports the above mapping natively.
See changelog for details.
See changelog for details.
with_prefix method to Registry to allow initializing a registry with a prefix. See PR 70.Debug implementations on most public types that were missing them. See PR 71.Add trait implementation for a private type which lead to compile time conflicts with existing Add implementations e.g. on String. See PR 69.See changelog for details.
See changelog for details.
Registry default generic type SendEncodeMetric to be Sync. See PR 58.See changelog for details.
See changelog for details.
Encoder methods. See PR 41.AtomicU32 on platforms that don't support AtomicU64. See PR 42.See changelog for details.
See changelog for details.
prometheus-client and prometheus-client-derive-text-encode.Nothing published for this version
One column per quarter.