This is an automated email from the ASF dual-hosted git repository. wu-sheng pushed a commit to branch feat/live-debug-drop-reason in repository https://gitbox.apache.org/repos/asf/skywalking-horizon-ui.git
commit 99dcd7c0453269f81e513234a916c04a7b2640b0 Author: Wu Sheng <[email protected]> AuthorDate: Fri Jul 3 12:20:59 2026 +0800 live-debug: show the LAL drop reason The OAP dsl-debugging session response now carries an optional per-sample 'reason' explaining WHY a LAL step stopped the pipeline (parse failure, non-matching regexp, non-log-body input). Surface it in the live debugger: - api-client: add optional SessionSample.reason. - LalCell: render the reason under the abort marker when present. - DebugLal: pass the sample's reason to the cell. - i18n: add the 'drop reason' label (en + zh-CN). Backward compatible: reason is optional, so an OAP version that does not send it (older dev builds) renders exactly as before — the block only appears when a reason is present. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- .../src/features/operate/live-debug/DebugLal.vue | 1 + .../ui/src/features/operate/live-debug/LalCell.vue | 32 ++++++++++++++++++++++ apps/ui/src/i18n/locales/en.json | 1 + apps/ui/src/i18n/locales/zh-CN.json | 1 + packages/api-client/src/dsl-debugging.ts | 8 +++++- 5 files changed, 42 insertions(+), 1 deletion(-) diff --git a/apps/ui/src/features/operate/live-debug/DebugLal.vue b/apps/ui/src/features/operate/live-debug/DebugLal.vue index 29c7f3f..7398832 100644 --- a/apps/ui/src/features/operate/live-debug/DebugLal.vue +++ b/apps/ui/src/features/operate/live-debug/DebugLal.vue @@ -970,6 +970,7 @@ function recordTitle(view: LalRecordView): string { <LalCell :step-type="step.type" :payload="cellAt(node, step, rv.recIdx)?.payload ?? null" + :reason="cellAt(node, step, rv.recIdx)?.sample.reason ?? null" /> </template> </div> diff --git a/apps/ui/src/features/operate/live-debug/LalCell.vue b/apps/ui/src/features/operate/live-debug/LalCell.vue index b85408f..5a96635 100644 --- a/apps/ui/src/features/operate/live-debug/LalCell.vue +++ b/apps/ui/src/features/operate/live-debug/LalCell.vue @@ -40,6 +40,9 @@ import { const props = defineProps<{ stepType: SampleType; payload: LalSamplePayload | null; + /** Why this step stopped the pipeline (parse failure, non-matching regexp, …), + * or null/undefined when it continued or the OAP version doesn't report it. */ + reason?: string | null; /** When set (the cell popout), body/content shows its complete pretty- * printed value instead of the 80-char dense-matrix preview. */ full?: boolean; @@ -119,6 +122,10 @@ const outputKvs = computed(() => outputEntries(props.payload, props.full)); </div> </template> <div v-if="props.payload?.aborted" class="lal__abort">{{ t('aborted') }}</div> + <div v-if="props.reason" class="lal__reason"> + <span class="lal__reasonlabel">{{ t('drop reason') }}</span> + <span class="lal__reasontext">{{ props.reason }}</span> + </div> </template> <style scoped> @@ -229,4 +236,29 @@ const outputKvs = computed(() => outputEntries(props.payload, props.full)); text-transform: uppercase; letter-spacing: var(--sw-ls-caps); } + +.lal__reason { + display: flex; + flex-direction: column; + gap: 2px; + border-left: 2px solid var(--rr-warn, #d6a96d); + padding-left: 6px; +} + +.lal__reasonlabel { + color: var(--rr-warn, #d6a96d); + font-size: var(--sw-fs-xs); + font-weight: var(--sw-fw-bold); + text-transform: uppercase; + letter-spacing: var(--sw-ls-caps); +} + +.lal__reasontext { + color: var(--rr-ink2); + font-family: var(--rr-font-mono); + font-size: var(--sw-fs-xs); + line-height: 1.4; + word-break: break-all; + white-space: pre-wrap; +} </style> diff --git a/apps/ui/src/i18n/locales/en.json b/apps/ui/src/i18n/locales/en.json index 667ab15..b3e44fa 100644 --- a/apps/ui/src/i18n/locales/en.json +++ b/apps/ui/src/i18n/locales/en.json @@ -335,6 +335,7 @@ "carried": "carried", "+ added": "+ added", "aborted": "aborted", + "drop reason": "drop reason", "file": "file", "select an .oal file…": "select an .oal file…", "metric": "metric", diff --git a/apps/ui/src/i18n/locales/zh-CN.json b/apps/ui/src/i18n/locales/zh-CN.json index a6e736c..716866a 100644 --- a/apps/ui/src/i18n/locales/zh-CN.json +++ b/apps/ui/src/i18n/locales/zh-CN.json @@ -331,6 +331,7 @@ "carried": "继承", "+ added": "+ 新增", "aborted": "已中止", + "drop reason": "丢弃原因", "file": "文件", "select an .oal file…": "选择一个 .oal 文件…", "metric": "指标", diff --git a/packages/api-client/src/dsl-debugging.ts b/packages/api-client/src/dsl-debugging.ts index f40404a..0489786 100644 --- a/packages/api-client/src/dsl-debugging.ts +++ b/packages/api-client/src/dsl-debugging.ts @@ -432,13 +432,19 @@ export type SamplePayload = * - `payload`: per-DSL shape — see the per-DSL types above. * - `sourceLine`: 1-based line number in the rule body. Omitted when * 0 / not applicable (block-level LAL probes, MAL chain stages on - * a one-liner rule). */ + * a one-liner rule). + * - `reason`: human-readable explanation of WHY this step stopped the + * pipeline (a parse exception, a non-matching regexp, an input-type + * mismatch), paired with `continueOn: false`. Optional — LAL-only + * today, and absent from OAP versions before it was added, so the + * UI must treat its absence as "no reason available". */ export interface SessionSample { type: SampleType; sourceText: string; continueOn: boolean; payload: SamplePayload; sourceLine?: number; + reason?: string; } /** Catalog-specific structured rule metadata. The recorder fills in
