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

Remove isahc support #1924

Merged
merged 5 commits into from
Jul 10, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
"Dirkjan",
"EPYC",
"hasher",
"isahc",
"Isobel",
"jaegertracing",
"Kühle",
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ debug = 1
async-std = "1.10"
async-trait = "0.1"
bytes = "1"
cc = "=1.0.105" # pinning version supporting rustc 1.65
criterion = "0.5"
futures-core = "0.3"
futures-executor = "0.3"
futures-util = { version = "0.3", default-features = false }
hyper = { version = "0.14", default-features = false }
http = { version = "0.2", default-features = false }
isahc = { version = "1.4", default-features = false }
log = "0.4.21"
once_cell = "1.13"
ordered-float = "4.0"
Expand Down
1 change: 1 addition & 0 deletions opentelemetry-http/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## vNext

- **Breaking** Correct the misspelling of "webkpi" to "webpki" in features [#1842](https://github.com/open-telemetry/opentelemetry-rust/pull/1842)
- **Breaking** Remove support for the `isahc` HTTP client [#1924](https://github.com/open-telemetry/opentelemetry-rust/pull/1924)

## v0.12.0

Expand Down
1 change: 0 additions & 1 deletion opentelemetry-http/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ async-trait = { workspace = true }
bytes = { workspace = true }
http = { workspace = true }
hyper = { workspace = true, features = ["http2", "client", "tcp"], optional = true }
isahc = { workspace = true, optional = true }
opentelemetry = { version = "0.23", path = "../opentelemetry", features = ["trace"] }
reqwest = { workspace = true, features = ["blocking"], optional = true }
tokio = { workspace = true, features = ["time"], optional = true }
26 changes: 0 additions & 26 deletions opentelemetry-http/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,32 +99,6 @@ mod reqwest {
}
}

#[cfg(feature = "isahc")]
mod isahc {
use crate::ResponseExt;

use super::{async_trait, Bytes, HttpClient, HttpError, Request, Response};
use isahc::AsyncReadResponseExt;
use std::convert::TryInto as _;

#[async_trait]
impl HttpClient for isahc::HttpClient {
async fn send(&self, request: Request<Vec<u8>>) -> Result<Response<Bytes>, HttpError> {
let mut response = self.send_async(request).await?;
let mut bytes = Vec::with_capacity(response.body().len().unwrap_or(0).try_into()?);
response.copy_to(&mut bytes).await?;

let headers = std::mem::take(response.headers_mut());
let mut http_response = Response::builder()
.status(response.status().as_u16())
.body(bytes.into())?;
*http_response.headers_mut() = headers;

Ok(http_response.error_for_status()?)
}
}
}

#[cfg(feature = "hyper")]
pub mod hyper {
use crate::ResponseExt;
Expand Down
5 changes: 5 additions & 0 deletions opentelemetry/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ thiserror = { workspace = true }
[target.'cfg(all(target_arch = "wasm32", not(target_os = "wasi")))'.dependencies]
js-sys = "0.3.63"

# This cfg can't ever be enabled but cargo will respect it anyway.
# Meaning we can use this to pin unused transitive dependencies.
[target.'cfg(any())'.dependencies]
cc = { workspace = true }

[features]
default = ["trace", "metrics", "logs"]
trace = ["pin-project-lite"]
Expand Down
Loading