Skip to content

⚗️ Add Live Debugger lifetime event budgets#4510

Merged
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
watson/DEBUG-5296/add-lifetime-probe-limits
May 21, 2026
Merged

⚗️ Add Live Debugger lifetime event budgets#4510
gh-worker-dd-mergequeue-cf854d[bot] merged 2 commits into
mainfrom
watson/DEBUG-5296/add-lifetime-probe-limits

Conversation

@watson
Copy link
Copy Markdown
Collaborator

@watson watson commented Apr 21, 2026

Motivation

Add a circuit breaker so a single Live Debugger probe version cannot emit unbounded events over its lifetime.

Changes

Add new DD_DEBUGGER.init() options to configure lifetime budgets for:

  • snapshot probe events
  • non-snapshot probe events

Track emitted events per active probe version in the debugger runtime and automatically unregister probes once they exhaust their configured lifetime budget. Add unit tests covering snapshot and non-snapshot lifetime limits, skipping further collection after exhaustion, and resetting the budget when a new probe version is delivered.

Test instructions

  1. Run yarn test:unit --spec packages/debugger/src/domain/api.spec.ts
  2. In packages/debugger/src/entries/main.ts, verify that DebuggerInitConfiguration exposes:
    • maxSnapshotsPerProbeLifetime
    • maxNonSnapshotsPerProbeLifetime
  3. In packages/debugger/src/domain/probes.ts, verify that initialized probes track:
    • eventsSentInLifetime
    • lifetimeBudgetWarningEmitted
  4. In packages/debugger/src/domain/api.ts, verify that exhausted probes are removed after their final allowed send.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

Copy link
Copy Markdown
Collaborator Author

watson commented Apr 21, 2026

@cit-pr-commenter-54b7da
Copy link
Copy Markdown

cit-pr-commenter-54b7da Bot commented Apr 21, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 169.51 KiB 169.51 KiB 0 B 0.00%
Rum Profiler 5.97 KiB 5.97 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 54.70 KiB 54.70 KiB 0 B 0.00%
Rum Slim 127.85 KiB 127.85 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
RUM - add global context 0.0031 0.0018 -41.94%
RUM - add action 0.0164 0.0101 -38.41%
RUM - add error 0.0137 0.0092 -32.85%
RUM - add timing 0.0007 0.0004 -42.86%
RUM - start view 0.0151 0.0091 -39.74%
RUM - start/stop session replay recording 0.0013 0.0006 -53.85%
Logs - log message 0.0234 0.014 -40.17%
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 38.75 KiB 38.57 KiB -187 B
RUM - add action 64.74 KiB 62.76 KiB -1.98 KiB
RUM - add timing 36.82 KiB 38.06 KiB +1.24 KiB
RUM - add error 70.81 KiB 68.12 KiB -2.69 KiB
RUM - start/stop session replay recording 41.37 KiB 41.91 KiB +557 B
RUM - start view 486.34 KiB 482.09 KiB -4.25 KiB
Logs - log message 55.35 KiB 53.88 KiB -1.47 KiB

🔗 RealWorld

@datadog-official
Copy link
Copy Markdown

datadog-official Bot commented Apr 21, 2026

Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 63.33%
Overall Coverage: 76.89% (-0.06%)

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

@watson watson force-pushed the watson/DEBUG-5296/make-limits-configurable branch from 1f6c9f0 to e48232c Compare April 21, 2026 07:36
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch 2 times, most recently from 5d9fb49 to d1fbe46 Compare April 21, 2026 08:17
@watson watson force-pushed the watson/DEBUG-5296/make-limits-configurable branch 2 times, most recently from d179aeb to a286fdd Compare April 21, 2026 09:13
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch 2 times, most recently from 16abcf5 to 74d9386 Compare April 22, 2026 21:03
@watson watson force-pushed the watson/DEBUG-5296/make-limits-configurable branch from a286fdd to 4253889 Compare April 22, 2026 21:03
@watson watson changed the base branch from watson/DEBUG-5296/make-limits-configurable to graphite-base/4510 April 23, 2026 10:59
@watson watson force-pushed the graphite-base/4510 branch from 4253889 to b730634 Compare April 23, 2026 11:00
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch from 74d9386 to 0744137 Compare April 23, 2026 11:00
@watson watson changed the base branch from graphite-base/4510 to watson/DEBUG-5296/make-limits-configurable April 23, 2026 11:00
@watson watson changed the base branch from watson/DEBUG-5296/make-limits-configurable to graphite-base/4510 May 12, 2026 11:07
@watson watson force-pushed the graphite-base/4510 branch from b730634 to d43971b Compare May 12, 2026 11:44
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch from 0744137 to b1be5d4 Compare May 12, 2026 11:44
@watson watson changed the base branch from graphite-base/4510 to watson/DEBUG-5296/make-limits-configurable May 12, 2026 11:44
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch from b1be5d4 to 07c1e71 Compare May 12, 2026 14:14
@watson watson force-pushed the watson/DEBUG-5296/make-limits-configurable branch from d43971b to 2057d22 Compare May 12, 2026 14:15
Base automatically changed from watson/DEBUG-5296/make-limits-configurable to main May 12, 2026 14:59
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch from 07c1e71 to 95da414 Compare May 12, 2026 15:04
@watson watson marked this pull request as ready for review May 12, 2026 15:04
@watson watson requested review from a team as code owners May 12, 2026 15:05
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: 95da4144b2

ℹ️ 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 packages/debugger/src/domain/api.ts Outdated
Comment thread packages/debugger/src/domain/api.ts Outdated
watson added 2 commits May 12, 2026 17:37
Add configurable lifetime budgets for snapshot and non-snapshot probes, and
auto-unregister probes once they exhaust their allowed sends.
@watson watson force-pushed the watson/DEBUG-5296/add-lifetime-probe-limits branch from 95da414 to b66239c Compare May 13, 2026 04:34
@watson
Copy link
Copy Markdown
Collaborator Author

watson commented May 13, 2026

@codex address that feedback

@chatgpt-codex-connector
Copy link
Copy Markdown

Summary

Testing

  • ⚠️ yarn test:unit --spec packages/debugger/src/domain/api.spec.ts (failed due to environment limitation: ChromeHeadless binary not available; CHROME_BIN not set).

View task →

@watson
Copy link
Copy Markdown
Collaborator Author

watson commented May 13, 2026

Ignore the codex comment above. I didn't mean to ask it to try and fix anything

@watson watson changed the title Add Live Debugger lifetime event budgets ⚗️ Add Live Debugger lifetime event budgets May 21, 2026
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot merged commit 3f15a95 into main May 21, 2026
25 checks passed
@gh-worker-dd-mergequeue-cf854d gh-worker-dd-mergequeue-cf854d Bot deleted the watson/DEBUG-5296/add-lifetime-probe-limits branch May 21, 2026 08:35
@github-actions github-actions Bot locked and limited conversation to collaborators May 21, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants