refactor: replace metrics-rs with opentelemetry-rust #2870
Merged
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.
Purpose
Remove all
tokio<1.0
dependencies.Reduce
502 - 483 = 19
dependencies.Fix the metrics feature, it was broken since v0.43.0.
Changes
(BREAK CHANGES) Due to the refactor of
metrics-rs
>0.12.1
, we couldn't keep the same configurations as before.Since the metrics feature is an experimental and development-only feature, I just made some break changes.
According to the suggestion from @doitian, replaces
metrics-rs
withopentelemetry-rust
.As
opentelemetry-rust
said, it is not stable, too, so I didn't change the APIs. I just wrote a series of compatible macros.Due to the difference of those two crates, the presentation of data couldn't be totally the same as before.
We could tweak them later according to actual requirements.
In the Further
I just let it works again, it only supports export data over a Prometheus endpoint with a preset settings, now.
Any more changes should be added later, according to actual requirements.
This change is