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

[Bug]: opentelemetry-prometheus can not be used with latest opentelemetry #1950

Closed
ttys3 opened this issue Jul 21, 2024 · 4 comments · Fixed by #1957
Closed

[Bug]: opentelemetry-prometheus can not be used with latest opentelemetry #1950

ttys3 opened this issue Jul 21, 2024 · 4 comments · Fixed by #1957
Labels
bug Something isn't working triage:todo Needs to be traiged.

Comments

@ttys3
Copy link
Contributor

ttys3 commented Jul 21, 2024

What happened?

opentelemetry-prometheus can not be used with latest opentelemetry (0.24)

I see #1932 , do not know why update all others but exclude opentelemetry-prometheus ?

API Version

0.24

SDK Version

0.24

What Exporter(s) are you seeing the problem on?

Prometheus

Relevant log output

compliation failed:


error[E0277]: the trait bound `PrometheusExporter: MetricReader` is not satisfied
   --> src/telemetry.rs:63:22
    |
63  |         .with_reader(reader)
    |          ----------- ^^^^^^ the trait `MetricReader` is not implemented for `PrometheusExporter`
    |          |
    |          required by a bound introduced by this call
    |
    = help: the following other types implement trait `MetricReader`:
              ManualReader
              PeriodicReader
note: required by a bound in `MeterProviderBuilder::with_reader`
   --> xxxx/opentelemetry_sdk-0.24.1/src/metrics/meter_provider.rs:205:27
@ttys3 ttys3 added bug Something isn't working triage:todo Needs to be traiged. labels Jul 21, 2024
@sbernauer
Copy link
Contributor

I'm also running into it. We could raise a PR bumping to opentelemetry 0.24, but I'm not really sure if it will be accepted, given #1792 said

Also removed opentelemetry-prometheus from CI for now, as it is not planned for the upcoming release : #1719

@mellowagain
Copy link

we're actually also running into this with autometrics (autometrics-dev/autometrics-rs#179). on the readme for the exporter it does say

The development of prometheus exporter has halt until the Opentelemetry metrics API and SDK reaches 1.0. Current implementation is based on Opentelemetry API and SDK 0.23.

so that also speaks for that a pr to bump it wouldn't be accepted. i couldn't find any reasoning behind stopping development on the prometheus exporter, is there more reading into why?

@sbernauer
Copy link
Contributor

I guess let's just give it a try :) I did the needed changes and created #1957

Tested them using the following Cargo.toml and it seems to work

[patch.crates-io]
opentelemetry-prometheus = { git = "https://github.com/sbernauer/opentelemetry-rust", branch = "feat/otel-prom-0.17.0" }

@ttys3
Copy link
Contributor Author

ttys3 commented Jul 23, 2024

@sbernauer wow, I also made a workaround 2 days ago

[patch.crates-io]
opentelemetry-prometheus = { git="https://github.com/ttys3/opentelemetry-rust.git", branch="opentelemetry-prometheus-sdk-0.24" }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage:todo Needs to be traiged.
Projects
None yet
3 participants