Skip to content

Commit d878f4a

Browse files
authored
Merge branch 'main' into dsn/crashtracker-many-signals
2 parents ab7383e + 1a7e673 commit d878f4a

File tree

17 files changed

+528
-535
lines changed

17 files changed

+528
-535
lines changed

data-pipeline-ffi/src/trace_exporter.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -901,7 +901,8 @@ mod tests {
901901
assert_eq!(response.assume_init().body.to_string_lossy(), response_body);
902902

903903
ddog_trace_exporter_free(exporter);
904-
mock_metrics.assert();
904+
// It should receive 3 payloads: app-started, metrics and app-closing.
905+
mock_metrics.assert_hits(3);
905906
}
906907
}
907908
}

data-pipeline/src/agent_info/fetcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ pub async fn fetch_info_with_state(
3636
current_state_hash: Option<&str>,
3737
) -> Result<FetchInfoStatus> {
3838
let req = info_endpoint
39-
.into_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
39+
.to_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
4040
.method(hyper::Method::GET)
4141
.body(hyper::Body::empty());
4242
let client = hyper::Client::builder().build(Connector::default());

data-pipeline/src/stats_exporter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl StatsExporter {
8686

8787
let mut req_builder = self
8888
.endpoint
89-
.into_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
89+
.to_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
9090
.header(
9191
hyper::header::CONTENT_TYPE,
9292
ddcommon::header::APPLICATION_MSGPACK,

data-pipeline/src/telemetry/mod.rs

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,18 @@ impl TelemetryClient {
169169
self.handle.abort();
170170
}
171171
}
172+
172173
/// Shutdowns the telemetry client.
173-
pub async fn shutdown(&self) {
174+
pub async fn shutdown(self) {
174175
if let Err(_e) = self
175176
.worker
176177
.send_msg(TelemetryActions::Lifecycle(LifecycleAction::Stop))
177178
.await
178179
{
179180
self.handle.abort();
180181
}
182+
183+
let _ = self.handle.await;
181184
}
182185
}
183186

@@ -264,7 +267,6 @@ mod tests {
264267
client.start().await;
265268
let _ = client.send(&data);
266269
client.shutdown().await;
267-
let _ = client.handle.await;
268270
telemetry_srv.assert_hits_async(1).await;
269271
}
270272

@@ -304,7 +306,6 @@ mod tests {
304306
client.start().await;
305307
let _ = client.send(&data);
306308
client.shutdown().await;
307-
let _ = client.handle.await;
308309
telemetry_srv.assert_hits_async(1).await;
309310
}
310311

@@ -344,7 +345,6 @@ mod tests {
344345
client.start().await;
345346
let _ = client.send(&data);
346347
client.shutdown().await;
347-
let _ = client.handle.await;
348348
telemetry_srv.assert_hits_async(1).await;
349349
}
350350

@@ -384,7 +384,6 @@ mod tests {
384384
client.start().await;
385385
let _ = client.send(&data);
386386
client.shutdown().await;
387-
let _ = client.handle.await;
388387
telemetry_srv.assert_hits_async(1).await;
389388
}
390389

@@ -424,7 +423,6 @@ mod tests {
424423
client.start().await;
425424
let _ = client.send(&data);
426425
client.shutdown().await;
427-
let _ = client.handle.await;
428426
telemetry_srv.assert_hits_async(1).await;
429427
}
430428

@@ -464,7 +462,6 @@ mod tests {
464462
client.start().await;
465463
let _ = client.send(&data);
466464
client.shutdown().await;
467-
let _ = client.handle.await;
468465
telemetry_srv.assert_hits_async(1).await;
469466
}
470467

@@ -504,7 +501,6 @@ mod tests {
504501
client.start().await;
505502
let _ = client.send(&data);
506503
client.shutdown().await;
507-
let _ = client.handle.await;
508504
telemetry_srv.assert_hits_async(1).await;
509505
}
510506

@@ -544,7 +540,6 @@ mod tests {
544540
client.start().await;
545541
let _ = client.send(&data);
546542
client.shutdown().await;
547-
let _ = client.handle.await;
548543
telemetry_srv.assert_hits_async(1).await;
549544
}
550545

@@ -577,8 +572,6 @@ mod tests {
577572

578573
client.start().await;
579574
client.shutdown().await;
580-
let _ = client.handle.await;
581-
582575
// Check for 2 hits: app-started and app-closing.
583576
telemetry_srv.assert_hits_async(2).await;
584577
}

ddcommon/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ impl Endpoint {
159159
/// - User agent
160160
/// - Api key
161161
/// - Container Id/Entity Id
162-
pub fn into_request_builder(&self, user_agent: &str) -> anyhow::Result<HttpRequestBuilder> {
162+
pub fn to_request_builder(&self, user_agent: &str) -> anyhow::Result<HttpRequestBuilder> {
163163
let mut builder = hyper::Request::builder()
164164
.uri(self.url.clone())
165165
.header(hyper::header::USER_AGENT, user_agent);

ddtelemetry/src/worker/http_client.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ pub trait HttpClient {
3333

3434
pub fn request_builder(c: &Config) -> anyhow::Result<HttpRequestBuilder> {
3535
match &c.endpoint {
36-
Some(e) => e.into_request_builder(concat!("telemetry/", env!("CARGO_PKG_VERSION"))),
36+
Some(e) => e.to_request_builder(concat!("telemetry/", env!("CARGO_PKG_VERSION"))),
3737
None => Err(anyhow::Error::msg(
3838
"no valid endpoint found, can't build the request".to_string(),
3939
)),

live-debugger/src/sender.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ impl PayloadSender {
150150
url = Uri::from_parts(parts)?;
151151

152152
let mut req = endpoint
153-
.into_request_builder(concat!("Tracer/", env!("CARGO_PKG_VERSION")))?
153+
.to_request_builder(concat!("Tracer/", env!("CARGO_PKG_VERSION")))?
154154
.method(Method::POST)
155155
.uri(url);
156156

profiling/src/exporter/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ impl ProfileExporter {
273273

274274
let builder = self
275275
.endpoint
276-
.into_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))?
276+
.to_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))?
277277
.method(http::Method::POST)
278278
.header("Connection", "close")
279279
.header("DD-EVP-ORIGIN", self.profiling_library_name.as_ref())

remote-config/src/fetch/fetcher.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ impl<S: FileStorage> ConfigFetcher<S> {
304304
let req = self
305305
.state
306306
.endpoint
307-
.into_request_builder(concat!("Sidecar/", env!("CARGO_PKG_VERSION")))?
307+
.to_request_builder(concat!("Sidecar/", env!("CARGO_PKG_VERSION")))?
308308
.method(http::Method::POST)
309309
.header(
310310
http::header::CONTENT_TYPE,

ruby/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ Note: No Ruby needed to run this! It all runs inside docker :)
2929
Note: Publishing new releases to rubygems.org can only be done by Datadog employees.
3030

3131
1. [ ] Locate the new libdatadog release on GitHub: <https://github.com/datadog/libdatadog/releases>
32-
2. [ ] Update the `LIB_VERSION_TO_PACKAGE` and `LIB_GITHUB_RELEASES` sections of the `Rakefile` with the new version
32+
2. [ ] Update the `LIB_GITHUB_RELEASES` section of the `Rakefile` with the hashes from the new version
3333
3. [ ] Update the <lib/libdatadog/version.rb> file with the `LIB_VERSION` and `VERSION` to use
3434
4. [ ] Commit change, open PR, get it merged
3535
5. [ ] Release by running `docker-compose run push_to_rubygems`.

0 commit comments

Comments
 (0)