Surface LAL drop reason in DSL live-debugging#13937
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR enhances SkyWalking OAP’s DSL live-debugging for LAL by carrying a human-readable “drop reason” through the execution context, debugger samples, REST response, and cluster-forwarding protocol, so operators can see why a step stopped instead of only continueOn=false.
Changes:
- Add
ExecutionContext.dropReason(...)/dropReason()and set it at key LAL drop sites (json/yaml parse failures, regexp non-match, input-type mismatch). - Extend the shared debug
Sample+ cluster proto + REST JSON output to include an optionalreason. - Add/extend tests and feature-case expectations to assert drop-reason propagation, and document the feature in
changes.md.
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| oap-server/server-admin/dsl-debugging/src/main/proto/dsl-debugging-cluster.proto | Adds ClusterSample.reason to forward drop reason across nodes. |
| oap-server/server-admin/dsl-debugging/src/main/java/.../session/Sample.java | Adds optional reason field and includes it in byte-size accounting. |
| oap-server/server-admin/dsl-debugging/src/main/java/.../rest/DSLDebuggingRestHandler.java | Emits reason in REST session sample JSON when present. |
| oap-server/server-admin/dsl-debugging/src/main/java/.../lal/LALDebugRecorderImpl.java | Stamps Sample.reason from ExecutionContext.dropReason() when a step stops. |
| oap-server/server-admin/dsl-debugging/src/main/java/.../cluster/DSLDebuggingClusterServiceImpl.java | Copies Sample.reason into ClusterSample.reason. |
| oap-server/analyzer/log-analyzer/src/test/resources/.../execution-basic.data.yaml | Adds expected dropReason assertions for feature cases. |
| oap-server/analyzer/log-analyzer/src/test/java/.../LALScriptExecutionTest.java | Validates ctx.dropReason() contains expected substrings. |
| oap-server/analyzer/log-analyzer/src/main/java/.../parser/TextParserSpec.java | Records drop reason on regexp non-match. |
| oap-server/analyzer/log-analyzer/src/main/java/.../filter/FilterSpec.java | Records drop reasons for json/yaml parse failures and non-log-body inputs. |
| oap-server/analyzer/log-analyzer/src/main/java/.../dsl/ExecutionContext.java | Introduces KEY_DROP_REASON and accessor/mutator APIs. |
| docs/en/changes/changes.md | Documents the new live-debug drop-reason capability. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
c9927ef to
fa1c9d9
Compare
When a LAL rule stops a log at a parse step, live-debug could only show continueOn=false (that it stopped, never why). Add a human-readable reason: - ExecutionContext.dropReason(String)/dropReason(): set at the LAL drop sites (json/yaml parse failure, text regexp non-match, non-log-body input) in FilterSpec/TextParserSpec. - The shared debug Sample gains an optional reason field (non-final, so the 5-arg constructor and MAL/OAL recorders are unchanged); the LAL recorder stamps it from ctx.dropReason() only when the step stopped (continueOn=false), so the reason lands on the parser step that halted the pipeline. - Reason flows through the dsl-debugging REST session response and the cluster forward proto (ClusterSample.reason) for single-node and cross-node sessions. - Document per-DSL TYPE_* usage inline on Sample. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fa1c9d9 to
cddd354
Compare
wankai123
approved these changes
Jul 3, 2026
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.
Surface the drop reason in LAL live-debugging
When a LAL rule stops a log at a parse step — a
json {}/yaml {}parse failure, atext { regexp }non-match, or a non-log-body input — DSL live-debugging could only showcontinueOn=false(that a step stopped, never why); an operator had to read the OAP server log or the source to find out. This adds a human-readable drop reason to the live-debug capture.How it works
ExecutionContext.dropReason(String)/dropReason()are set at the LAL drop sites inFilterSpec(json/yaml parse failure → the parse exception; non-log-body input → an input-type mismatch message) andTextParserSpec(regexp non-match).Samplegains an optionalreasonfield. It is non-final with a setter, so the shared 5-arg constructor and the MAL / OAL recorders are unchanged (reasonis LAL-populated today, but the field is available to all three DSL debuggers).Sample.reasonfromctx.dropReason()only when the step stopped (continueOn == false), so the reason lands exactly on the parser step that halted the pipeline.dsl-debuggingREST session response (sampleToJson/clusterSampleToJson) and the cluster-forward proto (ClusterSample.reason = 6), so it works for both single-node and peer-forwarded sessions.Sample'sTYPE_*constants now carry inline per-DSL usage comments (INPUT/FUNCTION/OUTPUT = all; FILTER = MAL+OAL; AGGREGATION = OAL only).Testing — the live LAL execution test gains a
dropReasonassertion; the extended feature cases prove ajson {}parse failure, anabortOnFailure falsecontinuation, and atext { regexp }non-match each record the reason (the capturedjsonreason is e.g.json parse failed: com.fasterxml.jackson.core.JsonParseException: Unrecognized token 'plain'…).Follow-up (separate horizon-ui PR): the OAP protocol now carries
reason, but the UI (packages/api-clientSessionSample,LiveDebuggerView.vue) still needs areason?field + rendering to display it.CHANGESlog.🤖 Generated with Claude Code