All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.10.1 - 2024-05-20
- Add
PrometheusMetrics::with_request_filter
, allowing requests to be omitted from metrics by passing a closure returningfalse
(#23, by @Eijebong).
0.10.0 - 2023-11-20
- Upgrade Rocket dependency to 0.5.0.
0.10.0-rc.3 - 2022-06-23
- Add
PrometheusMetrics::http_requests_total
andPrometheusMetrics::http_requests_duration_seconds
methods to get a reference to the fairing's internal Prometheus metrics.
0.10.0-rc.2 - 2022-05-14
- Upgrade Rocket dependency to 0.5.0-rc.2, and update for compatibility.
0.10.0-rc.1 - 2022-02-10
- Upgrade Rocket dependency to 0.5.0-rc.1, and make the fairing async.
- Remove an allocation on every request when getting the
status
label, provided the status code is between 100 and 999.
0.9.0 - 2021-10-17
- Update
prometheus
requirement to 0.13.
0.8.1 - 2021-07-21
- The two Rocket related metrics (
http_requests_total
andhttp_requests_duration_seconds
) are now stored inside a separate registry to additional metrics. This allows multiplePrometheusMetrics
fairings to exist even when using the globalprometheus::Registry
, such as the one used for metrics created by the macros in theprometheus
crate. Previously this would cause a panic because the two fairing instances would attempt to register identical metrics to the same registry, which is an error. The implication of this is that the registry returned byPrometheusMetrics::registry
no longer contains the Rocket related metrics. In practice this is unlikely to be a problem, since metrics from both registries are returned by the fairing's handler as before.
0.8.0 - 2021-07-10
- Update
prometheus
requirement to 0.12. - Add
version=0.0.4
parameter toContent-Type
header when returning metrics at the /metrics URL, as specified by the Prometheus Exposition Formats specification. - Use
Duration::as_secs_f64
instead of manually calculating nanoseconds when calculating request durations. This bumps the minimum supported Rust version to 1.38.0, which is unlikely to be a problem in practice, since Rocket still requires a nightly version of Rust. - Impl
From<PrometheusMetrics> for Vec<Route>
instead ofInto<Vec<Route>> for PrometheusMetrics
, since the former gives us the latter for free. PrometheusMetrics::registry
is now aconst fn
.- Add
PrometheusMetrics::with_default_registry
associated function, which creates a newPrometheusMetrics
using the default globalprometheus::Registry
and will therefore expose metrics created by the various macros in theprometheus
crate.
0.7.0 - 2020-06-19
- Update
prometheus
requirement to 0.10.
0.6.0 - 2020-06-19
- Don't require the default features of the
prometheus
orrocket
dependencies. This should improve compile times for crates which also don't require those features. This is a breaking change since we re-exportprometheus
(which will now have a reduced public API) but is unlikely to affect many users, since the Protobuf format has not been supported by Prometheus for some time.
0.5.0 - 2020-05-18
- Update
prometheus
requirement to 0.9.
0.4.0 - 2020-03-02
- Update
prometheus
requirement to 0.8.
0.3.2 - 2020-01-02
- Use
Instant
instead ofSystemTime
to track request durations. This should be more accurate and is infallible.
0.3.1 - 2020-01-02
- Add
PrometheusMetrics::with_registry
associated function to allow metrics to be tracked in a custom registry.
0.3.0 - 2019-06-25
- Update
prometheus
requirement to 0.7.
0.2.0 - 2019-05-08
- Re-export
prometheus
library. This re-export is the recommended way of accessing theprometheus
crate to avoid any dependency version mismatches. - Update
prometheus
requirement to 0.6.
- First version of the crate released to crates.io.