Skip to content

Commit 9becf41

Browse files
libdatadog update to 15899dfe [no-ci-feedback]
Automated update by CI pipeline https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-php/-/pipelines/126697886 Full CI result: ❌ 248 job(s) failed
1 parent 30f5f0f commit 9becf41

4 files changed

Lines changed: 31 additions & 9 deletions

File tree

Cargo.toml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ inherits = "release"
3333
# These are to satistfy the build with libdatadog as a path dependency inside
3434
# components-rs. There may be a better way to fix this, but I'm alreday two
3535
# tasks removed from what I'm trying to do, so pushing forward.
36+
#
37+
# Every dependency that a libdatadog crate inherits via `{ workspace = true }`
38+
# must be declared here, because those crates resolve their workspace
39+
# inheritance against this manifest when built as path dependencies. Keep this
40+
# list in sync with libdatadog's own `[workspace.dependencies]`; libdatadog
41+
# #2253 consolidated `anyhow`, `serde`, `tokio` and `tracing` to the workspace
42+
# level, so they are mirrored here too.
3643
[workspace.dependencies]
44+
anyhow = { version = "1.0", default-features = false }
3745
arc-swap = "1.7.1"
3846
hyper = { version = "1.6", features = [
3947
"http1",
@@ -44,6 +52,9 @@ hyper-util = { version = "0.1.10", features = [
4452
"client",
4553
"client-legacy",
4654
] }
55+
serde = { version = "1.0", default-features = false }
56+
tokio = { version = "1.36", default-features = false }
57+
tracing = { version = "0.1", default-features = false }
4758

4859
[workspace.lints]
4960
# empty for compat with libdatadog

components-rs/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ libdd-data-pipeline = { path = "../libdatadog/libdd-data-pipeline" }
2323
libdd-tinybytes = { path = "../libdatadog/libdd-tinybytes" }
2424
libdd-trace-utils = { path = "../libdatadog/libdd-trace-utils" }
2525
libdd-trace-stats = { path = "../libdatadog/libdd-trace-stats" }
26+
libdd-trace-protobuf = { path = "../libdatadog/libdd-trace-protobuf" }
2627
libdd-crashtracker-ffi = { path = "../libdatadog/libdd-crashtracker-ffi", default-features = false, features = ["collector"] }
2728
libdd-library-config-ffi = { path = "../libdatadog/libdd-library-config-ffi", default-features = false }
2829
spawn_worker = { path = "../libdatadog/spawn_worker" }

components-rs/remote_config.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -650,13 +650,16 @@ pub extern "C" fn ddog_remote_configs_service_env_change(
650650
tags: &libdd_common_ffi::Vec<Tag>,
651651
process_tags: &libdd_common_ffi::Vec<Tag>,
652652
) -> bool {
653-
let new_target = Target {
654-
service: service.to_utf8_lossy().to_string(),
655-
env: env.to_utf8_lossy().to_string(),
656-
app_version: version.to_utf8_lossy().to_string(),
657-
tags: tags.as_slice().to_vec(),
658-
process_tags: process_tags.as_slice().to_vec(),
659-
};
653+
// libdatadog now hides `Target`'s fields and exposes a constructor. `tags`
654+
// and `process_tags` are stored as already-formatted "key:value" strings,
655+
// so convert the incoming `Tag`s via their `Display` impl.
656+
let new_target = Target::new(
657+
service.to_utf8_lossy().to_string(),
658+
env.to_utf8_lossy().to_string(),
659+
version.to_utf8_lossy().to_string(),
660+
tags.as_slice().iter().map(|t| t.to_string()).collect(),
661+
process_tags.as_slice().iter().map(|t| t.to_string()).collect(),
662+
);
660663

661664
if let Some(target) = remote_config.manager.get_target() {
662665
if **target == new_target {
@@ -798,7 +801,7 @@ pub unsafe extern "C" fn ddog_send_debugger_diagnostics<'a>(
798801
remote_config_state
799802
.manager
800803
.get_target()
801-
.map_or("", |t| t.service.as_str()),
804+
.map_or("", |t| t.service()),
802805
);
803806
let mut payload = ddog_debugger_diagnostics_create_unboxed(
804807
probe,

components-rs/stats.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ use crate::trace_filter;
1111
use datadog_ipc::shm_stats::{OwnedShmSpanInput, ShmSpanConcentrator, ShmSpanInput, MAX_PEER_TAGS};
1212
use datadog_sidecar::service::blocking::{add_span_to_concentrator, SidecarTransport};
1313
use libdd_trace_stats::span_concentrator::FixedAggregationKey;
14+
use libdd_trace_protobuf::pb::Trilean;
1415
use libdd_common_ffi::slice::{AsBytes, CharSlice};
1516
use std::collections::HashMap;
1617
use std::ffi::{c_char, c_void};
@@ -148,7 +149,13 @@ fn build_fixed_key<'a>(span: &'a PhpSpanStats<'a>) -> FixedAggregationKey<&'a st
148149
http_endpoint: extract_http_endpoint(span),
149150
http_status_code: extract_http_status_code(span),
150151
is_synthetics_request: is_synthetics_request(span),
151-
is_trace_root: span.is_trace_root,
152+
// `is_trace_root` became a three-valued `Trilean` in libdatadog; the PHP
153+
// side only ever knows true/false, so map the bool onto True/False.
154+
is_trace_root: if span.is_trace_root {
155+
Trilean::True
156+
} else {
157+
Trilean::False
158+
},
152159
grpc_status_code: extract_grpc_status_code(span),
153160
service_source: char_slice_str(span.service_source),
154161
}

0 commit comments

Comments
 (0)