Skip to content

fix: report failed capture-expression evaluations instead of dropping#4043

Draft
p-datadog wants to merge 2 commits into
DataDog:masterfrom
p-datadog:ddsign/capture-expressions-report-errors
Draft

fix: report failed capture-expression evaluations instead of dropping#4043
p-datadog wants to merge 2 commits into
DataDog:masterfrom
p-datadog:ddsign/capture-expressions-report-errors

Conversation

@p-datadog

@p-datadog p-datadog commented Jul 15, 2026

Copy link
Copy Markdown
Member

Motivation

When a capture expression fails to evaluate, we currently drop the error (ddog_evaluation_error_drop(result.error); continue; in dd_log_probe_add_capture_fields), so the customer sees neither a value nor any error signal. Every other tracer surfaces failed capture expressions, and our own metric-probe path already reports value-evaluation errors — this is the one spot that silently omits them.

Change

Replace the drop with dd_submit_probe_eval_error_snapshot(&def->parent.probe, result.error), the same call the metric-probe and template/condition paths use. The loop still continues, so remaining expressions are unaffected.

Test

tests/ext/live-debugger/debugger_capture_expression_error.phpt: a log probe whose capture expression cannot evaluate (getmember on an int) now emits an evaluationErrors entry instead of producing no output. I couldn't run it locally (needs the dev-env request-replayer + built extension; the test SKIPIFs without a dev env) — relying on CI.

Notes

p-ddsign added 2 commits July 15, 2026 15:45
A capture expression that fails to evaluate was silently discarded
(ddog_evaluation_error_drop + continue), so the customer got no key and
no error. Submit the evaluation-error snapshot instead, matching the
metric-probe path and the other tracers, which surface failed capture
expressions rather than omitting them.
Add tests/ext/live-debugger/debugger_capture_expression_error.phpt: a
log probe with a capture expression that cannot evaluate (getmember on
an int) now produces an evaluationErrors entry instead of no output.
@bwoebi

bwoebi commented Jul 16, 2026

Copy link
Copy Markdown
Collaborator

@p-datadog Didn't we want to rate-limit this?

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.

3 participants