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

Proposal: BasicController to MeterProvider #976

Closed
hdost opened this issue Feb 27, 2023 · 13 comments
Closed

Proposal: BasicController to MeterProvider #976

hdost opened this issue Feb 27, 2023 · 13 comments
Labels
A-metrics Area: issues related to metrics

Comments

@hdost
Copy link
Contributor

hdost commented Feb 27, 2023

Background

While looking into #961 I hadn't gone into the metrics side of things too much, and I noticed that the equivalent part is called the BasicController which isn't an obvious 1:1. Additionally, it seems to be missing some features. (I know that tracing is more the focus right now as I don't think we've stabilized tracing yet.

Proposal

  • Move the code of opentelemetry-sdk::metrics::controllers::BasicController to opentelemetry-sdk::metrics::SdkMeterProvider
    ** New source file would be src/metrics/provider.rs
  • Make the exporters accept a dyn MeterProvider (this is questionable though as the exporter shouldn't need to know about the MeterProvider the relationship should be inversely related. Additionally, the current mode of the MeterProvider doesn't allow for multiple exporters.

Reference
https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#meterprovider

@hdost hdost added the A-metrics Area: issues related to metrics label Feb 27, 2023
@jtescher
Copy link
Member

Yeah the SDK needs considerable changes. I'm working on a branch to bring in the latest spec changes, adding support for views and other new constructs. Can post back here once I've got more thought through, but open to suggestions as well 👍

@hdost
Copy link
Contributor Author

hdost commented Feb 27, 2023

Yeah the SDK needs considerable changes. I'm working on a branch to bring in the latest spec changes, adding support for views and other new constructs. Can post back here once I've got more thought through, but open to suggestions as well 👍

Can you post as a separate branch? I could make some PRs to it that way.

@TommyCpp
Copy link
Contributor

TommyCpp commented Feb 27, 2023

I actually also have a WIP for view support from #897. I can contribute to your branch if needed.

@hdost
Copy link
Contributor Author

hdost commented Mar 12, 2023

@jtescher
Copy link
Member

Ah yeah, meant to include the link. Got most of the spec implemented, but needs cleanup / tests and to update the exporters outside of prometheus. @hdost saw you are updating proto, that'd be useful as the new metrics format lines up with that.

@jtescher
Copy link
Member

Also still have to think through the most ergonomic way to register callbacks

@hdost
Copy link
Contributor Author

hdost commented Mar 12, 2023

Ah yeah, meant to include the link. Got most of the spec implemented, but needs cleanup / tests and to update the exporters outside of prometheus. @hdost saw you are updating proto, that'd be useful as the new metrics format lines up with that.

Hoping to have it ready to go before I go to bed tonight.

@hdost
Copy link
Contributor Author

hdost commented Mar 13, 2023

Update, it seems like the -proto project is not using the same version as I'm using locally. And the CI is Opaque 😢 it's not clear what the difference is. And I'm not really seeing docs on how I can specify the protoc or protobuf to use.
The CI seems to be using 3.20.3 which I've downloaded and attempted setting PROTOC and PROTOC_INCLUDE, but to no avail.

@TommyCpp
Copy link
Contributor

The CI seems to be using 3.20.3 which I've downloaded and attempted setting PROTOC and PROTOC_INCLUDE, but to no avail.

Maybe add a step in GitHub action and run protoc --version? Although from the log I do see the setup steps says it using 3.20.3

@hdost
Copy link
Contributor Author

hdost commented Mar 14, 2023

The CI seems to be using 3.20.3 which I've downloaded and attempted setting PROTOC and PROTOC_INCLUDE, but to no avail.

Maybe add a step in GitHub action and run protoc --version? Although from the log I do see the setup steps says it using 3.20.3

The issue was my lock file 🤦🏼‍♂️

@DerekStrickland
Copy link

Totally selfish question alert. 🤓

I'm currently working on a Proof-Of-Concept that pushes metrics to an Otel Collector. I ran into the same issues as reported in #914 and was about to give his example a try, but it looks like the work on https://github.com/jtescher/opentelemetry-rust-1/tree/new-metrics is about to change the world 🤣 .

Any thoughts on how close this is to landing? Just wondering if I should wait, or keep going with my POC. It wouldn't be the end of the world if I had to refactor this in a couple of weeks, but on the other hand if it's days away, I could pivot and come back next week.

Another option, if it would be helpful and not a distraction, is that I could use my POC as a test case for the work on that branch. Figured I'd offer.

@hdost
Copy link
Contributor Author

hdost commented Mar 24, 2023

FYI #1000 is doing the large refactor, should come after 0.19.0 release

@TommyCpp
Copy link
Contributor

#1000 has merged. Closing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-metrics Area: issues related to metrics
Projects
None yet
Development

No branches or pull requests

4 participants