Skip to content

fix(telemetry): avoid trigger loop in telemetry worker#1950

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
vianney/avoid-trigger-loops
May 11, 2026
Merged

fix(telemetry): avoid trigger loop in telemetry worker#1950
gh-worker-dd-mergequeue-cf854d[bot] merged 4 commits into
mainfrom
vianney/avoid-trigger-loops

Conversation

@VianneyRuhlmann
Copy link
Copy Markdown
Contributor

@VianneyRuhlmann VianneyRuhlmann commented May 6, 2026

What does this PR do?

When dropping the telemetry handle, the telemetry worker triggers Lifecycle(Stop) without sleeping. This fixes the issue by parking the task as pending.

Motivation

What inspired you to submit this pull request?

Additional Notes

This has a risk of "leaking" the worker in the sense that it won't be dropped until the runtime is dropped or the worker is shutdown through the handle. To make this explicit to the user we marked the handle as must_use.

How to test the change?

Describe here in detail how the change can be validated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 6, 2026

Clippy Allow Annotation Report

Comparing clippy allow annotations between branches:

  • Base Branch: origin/main
  • PR Branch: origin/vianney/avoid-trigger-loops

Summary by Rule

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

Annotation Counts by File

File Base Branch PR Branch Change
libdd-data-pipeline/src/trace_buffer/mod.rs 1 1 No change (0%)
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 13 13 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 203 203 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.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 6, 2026

Codecov Report

❌ Patch coverage is 98.24561% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 72.62%. Comparing base (91fd13c) to head (7c356a6).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1950      +/-   ##
==========================================
- Coverage   72.63%   72.62%   -0.01%     
==========================================
  Files         448      448              
  Lines       73582    73631      +49     
==========================================
+ Hits        53444    53477      +33     
- Misses      20138    20154      +16     
Components Coverage Δ
libdd-crashtracker 65.04% <ø> (-0.05%) ⬇️
libdd-crashtracker-ffi 36.82% <ø> (ø)
libdd-alloc 98.77% <ø> (ø)
libdd-data-pipeline 86.58% <100.00%> (ø)
libdd-data-pipeline-ffi 75.64% <ø> (ø)
libdd-common 79.81% <ø> (ø)
libdd-common-ffi 74.41% <ø> (ø)
libdd-telemetry 69.86% <97.95%> (+0.49%) ⬆️
libdd-telemetry-ffi 19.37% <ø> (ø)
libdd-dogstatsd-client 82.64% <ø> (ø)
datadog-ipc 76.22% <ø> (ø)
libdd-profiling 81.58% <ø> (+0.01%) ⬆️
libdd-profiling-ffi 64.51% <ø> (ø)
libdd-sampling 97.25% <ø> (ø)
datadog-sidecar 29.82% <ø> (-0.02%) ⬇️
datdog-sidecar-ffi 13.22% <ø> (ø)
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.

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

datadog-prod-us1-5 Bot commented May 6, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 98.25%
Overall Coverage: 72.63% (-0.00%)

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

@dd-octo-sts
Copy link
Copy Markdown
Contributor

dd-octo-sts Bot commented May 6, 2026

Artifact Size Benchmark Report

aarch64-alpine-linux-musl
Artifact Baseline Commit Change
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.so 7.57 MB 7.57 MB +0% (+24 B) 👌
/aarch64-alpine-linux-musl/lib/libdatadog_profiling.a 81.66 MB 81.67 MB +0% (+3.67 KB) 👌
aarch64-unknown-linux-gnu
Artifact Baseline Commit Change
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.01 MB 10.01 MB +0% (+544 B) 👌
/aarch64-unknown-linux-gnu/lib/libdatadog_profiling.a 97.84 MB 97.84 MB +0% (+3.79 KB) 👌
libdatadog-x64-windows
Artifact Baseline Commit Change
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.dll 24.40 MB 24.40 MB +0% (+1.50 KB) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.lib 79.87 KB 79.87 KB 0% (0 B) 👌
/libdatadog-x64-windows/debug/dynamic/datadog_profiling_ffi.pdb 179.62 MB 179.64 MB +0% (+16.00 KB) 👌
/libdatadog-x64-windows/debug/static/datadog_profiling_ffi.lib 910.67 MB 910.84 MB +.01% (+178.36 KB) 🔍
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.dll 7.71 MB 7.71 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.lib 79.87 KB 79.87 KB 0% (0 B) 👌
/libdatadog-x64-windows/release/dynamic/datadog_profiling_ffi.pdb 23.11 MB 23.11 MB 0% (0 B) 👌
/libdatadog-x64-windows/release/static/datadog_profiling_ffi.lib 45.25 MB 45.25 MB +0% (+2.27 KB) 👌
libdatadog-x86-windows
Artifact Baseline Commit Change
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.dll 21.02 MB 21.02 MB +0% (+1.50 KB) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.lib 81.11 KB 81.11 KB 0% (0 B) 👌
/libdatadog-x86-windows/debug/dynamic/datadog_profiling_ffi.pdb 183.74 MB 183.76 MB +0% (+16.00 KB) 👌
/libdatadog-x86-windows/debug/static/datadog_profiling_ffi.lib 896.93 MB 896.94 MB +0% (+8.80 KB) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.dll 5.98 MB 5.98 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.lib 81.11 KB 81.11 KB 0% (0 B) 👌
/libdatadog-x86-windows/release/dynamic/datadog_profiling_ffi.pdb 24.74 MB 24.74 MB 0% (0 B) 👌
/libdatadog-x86-windows/release/static/datadog_profiling_ffi.lib 42.75 MB 42.75 MB +0% (+2.14 KB) 👌
x86_64-alpine-linux-musl
Artifact Baseline Commit Change
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.a 72.78 MB 72.78 MB +0% (+3.44 KB) 👌
/x86_64-alpine-linux-musl/lib/libdatadog_profiling.so 8.41 MB 8.41 MB 0% (0 B) 👌
x86_64-unknown-linux-gnu
Artifact Baseline Commit Change
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.a 90.53 MB 90.53 MB +0% (+3.60 KB) 👌
/x86_64-unknown-linux-gnu/lib/libdatadog_profiling.so 10.03 MB 10.03 MB +.04% (+4.42 KB) 🔍

@VianneyRuhlmann VianneyRuhlmann marked this pull request as ready for review May 7, 2026 12:50
@VianneyRuhlmann VianneyRuhlmann requested review from a team as code owners May 7, 2026 12:50
@VianneyRuhlmann
Copy link
Copy Markdown
Contributor Author

/merge

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

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

View all feedbacks in Devflow UI.

2026-05-11 10:27:41 UTC ℹ️ Start processing command /merge


2026-05-11 10:27:50 UTC ℹ️ MergeQueue: waiting for PR to be ready

This pull request is not mergeable according to GitHub. Common reasons include pending required checks, missing approvals, or merge conflicts — but it could also be blocked by other repository rules or settings.
It will be added to the queue as soon as checks pass and/or get approvals. View in MergeQueue UI.
Note: if you pushed new commits since the last approval, you may need additional approval.
You can remove it from the waiting list with /remove command.


2026-05-11 12:03:14 UTC ℹ️ MergeQueue: merge request added to the queue

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


2026-05-11 12:45:03 UTC ℹ️ MergeQueue: This merge request was merged

@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 7a24f53 into main May 11, 2026
103 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the vianney/avoid-trigger-loops branch May 11, 2026 12:44
iunanua added a commit that referenced this pull request May 15, 2026
# 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>
iunanua added a commit that referenced this pull request May 18, 2026
# 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>
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