Skip to content

feat(debugger): report condition evaluation errors - #10155

Draft
watson wants to merge 1 commit into
watson/DEBUG-6081/bounded-queuesfrom
watson/DEBUG-6081/evaluation-errors
Draft

feat(debugger): report condition evaluation errors#10155
watson wants to merge 1 commit into
watson/DEBUG-6081/bounded-queuesfrom
watson/DEBUG-6081/evaluation-errors

Conversation

@watson

@watson watson commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

A probe whose condition throws now emits an error-only result (evaluationErrors with the condition DSL and the error message, no captures) instead of being silently treated as "not matched". Error results bypass the rate limits and are throttled instead: after an error the condition is not evaluated again for five minutes and one error result is reported per window.

Motivation

Users had no way to see why a probe with a typo in its condition never fired, and the failing condition was re-evaluated on every hit. Matches the .NET/Python behaviour and the Test_Debugger_Runtime_Condition_Error system tests.

Additional Notes

The sampler records the error on the main thread and flags the sampled index (CONDITION_ERROR_FLAG), so the worker fetches the error from the paused frame instead of capturing. Two diagnostics.spec.js cases that used an undefined variable as a "false" condition were updated.

@github-actions github-actions Bot added semver-minor debugger Dynamic Instrumentation & Live Debugger labels Sep 4, 2026
@dd-octo-sts

dd-octo-sts Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Overall package size

Self size: 8.86 MB
Deduped: 9.52 MB
No deduping: 9.52 MB

Dependency sizes | name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 3.4.0 | 127.33 kB | 447.04 kB | | opentracing | 0.14.7 | 194.81 kB | 194.81 kB | | dc-polyfill | 0.1.11 | 25.74 kB | 25.74 kB |

🤖 This report was automatically generated by heaviest-objects-in-the-universe

@datadog-official

datadog-official Bot commented Sep 4, 2026

Copy link
Copy Markdown

Pipelines  Tests

Unblock PR with BitsAI

⚠️ Warnings

Your PR has failed checks. Please review the issues below and take necessary action before merging.

🚦 5 Pipeline jobs failed

DataDog/apm-reliability/dd-trace-js | benchmark: [24, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-js | benchmark: [26, 1] — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

DataDog/apm-reliability/dd-trace-js | validate_supported_configurations_v2_local_file — 🔧 Needs a code fix, caused by this PR

View more details · View in GitLab

View all 5 failed jobs.

ℹ️ Info

No other issues found (see more)

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 98.05% (+0.00%)

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 2f97506 | Docs | View more details | Give us feedback!

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.46%. Comparing base (f302246) to head (2f97506).

❗ There is a different number of reports uploaded between BASE (f302246) and HEAD (2f97506). Click for more details.

HEAD has 2 uploads less than BASE
Flag BASE (f302246) HEAD (2f97506)
master-coverage 12 11
test-optimization 1 0
Additional details and impacted files
@@                          Coverage Diff                          @@
##           watson/DEBUG-6081/bounded-queues   #10155       +/-   ##
=====================================================================
- Coverage                             98.65%   86.46%   -12.19%     
=====================================================================
  Files                                  1007      997       -10     
  Lines                                157914   153305     -4609     
  Branches                                 74       74               
=====================================================================
- Hits                                 155793   132562    -23231     
- Misses                                 2121    20743    +18622     
Flag Coverage Δ
ai-guard 65.00% <ø> (ø)
apm-capabilities 63.08% <20.65%> (-0.04%) ⬇️
apm-integrations 81.41% <ø> (ø)
appsec 58.71% <ø> (ø)
debugger 70.33% <100.00%> (+0.09%) ⬆️
instrumentation 53.72% <ø> (-0.01%) ⬇️
llmobs 79.00% <ø> (ø)
master-coverage 86.46% <100.00%> (-12.19%) ⬇️
openfeature 66.38% <ø> (ø)
platform 69.31% <ø> (ø)
profiling 66.75% <ø> (ø)
serverless 65.71% <ø> (ø)
test-optimization ?

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 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.

@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch from 5b0dd17 to dad9b24 Compare September 4, 2026 09:54
@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch from dad9b24 to 8b7e432 Compare September 4, 2026 10:24
@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch from 8b7e432 to 8278842 Compare September 4, 2026 12:02
@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch 2 times, most recently from 2d0b3cc to 8f129ba Compare September 4, 2026 15:41
@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch from 8f129ba to 017d35b Compare September 6, 2026 09:05
A probe whose condition threw was silently treated as not matching, so
a broken condition (a typo in a variable name, a member access on an
undefined value, ...) left the user with a probe that never fires and no
explanation. The condition was also evaluated again, and threw again, on
every single hit.

Condition errors are now handled like the other tracers do it: the probe
result carries the error in `evaluationErrors` (with the condition DSL
as `expr` and the error as `message`) and nothing is captured, so the
user can see why the probe is not producing regular results. Error
results bypass the per-probe and global rate limits, and are instead
limited by a per-probe throttle: after an error the condition is not
evaluated again for five minutes, and one error result is reported per
window. This also bounds the cost of a condition that is expensive to
fail.

The probe sampler records the error on the main thread and flags the
sampled probe index, so the worker knows to fetch the error from the
paused frame instead of capturing a snapshot.
@watson
watson force-pushed the watson/DEBUG-6081/evaluation-errors branch from 017d35b to 2f97506 Compare September 7, 2026 10:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

debugger Dynamic Instrumentation & Live Debugger semver-minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant