NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io
crates.io, #4470 most downloaded on crates.io
A tower middleware to collect and export HTTP metrics for Axum
Latest stable
0.10.1
Last release 3 months ago
31 Jul 2026
Ships fairly regularly
a new release about every 4 months
Nearly every release is documented
notes for 15 of 16 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
16 releases · first in 2022
Drag across the ruler to compare, or tap a release to open it.
release/0.10.1 by @Ptrskay3 in https://github.com/Ptrskay3/axum-prometheus/pull/90
with_prefix on the layer-only build() path by @yacir in https://github.com/Ptrskay3/axum-prometheus/pull/91Full Changelog: https://github.com/Ptrskay3/axum-prometheus/compare/0.10.0...0.10.1
with_prefix has no effect when finalizing with build() [#91]Bump metrics-exporter-prometheus to 0.18.
metrics-exporter-prometheus to 0.18.Full Changelog: https://github.com/Ptrskay3/axum-prometheus/compare/0.9.0...0.10.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
Replace pin-project with pin-project-lite by @FalkWoldmann in https://github.com/Ptrskay3/axum-prometheus/pull/80
pin-project with pin-project-lite by @FalkWoldmann in https://github.com/Ptrskay3/axum-prometheus/pull/80Full Changelog: https://github.com/Ptrskay3/axum-prometheus/compare/0.8.0...0.9.0
MetricLayerBuilder::with_allow_pattern and MetricLayerBuilder::with_allow_patterns to only report requests matching the given patterns. [#86]Compatibility with axum = "0.8". This also updates matchit to 0.8, changing how group patterns are described: for example, with_group_patterns_as("/fo
axum = "0.8". This also updates matchit to 0.8, changing how group patterns are described:
for example, with_group_patterns_as("/foo", &["/foo/:bar"]) needs to be changed to with_group_patterns_as("/foo", &["/foo/{bar}"]).
The metrics values are also impacted: for example, the value "/foo/:bar" is now "/foo/{bar}".
This change bumps MSRV to 1.75. [#69]metrics-exporter-prometheus to skip the binding of port 9000, and the upkeep task is manually spawned. [#75]http-listener to enable that exact feature in metrics-exporter-prometheus. [#79]once_cell dependency with std::sync::OnceLock [#78]MakeDefaultHandle::make_default_handle now takes self as argument. This allows custom implementor structs to hold non-static data. [\#49]
MakeDefaultHandle::make_default_handle now takes self as argument. This allows custom implementor structs to hold non-static data. [#49]PrometheusHandle to prevent unbounded memory growth of histograms. [#52]metrics to 0.23, metrics-exporter-prometheus to 0.15. [#52]GenericMetricLayer::pair_from to initialize from a concrete struct. GenericMetricLayer::pair now requires that the handle type implements Default. [#49]BaseMetricLayer that serves a more lightweight alternative to GenericMetricLayer. [#56]MakeDefaultHandle and other API improvements by @Ptrskay3 in https://github.com/Ptrskay3/axum-prometheus/pull/49Full Changelog: https://github.com/Ptrskay3/axum-prometheus/compare/0.6.1...0.7.0
Disabled the "push-gateway" feature in metrics-exporter-prometheus by default, and added a way to enable it via the same name under axum_prometheus. T
"push-gateway" feature in metrics-exporter-prometheus by default, and added a way to enable it via
the same name under axum_prometheus. This change ensures that this crate can still be built without openssl support, see here. [#44]metrics-exporter-prometheus to 0.13 and metrics to 0.22. [#43]Update metrics-exporter-prometheus to 0.13 and metrics to 0.22 #39
metrics-exporter-prometheus to 0.13 and metrics to 0.22 #39Support for response body size metric, which can be turned on via PrometheusMetricLayerBuilder::enable_response_body_size. [\#33]
PrometheusMetricLayerBuilder::enable_response_body_size. [#33]metrics::describe_* functions by default, but can be turned off with PrometheusMetricLayerBuilder::no_initialize_metrics if you wish to do it manually. [#33]http-body = "1.0" and axum = "0.7". [#36]OnBodyChunk trait, which is ran when a response body chunk has been generated. [#33]…metrics.rs ecosystem. This is meant to be a non-breaking change - if you're using Prometheus, you shouldn't notice any changes in the public API. If y…
metrics.rs ecosystem. This is meant to be a non-breaking change - if you're using Prometheus, you shouldn't notice any changes in the public API. If you do however, please file an issue! #28StatsD exporter #28PrometheusMetricBuilder::with_prefix in 0.3.4 were not complete, this is now fully addressed. #28PrometheusMetricBuilder::with_prefix is now properly setting the metric prefix, and the metric handle also takes that prefix into account. Previously
PrometheusMetricBuilder::with_prefix is now properly setting the metric prefix, and the metric handle also takes that prefix into account. Previously the metric initialization incorrectly ignored the prefix, which caused the requests duration histogram to use quantile instead of le labels. [#26]. (Thanks @yanns!)Update metrics-exporter-prometheus to 0.12 and metrics to 0.21.
metrics-exporter-prometheus to 0.12 and metrics to 0.21.The status code of the response is now captured in the total requests counter metric. [#13] (Thanks @rthomas!)
with_prefix to PrometheusMetricLayerBuilder, which can be used to rename the default prefix (axum) for all metrics. This is especially useful when wor
with_prefix to PrometheusMetricLayerBuilder, which can be used to rename the default prefix (axum) for all metrics. This is especially useful when working with cargo workspaces that has more than one axum_prometheus instance. (Thanks @rthomas!)with_prefix to PrometheusMetricLayerBuilder, which can be used to rename the default prefix (axum) for all metrics. This is especially useful when
working with cargo workspaces that has more than one axum_prometheus instance (since environment variables don't work there).Routing patterns can be ignored, and grouped together when reporting to Prometheus.
Endpoint label behavior can be altered with the new EndpointLabel enum.
Added a new builder PrometheusMetricLayerBuilder to easily customize these.
let (prometheus_layer, metric_handle) = PrometheusMetricLayerBuilder::new()
// ignore reporting requests that match "/foo" or "/sensitive"
.with_ignore_patterns(&["/foo", "/sensitive"])
// if the any of the second argument matches, report them at the `/bar` endpoint
.with_group_patterns_as("/bar", &["/foo/:bar", "/foo/:bar/:baz"])
// use `axum::extract::MatchedPath`, and if that fails, use the exact requested URI
.with_endpoint_label_type(EndpointLabel::MatchedPath)
.with_default_metrics()
.build_pair();
A builder-example and an endpoint-type-example.
The metric names can be changed by setting some environmental variables at compile time. It is best to set these in the config.toml (note this is not the same file as Cargo.toml):
[env]
AXUM_HTTP_REQUESTS_TOTAL = "my_app_requests_total"
AXUM_HTTP_REQUESTS_DURATION_SECONDS = "my_app_requests_duration_seconds"
AXUM_HTTP_REQUESTS_PENDING = "my_app_requests_pending"
axum-core = "0.3" and thus axum = "0.6".First version.
Routing patterns can be ignored, and grouped together when reporting to Prometheus. Added PrometheusMetricLayerBuilder to easily customize these. [#5]
PrometheusMetricLayerBuilder to easily customize these. [#5]EndpointLabel enum. [#8]Compatibility with axum = "0.6" and axum-core = "0.3".
Compatibility with axum = "0.6" and axum-core = "0.3".
Nothing published for this version
One column per quarter.