Skip to content

feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat#1962

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom
glopes/fix-extended-hearbeat
May 8, 2026
Merged

feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat#1962
gh-worker-dd-mergequeue-cf854d[bot] merged 1 commit intomainfrom
glopes/fix-extended-hearbeat

Conversation

@cataphract
Copy link
Copy Markdown
Contributor

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.

How to test the change?

Tested in DataDog/dd-trace-php#3865 . Fixes an integration test and adds a new one to validate the behavior more thoroughly.

@cataphract cataphract requested a review from a team as a code owner May 8, 2026 10:47
@cataphract cataphract force-pushed the glopes/fix-extended-hearbeat branch from aef8944 to c8ebfa9 Compare May 8, 2026 10:48
@cataphract cataphract requested a review from paullegranddc May 8, 2026 10:50
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aef89441ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread libdd-telemetry/src/worker/mod.rs Outdated
Comment on lines +685 to +690
self.data
.dependencies
.removed_flushed(p.dependencies.len());
self.data
.integrations
.removed_flushed(p.integrations.len());
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep startup dependencies in the flush queue

When dependencies or integrations are recorded before Lifecycle(Start), build_app_started() now copies them into the app-started payload and this success path immediately removes them from the unflushed queues. Since build_app_events_batch() only emits app-dependencies-loaded/app-integrations-change for items still marked unflushed, those startup items are never sent under their normal request types after a successful start; agents/backends that rely on those payloads will lose dependency and integration data. The extended-heartbeat resend needs its own payload/success handling instead of draining these queues for AppStarted.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor Author

@cataphract cataphract May 8, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The whole point is to send integrations/deps on app-started rather than the subsequent events.

Also, the last sentence is completely unsubstantiated -- doesn't explain why its own payload/success handling would be needed. Given that the messages have the same shape and AppExtendedHeartbeat literally wraps data::AppStarted, I see no reason why that would be the case.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 8, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/glopes/fix-extended-hearbeat

Summary by Rule

Rule Base Branch PR Branch Change
unwrap_used 14 14 No change (0%)
Total 14 14 No change (0%)

Annotation Counts by File

File Base Branch PR Branch Change
libdd-telemetry/src/worker/mod.rs 14 14 No change (0%)

Annotation Stats by Crate

Crate Base Branch PR Branch Change
clippy-annotation-reporter 5 5 No change (0%)
datadog-ffe-ffi 1 1 No change (0%)
datadog-ipc 21 21 No change (0%)
datadog-live-debugger 6 6 No change (0%)
datadog-live-debugger-ffi 10 10 No change (0%)
datadog-profiling-replayer 4 4 No change (0%)
datadog-remote-config 3 3 No change (0%)
datadog-sidecar 57 57 No change (0%)
libdd-common 10 10 No change (0%)
libdd-common-ffi 12 12 No change (0%)
libdd-data-pipeline 5 5 No change (0%)
libdd-ddsketch 2 2 No change (0%)
libdd-dogstatsd-client 1 1 No change (0%)
libdd-profiling 13 13 No change (0%)
libdd-telemetry 20 20 No change (0%)
libdd-tinybytes 4 4 No change (0%)
libdd-trace-normalization 2 2 No change (0%)
libdd-trace-obfuscation 8 8 No change (0%)
libdd-trace-stats 1 1 No change (0%)
libdd-trace-utils 15 15 No change (0%)
Total 200 200 No change (0%)

About This Report

This report tracks Clippy allow annotations for specific rules, showing how they've changed in this PR. Decreasing the number of these annotations generally improves code quality.

@cataphract cataphract changed the title fix(telemetry): include dependencies and integrations in app-extended-heartbeat feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat May 8, 2026
@cataphract cataphract force-pushed the glopes/fix-extended-hearbeat branch from c8ebfa9 to a918d31 Compare May 8, 2026 11:11
@cataphract cataphract requested review from a team as code owners May 8, 2026 11:11
…-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>
@cataphract cataphract force-pushed the glopes/fix-extended-hearbeat branch from a918d31 to f483992 Compare May 8, 2026 11:12
@codecov-commenter
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 71.68%. Comparing base (4ae8ebe) to head (f483992).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1962      +/-   ##
==========================================
- Coverage   71.79%   71.68%   -0.12%     
==========================================
  Files         434      437       +3     
  Lines       70598    71164     +566     
