Skip to content

Commit aef8944

Browse files
cataphractclaude
andcommitted
fix(telemetry): include dependencies and integrations in app-extended-heartbeat
Per the instrumentation-telemetry-api-docs schema, app-extended-heartbeat must carry the full state — configuration, dependencies, and integrations — so the agent can reconstruct application records on data loss. dd-trace-go and dd-trace-dotnet both ship the full triple. The Rust worker, however, defines AppStarted as a configuration-only struct and reuses it for app-extended-heartbeat, so dependencies and integrations are not included in the heartbeat payload. The ExtendedHeartbeat handler does call unflush_stored() on all three collectors, evidently with the intent of re-emitting the full state. Because the heartbeat payload omits the re-queued dependencies and integrations and app_started_sent_success only pops configurations from unflushed, the re-queued items remain in unflushed and are sent on the next FlushData as a duplicate app-integrations-change / app-dependencies-loaded. Updating the shared AppStarted struct, build_app_started, and app_started_sent_success addresses both Lifecycle(Start) and Lifecycle(ExtendedHeartbeat) call sites. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 4ae8ebe commit aef8944

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

libdd-telemetry/src/data/payloads.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ pub enum ConfigurationOrigin {
4848
#[derive(Serialize, Debug)]
4949
pub struct AppStarted {
5050
pub configuration: Vec<Configuration>,
51+
pub dependencies: Vec<Dependency>,
52+
pub integrations: Vec<Integration>,
5153
}
5254

5355
#[derive(Serialize, Debug)]

libdd-telemetry/src/worker/mod.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,13 +673,21 @@ impl TelemetryWorker {
673673
fn build_app_started(&mut self) -> data::AppStarted {
674674
data::AppStarted {
675675
configuration: self.data.configurations.unflushed().cloned().collect(),
676+
dependencies: self.data.dependencies.unflushed().cloned().collect(),
677+
integrations: self.data.integrations.unflushed().cloned().collect(),
676678
}
677679
}
678680

679681
fn app_started_sent_success(&mut self, p: &data::AppStarted) {
680682
self.data
681683
.configurations
682684
.removed_flushed(p.configuration.len());
685+
self.data
686+
.dependencies
687+
.removed_flushed(p.dependencies.len());
688+
self.data
689+
.integrations
690+
.removed_flushed(p.integrations.len());
683691
}
684692

685693
fn payload_sent_success(&mut self, payload: &data::Payload) {

0 commit comments

Comments
 (0)