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

refactor(layers/prometheus-client): provide builder APIs #5073

Merged

Conversation

koushiro
Copy link
Contributor

@koushiro koushiro commented Aug 30, 2024

Which issue does this PR close?

Related issue: #5069 (comment)
Related PR: #5072

Rationale for this change

Provide similar APIs for PrometheusLayer and PrometheusClientLayer

What changes are included in this PR?

  • support configurable params like PrometheusLayer
  • add PrometheusClientLayer::builder
  • add PrometheusClientLayerBuilder
  • fix metrics name
  • remove OperationErrorsTotalLabels
  • add more examples in doc

Are there any user-facing changes?

API breaking change

@koushiro
Copy link
Contributor Author

@Xuanwo maybe you can also take a look at this PR?

@Xuanwo
Copy link
Member

Xuanwo commented Aug 30, 2024

@Xuanwo maybe you can also take a look at this PR?

This PR appears to include many changes from #5072. Perhaps we should merge #5072 first?

@koushiro
Copy link
Contributor Author

@Xuanwo maybe you can also take a look at this PR?

This PR appears to include many changes from #5072. Perhaps we should merge #5072 first?

Yeah, I just want to give you more information about why I wrote this to provide similar APIs.


fn register(&self, registry: &mut Registry) {
registry.register_with_unit(
"opendal_operation_duration",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can't use observe::METRIC_OPERATION_DURATION_SECONDS.name() here, prometheus-client will generate opendal_operation_duration_seconds_seconds metric

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe we should use register instead of register_with_unit here, then we could use observe::METRIC_OPERATION_DURATION_SECONDS.name()

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I see. Let's change it.

@koushiro koushiro changed the title refactor(layers/prometheus-client): provide consistent APIs refactor(layers/prometheus-client): provide builder APIs Sep 3, 2024
@koushiro koushiro marked this pull request as ready for review September 3, 2024 07:19
@koushiro koushiro requested a review from Xuanwo September 3, 2024 12:51
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot!

@Xuanwo Xuanwo merged commit 84e8290 into apache:main Sep 3, 2024
229 checks passed
@koushiro koushiro deleted the prometheus-client-consistent-apis branch September 3, 2024 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants