Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking: replace metrics-rs with prometheus client-rs #12635

Closed
5 of 6 tasks
flaneur2020 opened this issue Aug 31, 2023 · 0 comments
Closed
5 of 6 tasks

Tracking: replace metrics-rs with prometheus client-rs #12635

flaneur2020 opened this issue Aug 31, 2023 · 0 comments
Assignees

Comments

@flaneur2020
Copy link
Member

flaneur2020 commented Aug 31, 2023

Summary

This issue is an design RFC doc for this task #9422.

Background

Have discussed in #9422

Goal

The goal is to replace metrics-rs with a native prometheus client, this allows us to shorten an abstraction layer on the metrics path and easier to cover more metrics about histogram.

Considerations

Replacing metrics-rs with prometheus-rs is not only just replacing the metrics, we need some additional considerations about:

  1. the convention on adding metrics: may have different conventions, it's a chance to find out a convention on making metrics.
  2. integration with external library like opendal: opendal have it's prometheus metrics builtin, we need find a way to integrate the metrics together.
  3. support the metrics_table: databend also contains a system table which allows us to dump the metrics in a table manner.
  4. able to not affect performance on the fast path, able to plot metrics without memory allocation.

And of course, we need keep the existed metrics not changed.

tikv/rust-promtheus or prometheus/client-rust

tikv/rust-prometheus have been proven to be a production solution in many projects. But I'd prefer prometheus/client-rust here, because:

  • prometheus/client-rust is the official client and could be considered to have more long-term support resources.
  • prometheus/client-rust utilizes a strong type system for labels, whereas tikv/rust-prometheus adopts a more Go-like approach.

prometheus/client-rust has a quirk: it appends a "_total" suffix to all counter metrics. This could impact existing counter metrics. However, in my view, this is acceptable given the advantage of having long-term support.

TODOs

References

@flaneur2020 flaneur2020 self-assigned this Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant