Skip to content

Add Live Debugger lifetime event budgets#4510

Draft
watson wants to merge 1 commit intowatson/DEBUG-5296/make-limits-configurablefrom
watson/DEBUG-5296/add-lifetime-probe-limits
Draft

Add Live Debugger lifetime event budgets#4510
watson wants to merge 1 commit intowatson/DEBUG-5296/make-limits-configurablefrom
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

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@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 N/A 179.42 KiB N/A N/A N/A
Rum Profiler N/A 6.16 KiB N/A N/A N/A
Rum Recorder N/A 27.03 KiB N/A N/A N/A
Logs N/A 56.80 KiB N/A N/A N/A
Rum Slim N/A 135.26 KiB N/A N/A N/A
Worker N/A 23.63 KiB N/A N/A N/A
🚀 CPU Performance

Pending...

🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
RUM - add global context 32.37 KiB 31.18 KiB -1.19 KiB
RUM - add action 116.65 KiB 110.61 KiB -6.03 KiB
RUM - add timing 32.04 KiB 32.32 KiB +282 B
RUM - add error 96.70 KiB 101.65 KiB +4.95 KiB
RUM - start/stop session replay recording 31.45 KiB 33.19 KiB +1.73 KiB
RUM - start view 497.90 KiB 493.48 KiB -4.42 KiB
Logs - log message 99.16 KiB 106.59 KiB +7.43 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: 81.25%
Overall Coverage: 76.68% (+0.01%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0744137 | 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
Add configurable lifetime budgets for snapshot and non-snapshot probes, and
auto-unregister probes once they exhaust their allowed sends.
@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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant