NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #5082 most downloaded on crates.io
Easily add metrics to your code that actually help you spot and debug issues in production. Built on Prometheus and OpenTelemetry.
Last release 1 years ago
18 Sep 2025
Ships unpredictably
gaps range from 8 days to 1.2 years
Most releases are documented
notes for 15 of 18 stable releases
1 version withdrawn
withdrawn after publishing
4 years old
19 releases · first in 2023
update grpc-http example to autometrics 2.0 by @mellowagain in #182
Full Changelog: v2.0.0...v3.0.0
One column per quarter.
metrics has been updated to v0.24 (#183)
New feature flag: metrics-0_24
Removed feature flag: metrics-0_21prometheus has been updated to v0.14 (#187)
New feature flag: prometheus-0_14
Removed feature flag: prometheus-0_13prometheus-exporter with opentelemetry, use standard otlp exporter (see https://github.com/open-telemetry/opentelemetry-rust/pull/2831)opentelemetry to v0.30update to opentelemetry 0.24 by @mellowagain in #179
Full Changelog: v1.0.1...v2.0.0
opentelemetry has been updated to v0.24 (#179)opentelemetry-0_24, exemplars-tracing-opentelemetry-0_25opentelemetry-0_21, exemplars-tracing-opentelemetry-0_22If you are using these metrics library separately in your application in addition to Autometrics, ensure that you match the version that Autometrics uses.
Added gRPC telemetry instrumentation example. by @marvin-hansen in #163
timeout and period in otel push exporter by @mellowagain in #168Full Changelog: v1.0.0...v1.0.1
http to 1.0. This fixes compatibility with axum 0.7 (#167)#[autometrics] annotation instead of the original location (#170)add otel push exporter by @mellowagain in #137
async-trait by @mellowagain in #149autometrics.version to build_info by @mellowagain in #154async-trait by @mellowagain in #161#[async_trait] attribute not being correctly detected when its re-exported from another crate by @mellowagain in #164Full Changelog: v0.6.0...v1.0.0
opentelemetry has been updated to v0.21 (#159)opentelemetry-0_21, exemplars-tracing-opentelemetry-0_22opentelemetry-0_20, exemplars-tracing-opentelemetry-0_20, exemplars-tracing-opentelemetry-0_21prometheus-client has been updated to v0.22 (#160)prometheus-client-0_22prometheus-client-0_21If you are using these metrics separately in your application in addition to Autometrics, ensure that you match the version that Autometrics uses.
otel_push_exporter is now available in addition to the existing
prometheus_exporter. It can be used to push metrics in the OTEL format via
HTTP or gRPC to a OTEL-collector-(compatible) server.syn v2 (#145)#[autometrics] together with #[async_trait]
has been improved (#149)opentelemetry-otlp when autometrics feature
otel-push-exporter is enabled#[async_trait] together with #[autometrics] (#161)#[autometrics] macro needs to be defined BEFORE #[async_trait].result label being empty when the function is annotated with #[async_trait] (#161)#[async_trait] not being correctly detected if its re-exported in another crate (#164)The Autometrics specification v1.0.0 has been released. The following changes are made in order to bring the release in compliance with the spec:
repository.url and repository.provider as build_info labels. They can be
configured either through environment variables or automatically based on your Cargo.toml
package.repository value (only GitHub, GitLab and BitBucket) (#152)autometrics.version as build_info label, specifying the autometrics spec
version that we are targeting. It is currently hardcoded to 1.0.0 (#154)repository.url and repository.provider will now be read at
both compile time and runtime (#156)Remove deprecated global functions by @emschwartz in #128
service.name label to all metrics by @emschwartz in #116actix-web example by @mellowagain in #120impl traits within types by @mellowagain in #122Full Changelog: v0.5.0...v0.6.0
settings::AutometricsSettings::builder()Registry can be used to collect metrics. This may be used to add
custom metrics alongside those produced by Autometrics, as well as to export
the metrics without using the provided prometheus_exporterservice.name label attached. This is set via the settings,
via runtime environment variable (AUTOMETRICS_SERVICE_NAME or OTEL_SERVICE_NAME),
or it falls back to the crate name defined in the Cargo.tomlfunction.calls.count metric to function.calls (which is exported
to Prometheus as function_calls_total) to be in line with OpenTelemetry and
OpenMetrics naming conventions. Dashboards and alerting rules must be updated.function.calls.duration histogram is exported to Prometheus, it now
includes the units (function_calls_duration_seconds) to be in line with
Prometheus/OpenMetrics naming conventions. Dashboards and alerting rules must be updated.function label on the metrics
(for example, MyStruct::my_method)caller label on the function.calls metric was replaced with caller.function
and caller.modulecustom-objective-latency feature can now be used with the prometheus-exporter, as well
as with the prometheus and prometheus-client crates, because the histogram buckets can now
be configured via the settingsopentelemetry to v0.20metrics feature flag (replaced with metrics-0_21)opentelemetry feature flag (replaced with opentelemetry-0_20)prometheus feature flag (replaced with prometheus-0_13)prometheus-client feature flag (replaced with prometheus-client-0_21)exemplars-tracing-opentelemetry feature flag (replaced with exemplars-tracing-opentelemetry-0_20)encode_global_metrics was removed and replaced by prometheus_exporter::encode_to_stringglobal_metrics_exporter was removed and replaced by prometheus_exporter::initbackends::prometheus_client::REGISTRY was removed. The Registry used with the prometheus-client
backend can now be accessed via AutometricsSettings::prometheus_client_registry#[autometrics] containing generic
impl types in their type arguments (fn() -> Result<impl ToString, impl std::error::Error>)
no longer fail to compile.Add changelog by @emschwartz in #83
prometheus-client crate by @emschwartz in #88prometheus_exporter functions to dedicated module by @emschwartz in #102Full Changelog: v0.4.1...v0.5.0
prometheus-client crate for producing metricsexemplars-tracing or exemplars-tracing-opentelemetry.
Autometrics can now extract fields from the current span and attach them as exemplars on the
counter and histogram metricsResultLabels derive macro allows to specify on an enum whether variants should
always be "ok", or "error" for the success rate metrics of functions using them. (#61)prometheus_exporter module contains all functions related to the prometheus-exporter featureprometheus_exporter::encode_http_response function returns an http::Response with the metrics.
This is especially recommended when using exemplars, because it automatically uses the OpenMetrics
Content-Type header, which is required for Prometheus to scrape metrics with exemplarsAUTOMETRICS_DISABLE_DOCS environment variable can be set to disable doc comment generation
(this is mainly for use with editor extensions that generate doc comments themselves)prometheus-exporter feature is enabled. In that case, the official prometheus-client will be usedautometrics would only
produce metrics using a single metrics library if multiple feature flags were enabled, using
a prioritization order defined internally)GetLabels trait (publicly exported but meant for internal use) changed the signature
of its function to accomodate the new ResultLabels macro. This change is not significant
if you never imported autometrics::__private manually (#61)opentelemetry together with the prometheus-exporter, it will no longer
use the default registry provided by the prometheus crate. It will instead use a new registryopentelemetry dependencies to v0.19. This means that users using autometrics
with opentelemetry but not using the prometheus-exporter must update the opentelemetry
to use v0.19.global_metrics_exporter and encode_global_metrics have been deprecated and replaced by
prometheus_exporter::init and prometheus_exporter::encode_to_string, respectivelyopentelemetry is no longer used by defaultGetLabelsForResult trait (publicly exported but meant for internal use) was removed
to accomodate the new ResultLabels macro. This change is not significant
if you never imported autometrics::__private manually (#61)#[autometrics] now works on functions that use type inference in their return statement
(#74, #61)Use vergen with git CLI in example by @emschwartz in #78
Full Changelog: v0.4.0...v0.4.1
Handle when counter has _total suffix by @emschwartz in #64
metrics version from 0.20 to 0.21 by @aumetra in #68Full Changelog: v0.3.3...v0.4.0
build_info metric tracks software version and commitbuild_info metric to correlate version info with problems_total suffixFix latency SLO total query by @emschwartz in #54
Full Changelog: v0.3.2...v0.3.3
Full Changelog : v0.3.1...v0.3.2
Full Changelog: v0.3.1...v0.3.2
custom-objective-latency and custom-objective-percentile feature flags
custom-objective-latency and custom-objective-percentile feature flagscustom-objectives feature flagSupport defining Service-Level Objectives (SLOs) in code
#[skip_autometrics] annotation when applying autometrics to an impl blockok_if and error_if autometrics parameters### Fixed - Histogram buckets
Building of documentation on docs.rs
Nothing published for this version
Nothing published for this version
Support opentelemetry and metrics crates for tracking metrics
opentelemetry and metrics crates for tracking metricsimpl blockUse OpenTelemetry metric naming conventions
caller labelNothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →