wu-sheng opened a new pull request, #73:
URL: https://github.com/apache/skywalking-horizon-ui/pull/73

   ## Why
   
   When two OAPs share one storage backend, a metric written by one OAP (an 
older version, or a different distribution that doesn't carry the analysis 
rule) is **foreign** to the other: present in shared storage, absent from its 
catalog. Until now Metrics Inspect could only show metrics the connected OAP 
defines, so that data was invisible — you couldn't confirm it was flowing, see 
which entities carry it, or read its value.
   
   ## What
   
   A new **Foreign metric** tab in the **+ add metric** drawer lets an operator 
add a metric the connected OAP doesn't define:
   
   - Enter the metric **name**, **scope**, and the storage **value column** + 
**value type** (read from the catalog of the OAP that *does* define the metric).
   - **Stage several** with **+ add to list** and bulk-add them — board-cap 
aware, through the same counting footer as the catalog tab.
   - Each widget enumerates the metric's entities (`/inspect/entities` with the 
foreign column/type), reconstructs a re-queryable entity from the chosen scope, 
and **plots the value series** via OAP's new `POST /inspect/values` — the 
admin-port counterpart to `execExpression`, which can't evaluate a metric the 
OAP has no local model for.
   - Foreign widgets carry a `FOREIGN` pill, behave like any other widget 
(entity nav, chart-cycle, multi-select), and persist their selection + custom 
entities across reloads.
   
   Tabs were also made clearer (accent-filled active pill instead of a thin 
underline).
   
   **Honest error reporting** for the cross-version case this targets: a 404 on 
`/inspect/values` reports that the OAP build is too old 
(`inspect_values_unsupported`) rather than the misleading "inspect disabled"; 
and OAP's own `{error}` text (a wrong value column, a metric that's actually 
defined locally, an unsupported shape) now reaches the operator instead of a 
bare `HTTP 4xx` — both the BFF mapping and `describeApiError` were fixed. The 
BFF also rejects a SQL-meaningful value column at the edge, matching OAP's 
identifier check.
   
   > Requires an OAP build that exposes `POST /inspect/values` (the 
foreign-values endpoint). Older builds surface the clear 
`inspect_values_unsupported` message above.
   
   ## Validation
   
   - **Live, two-OAP env** (OAP-A defines `meter_inspect_e2e_pool` → OAP-B is 
the foreign reader over shared BanyanDB): read `42` through both `curl → OAP-B 
/inspect/values` and the BFF route; rendered the line chart in-browser 
(headless) for both the drawer-add flow and the persist/hydrate flow; validated 
bulk staging (stage 2 → "2 selected · 2/10 after add" → "Add 2 to board" → 2 
widgets); confirmed MQE evaluates on the endpoint (`meter…*2`→84, 
`latest(…)`→42). The throwaway env has since been torn down, so I can't re-run, 
but the results are reproduced above.
   - **Reviewed** via two adversarial multi-agent passes; 6 confirmed bugs 
found and fixed (foreign-hydrate dropping `selectedIds`/`customEntities`; 
`decodedLabel` rendering `?` for foreign instance/endpoint leaves; absent-API 
mislabel; lost OAP error text; edge `valueColumn` validation).
   - type-check (strict) ✅ · build UI+BFF ✅ · lint ✅ · license headers ✅ · unit 
tests ✅ (incl. 6 new BFF inspect error-mapping tests) · i18n complete across 
all 8 locales ✅ · CHANGELOG + docs updated ✅.
   
   Out of scope (flagged for a separate small PR): four pre-existing BFF routes 
(`/inspect/exec`, template-sync, alarm-rules) mask OAP HTTP status to a blanket 
`502`. All verified low-severity (the real reason already reaches the operator 
via the message text); best aligned with the existing 
`passOapError`/`passInspectError` convention in their own change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to