Skip to content

Commit

Permalink
Remove isahc support (#1924)
Browse files Browse the repository at this point in the history
  • Loading branch information
aumetra authored Jul 10, 2024
1 parent c53c5f1 commit 224289e
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 30 deletions.
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
3 changes: 1 addition & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ 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 All @@ -46,4 +45,4 @@ tokio-stream = "0.1.1"
tracing = { version = "0.1", default-features = false }
tracing-core = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.3", default-features = false }
url = { version = "=2.5.0", default-features = false } #pinning the version supporting rustc 1.65
url = { version = "2.5", default-features = false }
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
2 changes: 2 additions & 0 deletions scripts/patch_dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ function patch_version() {
cargo update -p $1:$latest_version --precise $2
}

patch_version cc 1.0.105
patch_version url 2.5.0

0 comments on commit 224289e

Please sign in to comment.