Update version of metrics to fix integration with other tools #40
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 byaxum-prometheus
will be registered on themetrics:0.21.0
global collector, while the project's metrics will use themetrics: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 themetrics: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 othermetrics
-based tools.This commit bumps the metrics version to 0.22.0 as well as fix the macro invocations introduced on the new version.
Thanks for the project :)