Skip to content

Commit

Permalink
Merge branch 'main' into dsn/crashtracker-many-signals
Browse files Browse the repository at this point in the history
  • Loading branch information
danielsn authored Feb 10, 2025
2 parents ab7383e + 1a7e673 commit d878f4a
Show file tree
Hide file tree
Showing 17 changed files with 528 additions and 535 deletions.
3 changes: 2 additions & 1 deletion data-pipeline-ffi/src/trace_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,8 @@ mod tests {
assert_eq!(response.assume_init().body.to_string_lossy(), response_body);

ddog_trace_exporter_free(exporter);
mock_metrics.assert();
// It should receive 3 payloads: app-started, metrics and app-closing.
mock_metrics.assert_hits(3);
}
}
}
2 changes: 1 addition & 1 deletion data-pipeline/src/agent_info/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub async fn fetch_info_with_state(
current_state_hash: Option<&str>,
) -> Result<FetchInfoStatus> {
let req = info_endpoint
.into_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
.to_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
.method(hyper::Method::GET)
.body(hyper::Body::empty());
let client = hyper::Client::builder().build(Connector::default());
Expand Down
2 changes: 1 addition & 1 deletion data-pipeline/src/stats_exporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ impl StatsExporter {

let mut req_builder = self
.endpoint
.into_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
.to_request_builder(concat!("Libdatadog/", env!("CARGO_PKG_VERSION")))?
.header(
hyper::header::CONTENT_TYPE,
ddcommon::header::APPLICATION_MSGPACK,
Expand Down
15 changes: 4 additions & 11 deletions data-pipeline/src/telemetry/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,18 @@ impl TelemetryClient {
self.handle.abort();
}
}

/// Shutdowns the telemetry client.
pub async fn shutdown(&self) {
pub async fn shutdown(self) {
if let Err(_e) = self
.worker
.send_msg(TelemetryActions::Lifecycle(LifecycleAction::Stop))
.await
{
self.handle.abort();
}

let _ = self.handle.await;
}
}

Expand Down Expand Up @@ -264,7 +267,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -304,7 +306,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -344,7 +345,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -384,7 +384,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -424,7 +423,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -464,7 +462,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -504,7 +501,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -544,7 +540,6 @@ mod tests {
client.start().await;
let _ = client.send(&data);
client.shutdown().await;
let _ = client.handle.await;
telemetry_srv.assert_hits_async(1).await;
}

Expand Down Expand Up @@ -577,8 +572,6 @@ mod tests {

client.start().await;
client.shutdown().await;
let _ = client.handle.await;

// Check for 2 hits: app-started and app-closing.
telemetry_srv.assert_hits_async(2).await;
}
Expand Down
2 changes: 1 addition & 1 deletion ddcommon/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl Endpoint {
/// - User agent
/// - Api key
/// - Container Id/Entity Id
pub fn into_request_builder(&self, user_agent: &str) -> anyhow::Result<HttpRequestBuilder> {
pub fn to_request_builder(&self, user_agent: &str) -> anyhow::Result<HttpRequestBuilder> {
let mut builder = hyper::Request::builder()
.uri(self.url.clone())
.header(hyper::header::USER_AGENT, user_agent);
Expand Down
2 changes: 1 addition & 1 deletion ddtelemetry/src/worker/http_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ pub trait HttpClient {

pub fn request_builder(c: &Config) -> anyhow::Result<HttpRequestBuilder> {
match &c.endpoint {
Some(e) => e.into_request_builder(concat!("telemetry/", env!("CARGO_PKG_VERSION"))),
Some(e) => e.to_request_builder(concat!("telemetry/", env!("CARGO_PKG_VERSION"))),
None => Err(anyhow::Error::msg(
"no valid endpoint found, can't build the request".to_string(),
)),
Expand Down
2 changes: 1 addition & 1 deletion live-debugger/src/sender.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ impl PayloadSender {
url = Uri::from_parts(parts)?;

let mut req = endpoint
.into_request_builder(concat!("Tracer/", env!("CARGO_PKG_VERSION")))?
.to_request_builder(concat!("Tracer/", env!("CARGO_PKG_VERSION")))?
.method(Method::POST)
.uri(url);

Expand Down
2 changes: 1 addition & 1 deletion profiling/src/exporter/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ impl ProfileExporter {

let builder = self
.endpoint
.into_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))?
.to_request_builder(concat!("DDProf/", env!("CARGO_PKG_VERSION")))?
.method(http::Method::POST)
.header("Connection", "close")
.header("DD-EVP-ORIGIN", self.profiling_library_name.as_ref())
Expand Down
2 changes: 1 addition & 1 deletion remote-config/src/fetch/fetcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ impl<S: FileStorage> ConfigFetcher<S> {
let req = self
.state
.endpoint
.into_request_builder(concat!("Sidecar/", env!("CARGO_PKG_VERSION")))?
.to_request_builder(concat!("Sidecar/", env!("CARGO_PKG_VERSION")))?
.method(http::Method::POST)
.header(
http::header::CONTENT_TYPE,
Expand Down
2 changes: 1 addition & 1 deletion ruby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Note: No Ruby needed to run this! It all runs inside docker :)
Note: Publishing new releases to rubygems.org can only be done by Datadog employees.

1. [ ] Locate the new libdatadog release on GitHub: <https://github.com/datadog/libdatadog/releases>
2. [ ] Update the `LIB_VERSION_TO_PACKAGE` and `LIB_GITHUB_RELEASES` sections of the `Rakefile` with the new version
2. [ ] Update the `LIB_GITHUB_RELEASES` section of the `Rakefile` with the hashes from the new version
3. [ ] Update the <lib/libdatadog/version.rb> file with the `LIB_VERSION` and `VERSION` to use
4. [ ] Commit change, open PR, get it merged
5. [ ] Release by running `docker-compose run push_to_rubygems`.
Expand Down
12 changes: 7 additions & 5 deletions ruby/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ require "rubygems/package"

RSpec::Core::RakeTask.new(:spec)

LIB_VERSION_TO_PACKAGE = "14.3.1"
# Note: When packaging rc releases and the like, you may need to set this differently from LIB_VERSION
LIB_VERSION_TO_PACKAGE = Libdatadog::LIB_VERSION

unless LIB_VERSION_TO_PACKAGE.start_with?(Libdatadog::LIB_VERSION)
raise "`LIB_VERSION_TO_PACKAGE` setting in <Rakefile> (#{LIB_VERSION_TO_PACKAGE}) does not match " \
"`LIB_VERSION` setting in <lib/libdatadog/version.rb> (#{Libdatadog::LIB_VERSION})"
Expand All @@ -20,22 +22,22 @@ end
LIB_GITHUB_RELEASES = [
{
file: "libdatadog-aarch64-alpine-linux-musl.tar.gz",
sha256: "57f83aff275628bb1af89c22bb4bd696726daf2a9e09b6cd0d966b29e65a7ad6",
sha256: "54416e4078fa9d923869ecae1a7b32e0c9ae0a47ab8c999812bb3b69cffb85bd",
ruby_platform: "aarch64-linux-musl"
},
{
file: "libdatadog-aarch64-unknown-linux-gnu.tar.gz",
sha256: "36db8d50ccabb71571158ea13835c0f1d05d30b32135385f97c16343cfb6ddd4",
sha256: "ad16283494d565a1877c76d4a8765f789ec2acb70b0597b4efe6e7a20e8b4f97",
ruby_platform: "aarch64-linux"
},
{
file: "libdatadog-x86_64-alpine-linux-musl.tar.gz",
sha256: "2f61fd21cf2f8147743e414b4a8c77250a17be3aecc42a69ffe54f0a603d5c92",
sha256: "384a50bb5013f6098b37da650f0fe9aa7c11f44780da971f8a4a35d2e342f00b",
ruby_platform: "x86_64-linux-musl"
},
{
file: "libdatadog-x86_64-unknown-linux-gnu.tar.gz",
sha256: "f01f05600591063eba4faf388f54c155ab4e6302e5776c7855e3734955f7daf7",
sha256: "6cea4ef4ecd4f40c1c69118bc1bb842c20782b710b838df3917d02eea7575a4e",
ruby_platform: "x86_64-linux"
}
]
Expand Down
2 changes: 1 addition & 1 deletion ruby/lib/libdatadog/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

module Libdatadog
# Current libdatadog version
LIB_VERSION = "14.3.1"
LIB_VERSION = "16.0.1"

GEM_MAJOR_VERSION = "1"
GEM_MINOR_VERSION = "0"
Expand Down
1 change: 1 addition & 0 deletions trace-utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
pub mod config_utils;
pub mod msgpack_decoder;
pub mod send_data;
pub mod send_with_retry;
pub mod stats_utils;
#[cfg(any(test, feature = "test-utils"))]
pub mod test_utils;
Expand Down
Loading

0 comments on commit d878f4a

Please sign in to comment.