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

Decomposing the layer #86

Open
beanow-at-crabnebula opened this issue Nov 23, 2023 · 1 comment
Open

Decomposing the layer #86

beanow-at-crabnebula opened this issue Nov 23, 2023 · 1 comment

Comments

@beanow-at-crabnebula
Copy link

Hey there :]
I'm seeing some great stuff in this library. Though I think it doesn't compose nicely at the moment.

I would like to add the metric tracking layer and the views, without the global setup and export route.

Currently the library does everything with one layer.

  • Creating your global MeterProvider and Registry
  • Adding views to the MeterProvider
  • Set up a Meter and tracking axum metrics
  • Adding a /metrics route to export on

Ideally we can pick-and-choose from this.

Rough outline of what that could be.

The views don't take any arguments, so could be a static method or it's own builder, say ViewBuilder::default().build()

The layer would exclusively measure, and it's builder could have an optional MeterProvider using the global one if None.

The export router would be a separate builder. Which could either take the current approach (make a new MeterProvider & Registry pair and set it as global) or be created from arguments passed in.

@ttys3
Copy link
Owner

ttys3 commented Nov 26, 2023

Very good advice.
It's just that I don't have enough time to do this refactoring at the moment. PR is welcome -_-

Also, I think besides pull mode prometheus exporter,
We also need to support other exporters, such as otlp.
Under this design, the prometheus specific /metrics endpoint should be an optional feature.

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

2 participants