feat: non-global metrics usage, add metrics sets #14
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.
Description
Metric
without registering them to the superglobalCore
prometheus_client::registry::Registry
, and/or iterate over the individual metrics items manuallyMetricSet
which can be implemented on structs containing multiple structs that each implementMetric
. It allows to iterate over metric structs, and each contained metrics item, and provides a methodregister_all
to register all contained metrics to a prometheus registry.This demonstrates how we could expose a
struct EndpointMetrics
from the endpoint, which has multiple metric sets inside, and still provide a straightforward way to both register them on aprometheus_client::Registry
, and use them manually withoutprometheus_client
.Based on #12
Breaking Changes
Notes & open questions
Change checklist