feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat#1962
Conversation
aef8944 to
c8ebfa9
Compare
There was a problem hiding this comment.
💡 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".
| self.data | ||
| .dependencies | ||
| .removed_flushed(p.dependencies.len()); | ||
| self.data | ||
| .integrations | ||
| .removed_flushed(p.integrations.len()); |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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.
Clippy Allow Annotation ReportComparing clippy allow annotations between branches:
Summary by Rule
Annotation Counts by File
Annotation Stats by Crate
About This ReportThis 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. |
c8ebfa9 to
a918d31
Compare
…-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>
a918d31 to
f483992
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 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
🚀 New features to boost your workflow:
|
Artifact Size Benchmark Reportaarch64-alpine-linux-musl
aarch64-unknown-linux-gnu
libdatadog-x64-windows
libdatadog-x86-windows
x86_64-alpine-linux-musl
x86_64-unknown-linux-gnu
|
🎉 All green!❄️ No new flaky tests detected 🎯 Code Coverage (details) 🔗 Commit SHA: f483992 | Docs | Datadog PR Page | Give us feedback! |
|
/merge |
|
View all feedbacks in Devflow UI.
The expected merge time in
|
# Release proposal for libdd-telemetry and its dependencies This PR contains version bumps based on public API changes and commits since last release. ## libdd-capabilities **Next version:** `2.0.0` **Semver bump:** `major` **Tag:** `libdd-capabilities-v2.0.0` ### Commits - feat(capablities)!: sleep & spawn capabilities (#1873) ## libdd-common **Next version:** `4.1.0` **Semver bump:** `minor` **Tag:** `libdd-common-v4.1.0` ### Commits - refactor(sampling): move the sampling logic from dd-trace-rs [APMSP-2946] (#1927) - feat!: added regex-lite feature (#1939) - fix(libdd-common): crashes caused by `getenv` while retrieving AAS env vars (#1930) ## libdd-capabilities-impl **Next version:** `2.0.0` **Semver bump:** `major` **Tag:** `libdd-capabilities-impl-v2.0.0` ### Commits - feat(capablities)!: sleep & spawn capabilities (#1873) ## libdd-shared-runtime **Next version:** `1.0.0` **Semver bump:** `major` **Tag:** `libdd-shared-runtime-v1.0.0` **Warning:** this is an initial release. Please verify that the version and commits included are correct. ## libdd-telemetry **Next version:** `5.0.0` **Semver bump:** `major` **Tag:** `libdd-telemetry-v5.0.0` ###⚠️ major bump forced due to: - `libdd-common`: ^3.0.2 → ^4.0.0 ### Commits - fix(libdd-telemetry): restore previous Cargo.toml version (#1993) - feat(capablities)!: sleep & spawn capabilities (#1873) - fix(telemetry): avoid trigger loop in telemetry worker (#1950) - feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat (#1962) - fix(crypto): gate libdd-common TLS features in remaining internal crates + add CI guard (#1943) - fix(telemetry): schedule ExtendedHeartbeat on worker start (#1910) - fix(telemetry): skip sending empty payloads (#1894) - feat(sidecar): wire telemetry_extended_heartbeat_interval through SessionConfig (#1882) - chore(telemetry): add session id support (#1817) - ci(libdd-shared-runtime): downgrade version so publish workflow succeeds (#1870) - feat(runtime)!: add shared runtime (#1602) - perf(sidecar)!: Batch ack sending & consumption (#1835) - fix(telemetry): wire up DD_TELEMETRY_EXTENDED_HEARTBEAT_INTERVAL to scheduler (#1824) - feat(capabilities)!: trait architecture http (#1555) - chore(telemetry): use weaker mem ordering for SEQ_ID (#1749) [APMSP-2946]: https://datadoghq.atlassian.net/browse/APMSP-2946?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
# Release proposal for libdd-data-pipeline and its dependencies This PR contains version bumps based on public API changes and commits since last release. ## libdd-dogstatsd-client **Next version:** `3.0.0` **Semver bump:** `major` **Tag:** `libdd-dogstatsd-client-v3.0.0` ###⚠️ major bump forced due to: - `libdd-common`: ^3.0.2 → ^4.1.0 ### Commits - fix(crypto): gate libdd-common TLS features in remaining internal crates + add CI guard (#1943) ## libdd-trace-obfuscation **Next version:** `3.0.0` **Semver bump:** `major` **Tag:** `libdd-trace-obfuscation-v3.0.0` ###⚠️ major bump forced due to: - `libdd-common`: ^3.0.2 → ^4.1.0 - `libdd-trace-utils`: ^3.0.1 → ^4.0.0 ### Commits - feat!: integrate obfuscation to the stats exporter [APMSP-2764] (#1819) - feat!: added regex-lite feature (#1939) - chore: clippy (#1889) - fix(crypto): gate libdd-common TLS features in obfuscation and capabilities-impl (#1872) - feat(obfuscation)!: feature parity on span obfuscation [APMSP-2671] (#1788) - feat(obfuscation/sql): feature parity on sql obfuscation [APMSP-2667] (#1708) ## libdd-trace-stats **Next version:** `3.0.0` **Semver bump:** `major` **Tag:** `libdd-trace-stats-v3.0.0` ###⚠️ major bump forced due to: - `libdd-trace-utils`: ^3.0.1 → ^4.0.0 ### Commits - perf: pre-compute string messagepack encoding (#1948) - feat!: integrate obfuscation to the stats exporter [APMSP-2764] (#1819) - feat(capablities)!: sleep & spawn capabilities (#1873) - feat: use ip quantization when aggregating peer tags for trace stats (#1944) - fix(crypto): gate libdd-common TLS features in remaining internal crates + add CI guard (#1943) - feat(shared_runtime)!: allow worker to be stopped after fork (#1893) - feat(sidecar)!: Add stats computation via SHM (#1821) - feat(stats): propagate service source from span meta to client stats payload (#1803) - fix(stats): align with css spec (#1790) ## libdd-data-pipeline **Next version:** `4.0.0` **Semver bump:** `major` **Tag:** `libdd-data-pipeline-v4.0.0` ###⚠️ major bump forced due to: - `libdd-common`: ^3.0.2 → ^4.1.0 - `libdd-telemetry`: ^4.0.0 → ^5.0.0 - `libdd-trace-utils`: ^3.0.1 → ^4.0.0 ### Commits - fix(libdd-telemetry): restore previous Cargo.toml version (#1993) - fix(data-pipeline): remove default-features from of trace-obfuscation (#1981) - fix(trace_exporter: shared_runtime): unwrap_or being eager is not good (#1983) - perf: pre-compute string messagepack encoding (#1948) - feat!: integrate obfuscation to the stats exporter [APMSP-2764] (#1819) - feat(capablities)!: sleep & spawn capabilities (#1873) - fix(telemetry): avoid trigger loop in telemetry worker (#1950) - feat(telemetry)!: include dependencies and integrations in app-extended-heartbeat (#1962) - perf(trace-serializer): pre-allocate serialization buffer (#1949) - feat!: added regex-lite feature (#1939) - fix(crypto): gate libdd-common TLS features in remaining internal crates + add CI guard (#1943) - feat(telemetry): add session id support to trace export (#1822) - fix(path): missing bench path in data-pipeline (#1907) - feat(data-pipeline): port dd-trace-rs trace buffer implementation (#1826) - feat(info_fetcher): add timeout to info fetcher (#1890) - feat(shared_runtime)!: allow worker to be stopped after fork (#1893) - feat(sidecar)!: Add stats computation via SHM (#1821) - ci(libdd-shared-runtime): downgrade version so publish workflow succeeds (#1870) - feat(runtime)!: add shared runtime (#1602) - ci: compilation of libdd-data-pipeline to wasm32 (#1830) - feat(capabilities)!: trait architecture http (#1555) - feat(otel): add support for OTLP trace export (#1641) - fix(stats): align with css spec (#1790) --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: iunanua <18325288+iunanua@users.noreply.github.com>
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.