==========================================
+ Hits        50687    51014     +327     
- Misses      19911    20150     +239     
Components Coverage Δ
libdd-crashtracker 65.16% <ø> (-0.81%) ⬇️
libdd-crashtracker-ffi 37.68% <ø> (+3.58%) ⬆️
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.02% <ø> (-0.23%) ⬇️
libdd-data-pipeline-ffi 72.43% <ø> (-1.50%) ⬇️
libdd-common 79.73% <ø> (+0.15%) ⬆️
libdd-common-ffi 74.41% <ø> (+0.54%) ⬆️
libdd-telemetry 69.37% <100.00%> (+0.10%) ⬆️
libdd-telemetry-ffi 19.37% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.22% <ø> (+1.46%) ⬆️
libdd-profiling 81.57% <ø> (-0.04%) ⬇️
libdd-profiling-ffi 64.51% <ø> (+0.15%) ⬆️
datadog-sidecar 28.85% <ø> (+0.24%) ⬆️
datdog-sidecar-ffi 8.49% <ø> (+1.18%) ⬆️
spawn-worker 54.69% <ø> (ø)
libdd-tinybytes 93.16% <ø> (ø)
libdd-trace-normalization 81.71% <ø> (ø)
libdd-trace-obfuscation 87.26% <ø> (ø)
libdd-trace-protobuf 68.25% <ø> (ø)
libdd-trace-utils 89.27% <ø> (ø)
libdd-tracer-flare 86.88% <ø> (ø)
libdd-log 74.83% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 8, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.51 MB 7.51 MB 0% (0 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 81.47 MB 81.49 MB +.01% (+14.34 KB) 🔍
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 97.62 MB 97.64 MB +.02% (+25.79 KB) 🔍
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.93 MB 9.93 MB +.02% (+2.53 KB) 🔍
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.38 MB 24.37 MB --.02% (-6.00 KB) 💪
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 79.57 KB 79.57 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 179.48 MB 179.44 MB --.02% (-40.00 KB) 💪
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 910.25 MB 910.21 MB -0% (-42.40 KB) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 7.71 MB 7.71 MB +.03% (+2.50 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 79.57 KB 79.57 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.07 MB 23.08 MB +.03% (+8.00 KB) 🔍
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 45.17 MB 45.20 MB +.05% (+27.58 KB) 🔍
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 20.99 MB 20.99 MB --.01% (-3.50 KB) 💪
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 80.81 KB 80.81 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 183.62 MB 183.60 MB --.01% (-24.00 KB) 💪
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 896.28 MB 896.46 MB +.02% (+189.43 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 5.97 MB 5.97 MB +.04% (+3.00 KB) 🔍
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 80.81 KB 80.81 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 24.69 MB 24.71 MB +.06% (+16.00 KB) 🔍
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 42.68 MB 42.70 MB +.05% (+22.90 KB) 🔍
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 72.59 MB 72.61 MB +.02% (+17.30 KB) 🔍
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.37 MB 8.37 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.34 MB 90.36 MB +.02% (+22.54 KB) 🔍
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 9.99 MB 10.00 MB +.05% (+5.96 KB) 🔍

@datadog-datadog-prod-us1-2
Copy link
Copy Markdown

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 71.69% (-0.20%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: f483992 | Docs | Datadog PR Page | Give us feedback!

@cataphract
Copy link
Copy Markdown
Contributor Author

/merge

@gh-worker-devflow-routing-ef8351
Copy link
Copy Markdown

gh-worker-devflow-routing-ef8351 Bot commented May 8, 2026

View all feedbacks in Devflow UI.

2026-05-08 13:47:16 UTC ℹ️ Start processing command /merge


2026-05-08 13:47:21 UTC ℹ️ MergeQueue: pull request added to the queue

The expected merge time in main is approximately 49m (p90).


2026-05-08 14:29:23 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 91fd13c into main May 8, 2026
93 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the glopes/fix-extended-hearbeat branch May 8, 2026 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants