Skip to content

Commit 2d7e755

Browse files
Merge a2ef39e into 0e7299f
2 parents 0e7299f + a2ef39e commit 2d7e755

File tree

47 files changed

+338
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+338
-318
lines changed

Cargo.lock

Lines changed: 5 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

datadog-live-debugger/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ publish = false
99
anyhow = "1.0"
1010
libdd-common = { path = "../libdd-common" }
1111
libdd-data-pipeline = { path = "../libdd-data-pipeline" }
12-
hyper = { workspace = true}
1312
http-body-util = "0.1"
13+
"http" = "1"
14+
bytes = "1.4"
1415

1516
regex = "1.9.3"
1617
percent-encoding = "2.1"

datadog-live-debugger/src/sender.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
// SPDX-License-Identifier: Apache-2.0
33

44
use crate::debugger_defs::{DebuggerData, DebuggerPayload};
5+
use bytes::Bytes;
56
use constcat::concat;
7+
use http::uri::PathAndQuery;
8+
use http::{Method, Uri};
69
use http_body_util::BodyExt;
7-
use hyper::body::Bytes;
8-
use hyper::http::uri::PathAndQuery;
9-
use hyper::{Method, Uri};
10-
use libdd_common::hyper_migration;
10+
use libdd_common::http_common;
1111
use libdd_common::tag::Tag;
1212
use libdd_common::Endpoint;
1313
use libdd_data_pipeline::agent_info::schema::AgentInfoStruct;
@@ -140,13 +140,13 @@ pub fn generate_tags(
140140
enum SenderFuture {
141141
#[default]
142142
Error,
143-
Outstanding(hyper_migration::ResponseFuture),
144-
Submitted(JoinHandle<anyhow::Result<hyper_migration::HttpResponse>>),
143+
Outstanding(http_common::ResponseFuture),
144+
Submitted(JoinHandle<anyhow::Result<http_common::HttpResponse>>),
145145
}
146146

147147
pub struct PayloadSender {
148148
future: SenderFuture,
149-
sender: hyper_migration::Sender,
149+
sender: http_common::Sender,
150150
needs_boundary: bool,
151151
payloads: u32,
152152
}
@@ -190,7 +190,7 @@ impl PayloadSender {
190190
req = req.header("DD-EVP-ORIGIN", "agent-debugger");
191191
}
192192

193-
let (sender, body) = hyper_migration::Body::channel();
193+
let (sender, body) = http_common::Body::channel();
194194

195195
let needs_boundary = debugger_type == DebuggerType::Diagnostics;
196196
let req = req.header(
@@ -202,7 +202,7 @@ impl PayloadSender {
202202
},
203203
);
204204

205-
let future = hyper_migration::new_default_client().request(req.body(body)?);
205+
let future = http_common::new_default_client().request(req.body(body)?);
206206
Ok(PayloadSender {
207207
future: SenderFuture::Outstanding(future),
208208
sender,
@@ -225,7 +225,7 @@ impl PayloadSender {
225225
}
226226

227227
self.future = SenderFuture::Submitted(tokio::spawn(async {
228-
let resp = hyper_migration::into_response(future.await?);
228+
let resp = http_common::into_response(future.await?);
229229
Ok(resp)
230230
}));
231231
true

datadog-remote-config/Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ publish = false
99
default = ["client"]
1010
client = [
1111
"libdd-trace-protobuf",
12-
"hyper",
1312
"http-body-util",
1413
"http",
1514
"base64",
@@ -32,9 +31,9 @@ libdd-common = { path = "../libdd-common"}
3231
libdd-trace-protobuf = { path = "../libdd-trace-protobuf", optional = true }
3332
datadog-live-debugger = { path = "../datadog-live-debugger", optional = true }
3433
datadog-ffe = { path = "../datadog-ffe", optional = true }
35-
hyper = { workspace = true, optional = true }
34+
hyper = { workspace = true, optional = true, default-features = false }
3635
http-body-util = {version = "0.1", optional = true }
37-
http = { version = "1.0", optional = true }
36+
http = { version = "1.1", optional = true }
3837
base64 = { version = "0.22.1", optional = true }
3938
sha2 = { version = "0.10", optional = true }
4039
uuid = { version = "1.7.0", features = ["v4"], optional = true }

datadog-remote-config/examples/remote_config_fetch.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ async fn main() {
4040
language: "awesomelang".to_string(),
4141
tracer_version: "99.10.5".to_string(),
4242
endpoint: Endpoint {
43-
url: hyper::Uri::from_static("http://localhost:8126"),
43+
url: http::Uri::from_static("http://localhost:8126"),
4444
api_key: None,
4545
timeout_ms: 5000, // custom timeout, defaults to 3 seconds
4646
test_token: None,

datadog-remote-config/src/fetch/fetcher.rs

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ use crate::{
77
RemoteConfigProduct, Target,
88
};
99
use base64::Engine;
10+
use http::uri::PathAndQuery;
1011
use http::uri::Scheme;
12+
use http::StatusCode;
1113
use http_body_util::BodyExt;
12-
use hyper::http::uri::PathAndQuery;
13-
use hyper::StatusCode;
14-
use libdd_common::{hyper_migration, Endpoint, MutexExt};
14+
use libdd_common::{http_common, Endpoint, MutexExt};
1515
use libdd_trace_protobuf::remoteconfig::{
1616
ClientGetConfigsRequest, ClientGetConfigsResponse, ClientState, ClientTracer, ConfigState,
1717
TargetFileHash, TargetFileMeta,
@@ -345,12 +345,10 @@ impl<S: FileStorage> ConfigFetcher<S> {
345345
http::header::CONTENT_TYPE,
346346
libdd_common::header::APPLICATION_JSON,
347347
)
348-
.body(hyper_migration::Body::from(serde_json::to_string(
349-
&config_req,
350-
)?))?;
348+
.body(http_common::Body::from(serde_json::to_string(&config_req)?))?;
351349
let response = tokio::time::timeout(
352350
Duration::from_millis(self.state.endpoint.timeout_ms),
353-
hyper_migration::new_default_client().request(req),
351+
http_common::new_default_client().request(req),
354352
)
355353
.await
356354
.map_err(|e| anyhow::Error::msg(e).context(format!("Url: {:?}", self.state.endpoint)))?
@@ -567,7 +565,7 @@ fn get_product_endpoint(subdomain: &str, endpoint: &Endpoint) -> Endpoint {
567565
parts.path_and_query = Some(PathAndQuery::from_static("/v0.7/config"));
568566
#[allow(clippy::unwrap_used)]
569567
Endpoint {
570-
url: hyper::Uri::from_parts(parts).unwrap(),
568+
url: http::Uri::from_parts(parts).unwrap(),
571569
api_key: endpoint.api_key.clone(),
572570
test_token: endpoint.test_token.clone(),
573571
..*endpoint
@@ -682,7 +680,7 @@ pub mod tests {
682680
);
683681
let mut opaque_state = ConfigClientState::default();
684682

685-
let mut response = Response::new(hyper_migration::Body::from(""));
683+
let mut response = http_common::empty_response(Response::builder()).unwrap();
686684
*response.status_mut() = StatusCode::NOT_FOUND;
687685
*server.next_response.lock().unwrap() = Some(response);
688686

datadog-remote-config/src/fetch/test_server.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use base64::Engine;
1818
use http::Response;
1919
use http_body_util::BodyExt;
2020
use hyper::service::service_fn;
21-
use libdd_common::{hyper_migration, Endpoint};
21+
use libdd_common::{http_common, Endpoint};
2222
use libdd_trace_protobuf::remoteconfig::{ClientGetConfigsRequest, ClientGetConfigsResponse, File};
2323
use serde_json::value::to_raw_value;
2424
use sha2::{Digest, Sha256};
@@ -34,7 +34,7 @@ pub struct RemoteConfigServer {
3434
pub last_request: Mutex<Option<ClientGetConfigsRequest>>,
3535
#[allow(clippy::type_complexity)]
3636
pub files: Mutex<HashMap<RemoteConfigPath, (Vec<Arc<Target>>, u64, String)>>,
37-
pub next_response: Mutex<Option<Response<hyper_migration::Body>>>,
37+
pub next_response: Mutex<Option<Response<http_common::Body>>>,
3838
pub endpoint: Endpoint,
3939
#[allow(dead_code)] // stops receiver on drop
4040
shutdown_complete_tx: Sender<()>,
@@ -44,7 +44,7 @@ impl RemoteConfigServer {
4444
fn handle_request(
4545
&self,
4646
body_bytes: hyper::body::Bytes,
47-
) -> Result<Response<hyper_migration::Body>, Infallible> {
47+
) -> Result<Response<http_common::Body>, Infallible> {
4848
let request: ClientGetConfigsRequest =
4949
serde_json::from_str(core::str::from_utf8(&body_bytes).unwrap()).unwrap();
5050
let response = if let Some(response) = self.next_response.lock().unwrap().take() {
@@ -94,7 +94,7 @@ impl RemoteConfigServer {
9494
false
9595
})
9696
{
97-
Response::new(hyper_migration::Body::from("{}"))
97+
Response::new(http_common::Body::from("{}"))
9898
} else {
9999
let target_info: Vec<_> = applied_files
100100
.iter()
@@ -156,7 +156,7 @@ impl RemoteConfigServer {
156156
.collect(),
157157
client_configs: applied_files.keys().map(|k| k.to_string()).collect(),
158158
};
159-
Response::new(hyper_migration::Body::from(
159+
Response::new(http_common::Body::from(
160160
serde_json::to_vec(&response).unwrap(),
161161
))
162162
}

datadog-sidecar-ffi/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ serde_json = "1.0"
3434
libdd-crashtracker-ffi = { path = "../libdd-crashtracker-ffi", features = ["collector", "collector_windows"] }
3535

3636
[dev-dependencies]
37-
http = "1.0"
37+
http = "1.1"
3838
tempfile = { version = "3.3" }
3939

4040
[lints.rust]

datadog-sidecar/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,7 @@ libdd-tinybytes = { path = "../libdd-tinybytes" }
3131

3232
futures = { version = "0.3", default-features = false }
3333
manual_future = "0.1.1"
34-
http = "1.0"
35-
hyper = { workspace = true}
34+
http = "1.1"
3635
http-body-util = "0.1"
3736

3837
datadog-ipc = { path = "../datadog-ipc", features = ["tiny-bytes"] }

datadog-sidecar/src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ pub fn get_product_endpoint(subdomain: &str, endpoint: &Endpoint) -> Endpoint {
277277

278278
#[allow(clippy::unwrap_used)]
279279
Endpoint {
280-
url: hyper::Uri::from_parts(parts).unwrap(),
280+
url: http::Uri::from_parts(parts).unwrap(),
281281
api_key: Some(api_key.clone()),
282282
test_token: endpoint.test_token.clone(),
283283
..*endpoint

0 commit comments

Comments
 (0)