Open
Conversation
Contributor
Overall package sizeSelf size: 4.57 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.6 | 81.92 kB | 813.08 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
BenchmarksBenchmark execution time: 2026-02-04 10:08:50 Comparing candidate commit 90ae293 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 226 metrics, 34 unstable metrics. |
Add support for capturing specific expressions in log probes as an alternative to full snapshot capture. This allows users to precisely define which data they want to collect, addressing the 1MB Event Platform payload limit issue. When capture expressions are defined, only those expressions are evaluated and serialized instead of capturing the entire object graph of local variables, arguments, and fields. Each expression can optionally override the default capture limits (depth, collection size, field count, and string length). The implementation distinguishes between transient evaluation errors (like undefined variables) and fatal errors (like protocol failures), allowing some expressions to succeed even when others fail. Fatal errors disable capture expressions for the probe until it's re-applied, preventing repeated failures. Time budget enforcement is respected across all expressions. If the timeout is reached while evaluating expressions, any remaining unevaluated expressions are still included in the snapshot with a notCapturedReason indicating the timeout was exceeded.
ea82eb7 to
90ae293
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7431 +/- ##
=======================================
Coverage 80.40% 80.40%
=======================================
Files 732 732
Lines 31050 31050
=======================================
+ Hits 24965 24966 +1
+ Misses 6085 6084 -1 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

What does this PR do?
This PR implements capture expressions for Live Debugger/Dynamic Instrumentation log probes, providing an alternative to full snapshot capture. Instead of serializing entire object graphs, users can now define specific expressions to capture, giving them precise control over what data gets collected and addressing the 1MB Event Platform payload limit.
Motivation
Log probes currently face a significant limitation: when
captureSnapshot: trueis enabled, the debugger serializes entire object graphs. Even with depth restrictions in place, this approach might hit the 1MB Event Platform limit. The problem becomes frustrating when users need a specific piece of deeply nested data, increasing the capture depth to reach that value inadvertently captures large amounts of uninteresting data from other parts of the object graph.Capture expressions solve this by letting users define exactly which data they need. When
captureExpressionsis defined on a probe, the debugger switches to expression-only mode, evaluating and serializing only the specified expressions. Each expression can optionally override the default capture limits for depth, collection size, field count, and string length, providing fine-grained control over what gets captured.The implementation includes robust error handling that distinguishes between two types of failures. Evaluation errors, like
ReferenceErrorfor undefined variables, are expected JavaScript errors that get reported per-expression while allowing other expressions to continue. Fatal errors, such as protocol failures, indicate something more serious has gone wrong, so the entire capture expressions feature is disabled for that probe until the probe is re-applied, preventing repeated failures on every breakpoint hit.Time budget enforcement remains a critical aspect of the debugger's performance profile: When capture expressions are being evaluated, the timeout applies across all expressions. If the time budget is exceeded, successfully evaluated expressions are included in the snapshot, while remaining unevaluated expressions appear with a
notCapturedReasonfield indicating the timeout was reached. This ensures the snapshot structure remains predictable even when operating under time pressure.Additional Notes