Skip to content

Commit b412bda

Browse files
libdatadog update to d7b2aad3 [no-ci-feedback]
Automated update by CI pipeline https://gitlab.ddbuild.io/DataDog/apm-reliability/dd-trace-php/-/pipelines/122744890 Full CI result: ❌ 176 job(s) failed
1 parent 27fdbba commit b412bda

3 files changed

Lines changed: 26 additions & 14 deletions

File tree

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: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,9 @@ pub struct RemoteConfigState {
9292
manager: RemoteConfigManager,
9393
live_debugger: LiveDebuggerState,
9494
dynamic_config: DynamicConfig,
95+
/// Service name of the currently tracked `Target`. Tracked here because
96+
/// `libdd_remote_config::Target` no longer exposes its fields publicly.
97+
service: String,
9598
}
9699

97100
#[repr(C)]
@@ -223,6 +226,7 @@ pub unsafe extern "C" fn ddog_init_remote_config_state(
223226
..Default::default()
224227
},
225228
dynamic_config: Default::default(),
229+
service: String::new(),
226230
})
227231
}
228232

@@ -639,13 +643,20 @@ pub extern "C" fn ddog_remote_configs_service_env_change(
639643
tags: &libdd_common_ffi::Vec<Tag>,
640644
process_tags: &libdd_common_ffi::Vec<Tag>,
641645
) -> bool {
642-
let new_target = Target {
643-
service: service.to_utf8_lossy().to_string(),
644-
env: env.to_utf8_lossy().to_string(),
645-
app_version: version.to_utf8_lossy().to_string(),
646-
tags: tags.as_slice().to_vec(),
647-
process_tags: process_tags.as_slice().to_vec(),
648-
};
646+
let service = service.to_utf8_lossy().to_string();
647+
// `Target`'s fields are private; `Target::new` expects `tags`/`process_tags` as
648+
// already-formatted `"key:value"` strings (see libdd-remote-config).
649+
let new_target = Target::new(
650+
service.clone(),
651+
env.to_utf8_lossy().to_string(),
652+
version.to_utf8_lossy().to_string(),
653+
tags.as_slice().iter().map(|t| t.to_string()).collect(),
654+
process_tags.as_slice().iter().map(|t| t.to_string()).collect(),
655+
);
656+
657+
// `Target` no longer exposes its `service` field, so keep track of it ourselves
658+
// for consumers such as `ddog_send_debugger_diagnostics`.
659+
remote_config.service = service;
649660

650661
if let Some(target) = remote_config.manager.get_target() {
651662
if **target == new_target {
@@ -777,12 +788,7 @@ pub unsafe extern "C" fn ddog_send_debugger_diagnostics<'a>(
777788
probe: &'a Probe,
778789
timestamp: u64,
779790
) -> MaybeError {
780-
let service = Cow::Borrowed(
781-
remote_config_state
782-
.manager
783-
.get_target()
784-
.map_or("", |t| t.service.as_str()),
785-
);
791+
let service = Cow::Borrowed(remote_config_state.service.as_str());
786792
let mut payload = ddog_debugger_diagnostics_create_unboxed(
787793
probe,
788794
service,

components-rs/stats.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
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};
13+
use libdd_trace_protobuf::pb;
1314
use libdd_trace_stats::span_concentrator::FixedAggregationKey;
1415
use libdd_common_ffi::slice::{AsBytes, CharSlice};
1516
use std::collections::HashMap;
@@ -148,7 +149,11 @@ 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: if span.is_trace_root {
153+
pb::Trilean::True
154+
} else {
155+
pb::Trilean::False
156+
},
152157
grpc_status_code: extract_grpc_status_code(span),
153158
service_source: char_slice_str(span.service_source),
154159
}

0 commit comments

Comments
 (0)