Skip to content

refactor(core)!: Add observe layer as building block#5064

Merged
Xuanwo merged 3 commits intomainfrom
metrics-refactor
Aug 28, 2024
Merged

refactor(core)!: Add observe layer as building block#5064
Xuanwo merged 3 commits intomainfrom
metrics-refactor

Conversation

@Xuanwo
Copy link
Copy Markdown
Member

@Xuanwo Xuanwo commented Aug 27, 2024

Which issue does this PR close?

Related to #5049

Rationale for this change

What changes are included in this PR?

Add a new mod called opendal::layers::observe. In which we will provide:

  • observe::MetricsIntercept: A trait that users can implement metrics intercept.
  • observe::MetricsLayer: A layer that based on MetricsIntercept.

Based on observe mod, all our existing metrics related crates can implement:

  • MetricsLayer = observe::MetricsLayer<MetricsInterceptor>
  • PrometheusClientLayer = observe::MetricsLayer<PrometheusClientInterceptor>
  • PrometheusLayer = observe::MetricsLayer<PrometheusInterceptor>

All of them will share the exactly same behavior. Users only need to configure the Interceptor directly.

Are there any user-facing changes?

API Breaking Changes

Signed-off-by: Xuanwo <github@xuanwo.io>
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo Xuanwo changed the title poc of opendal observe layers refactor(core): Add observe layer as building block Aug 28, 2024
@github-actions github-actions Bot added the releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor" label Aug 28, 2024
@Xuanwo Xuanwo changed the title refactor(core): Add observe layer as building block refactor(core)!: Add observe layer as building block Aug 28, 2024
@Xuanwo Xuanwo changed the title refactor(core)!: Add observe layer as building block refactor(core)!: Add observe layer as building block Aug 28, 2024
@Xuanwo Xuanwo requested review from PsiACE, Zheaoli and tisonkun August 28, 2024 10:03
@Xuanwo Xuanwo marked this pull request as ready for review August 28, 2024 10:04
Signed-off-by: Xuanwo <github@xuanwo.io>
@Xuanwo
Copy link
Copy Markdown
Member Author

Xuanwo commented Aug 28, 2024

Hi, @koushiro. Would you like to continue this work and migrate it to the MetricsLayer and PrometheusLayer as well?

I believe we can address the existing problems at the same time.

@koushiro
Copy link
Copy Markdown
Member

Hi, @koushiro. Would you like to continue this work and migrate it to the MetricsLayer and PrometheusLayer as well?

I believe we can address the existing problems at the same time.

Yeah, I'd like to.

BTW, maybe the related issue link that you mentioned in the description is wrong?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

releases-note/refactor The PR does a refactor on code or has a title that begins with "refactor"

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants