Skip to content

Surface LAL drop reason in DSL live-debugging#13937

Merged
wu-sheng merged 1 commit into
masterfrom
feat/lal-drop-reason
Jul 3, 2026
Merged

Surface LAL drop reason in DSL live-debugging#13937
wu-sheng merged 1 commit into
masterfrom
feat/lal-drop-reason

Conversation

@wu-sheng

@wu-sheng wu-sheng commented Jul 3, 2026

Copy link
Copy Markdown
Member

Surface the drop reason in LAL live-debugging

  • If this is non-trivial feature, paste the links/URLs to the design doc.
  • Update the documentation to include this new feature.
  • Tests(including UT, IT, E2E) are added to verify the new feature.

When a LAL rule stops a log at a parse step — a json {} / yaml {} parse failure, a text { regexp } non-match, or a non-log-body input — DSL live-debugging could only show continueOn=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 in FilterSpec (json/yaml parse failure → the parse exception; non-log-body input → an input-type mismatch message) and TextParserSpec (regexp non-match).
  • The shared debug Sample gains an optional reason field. It is non-final with a setter, so the shared 5-arg constructor and the MAL / OAL recorders are unchanged (reason is LAL-populated today, but the field is available to all three DSL debuggers).
  • The LAL recorder stamps Sample.reason from ctx.dropReason() only when the step stopped (continueOn == false), so the reason lands exactly on the parser step that halted the pipeline.
  • The reason flows through the dsl-debugging REST session response (sampleToJson / clusterSampleToJson) and the cluster-forward proto (ClusterSample.reason = 6), so it works for both single-node and peer-forwarded sessions.
  • Sample's TYPE_* 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 dropReason assertion; the extended feature cases prove a json {} parse failure, an abortOnFailure false continuation, and a text { regexp } non-match each record the reason (the captured json reason 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-client SessionSample, LiveDebuggerView.vue) still needs a reason? field + rendering to display it.

  • If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #.
  • Update the CHANGES log.

🤖 Generated with Claude Code

@wu-sheng wu-sheng requested a review from Copilot July 3, 2026 04:11
@wu-sheng wu-sheng added this to the 11.0.0 milestone Jul 3, 2026
@wu-sheng wu-sheng added backend OAP backend related. enhancement Enhancement on performance or codes labels Jul 3, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 optional reason.
  • 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.

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>
@wu-sheng wu-sheng force-pushed the feat/lal-drop-reason branch from fa1c9d9 to cddd354 Compare July 3, 2026 05:56
@wu-sheng wu-sheng merged commit 585d195 into master Jul 3, 2026
442 of 445 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend OAP backend related. enhancement Enhancement on performance or codes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants