Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update version of metrics to fix integration with other tools
The current version of metrics (0.21.0) uses an older version of macros that point to different global allocators than the current latest version (0.22.0) causing metrics to not be reported by other tools integrating with the `metrics` facade. Since metrics-rs/metrics#414, the `metrics` project now can have different registries, and such, the macros (eg: `counter!`) have been refactored. As this is a pre-1.0 project, including axum-prometheus into a project with `metrics:0.22.0` register 2 different versions of the metrics crate. So metrics reported by `axum-prometheus` will be registered on the `metrics:0.21.0` global collector, while the project's metrics will use the `metrics:0.22.0` global collector. While the current suggested method of exporting the `let (_, handle)` as a route will work, as it's pointing to the `metrics:0.21.0` collectors, other integrations such as the push-based background task will miss out the layer metrics. By upgrading this project to `metrics:0.22.0` we can ensure it's reporting to the same global collector, and thus integrated with other `metrics`-based tools. This commit bumps the metrics version to 0.22.0 as well as fix the macro invocations introduced on the new version.
- Loading branch information