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

Use the package provided by Prometheus as much as possible in metrics/prometheus #2332

Closed
ev1lQuark opened this issue Jun 8, 2023 · 0 comments

Comments

@ev1lQuark
Copy link
Contributor

Metrics 模块下的代码结构是基于接口-实现的,但是在 Prometheus 实现中使用 opencensus 提供的 exporter,我认为这里使用 promhttp 更合适,因为 opencensus 以及 CNCF 目前主推的 opentelemetry 应该作为 metrics reporter 接口的新的实现,而不该耦合在已有的 Prometheus 实现中。除此之外,我认为可以使用 promauto 来自动注册 metrics,目前采用的方式是创建指标再手动注册。欢迎大家提出想法和建议。


The code structure in the Metrics module is based on the interface-implementation pattern. However, in the Prometheus implementation, it uses the exporter provided by opencensus. I believe that using promhttp would be more appropriate here because opencensus has been deprecated by CNCF, and opentelemetry is currently the recommended new implementation for the metrics reporter interface, rather than being coupled with the existing Prometheus implementation. Additionally, I suggest using promauto to automatically register metrics instead of manually creating metrics and registering them. I welcome everyone's ideas and suggestions.

@ev1lQuark ev1lQuark changed the title Use the package provided by Prometheus as much as possible in metrics module Use the package provided by Prometheus as much as possible in metrics/prometheus Jun 8, 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