Skip to content

[Bug]: After upgrade to 12.5, can no longer pass in request http client #1891

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

Closed
dsomerfield-vendia opened this issue Jun 19, 2024 · 2 comments
Labels
bug Something isn't working triage:todo Needs to be traiged.

Comments

@dsomerfield-vendia
Copy link

What happened?

A bunch of things changed between reqwest 0.11 and 0.12 and I think one of them might have broken your API. Previously we were setting the blocking client explicitly so we could change the connect timeout, but now we are able to do so. Something shifted with features and paths so that after upgrade we see an error suggesting there isn't an implement for the reqwest Client. This seems to be so whether we use sync or async:

error[E0277]: the trait bound `Client: opentelemetry_http::HttpClient` is not satisfied
   --> src/main.rs:19:39
    |
19  |                     .with_http_client(client)
    |                      ---------------- ^^^^^^ the trait `opentelemetry_http::HttpClient` is not implemented for `Client`
    |                      |
    |                      required by a bound introduced by this call
    |
    = help: the following other types implement trait `opentelemetry_http::HttpClient`:
              reqwest::async_impl::client::Client
              reqwest::blocking::client::Client
note: required by a bound in `HttpExporterBuilder::with_http_client

I assume this is an incompatible change from reqwest, but I'm not sure.

Example code: https://gist.github.com/dsomerfield-vendia/49182b2d2156097cd93eb4fa7ce0f844

API Version

0.23.0

SDK Version

0.23.0

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

OTLP

Relevant log output

error[E0277]: the trait bound `Client: opentelemetry_http::HttpClient` is not satisfied
   --> src/main.rs:19:39
    |
19  |                     .with_http_client(client)
    |                      ---------------- ^^^^^^ the trait `opentelemetry_http::HttpClient` is not implemented for `Client`
    |                      |
    |                      required by a bound introduced by this call
    |
    = help: the following other types implement trait `opentelemetry_http::HttpClient`:
              reqwest::async_impl::client::Client
              reqwest::blocking::client::Client
note: required by a bound in `HttpExporterBuilder::with_http_client`
   --> /Users/danielsomerfield/.cargo/registry/src/index.crates.io-6f17d22bba15001f/opentelemetry-otlp-0.16.0/src/exporter/http/mod.rs:131:32
    |
131 |     pub fn with_http_client<T: HttpClient + 'static>(mut self, client: T) -> Self {
    |                                ^^^^^^^^^^ required by this bound in `HttpExporterBuilder::with_http_client`
@dsomerfield-vendia dsomerfield-vendia added bug Something isn't working triage:todo Needs to be traiged. labels Jun 19, 2024
@lalitb
Copy link
Member

lalitb commented Jun 19, 2024

I believe #1674 addresses it - upgrading hyper, reqwest, http and tonic crates.

@lalitb
Copy link
Member

lalitb commented Jun 25, 2024

This was discussed in today's community meeting with @utpilla. Closing as there is an existing issue - #1427, and fix would come from #1674

@lalitb lalitb closed this as completed Jun 25, 2024
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
Development

No branches or pull requests

2 participants