You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "wu-sheng (via GitHub)" <gi...@apache.org> on 2026/08/06 05:22:53 UTC
[PR] fix(overview): the Metric widget's form no longer sets you up for an empty tile [skywalking-horizon-ui]
wu-sheng opened a new pull request, #113:
URL: https://github.com/apache/skywalking-horizon-ui/pull/113
## The bug
Adding a **Metric** widget — the first kind the composer offers — could render a permanent em dash with nothing to explain it. Three separate reasons, none visible from the form:
| what you see | what actually happens |
| --- | --- |
| MQE placeholder `service_cpm` | in the default **server-side** mode the expression is fired **once with no service entity**, so it must collapse the layer itself. A plain per-service metric matches nothing, and OAP answers with an empty result and **no error**. |
| an **Aggregation** dropdown | `aggregation` is read **only** when the page aggregates — and that mode was gated to `kpi-tile` / `metric-composite`, even though the renderer has always honoured `aggregateOnPage` for `metric`. So the control did nothing. |
| layer **"— any —"**, the default | the renderer skips a data widget with no layer outright (`if (!layer) continue`). |
## The fix
- the aggregation-mode control is offered for `metric` too — the runtime already supported it, only the editor withheld it
- the MQE placeholder follows the chosen mode: `sum(top_n(service_cpm,{{topn}},DES))` server-side, `service_cpm` page-side
- the Aggregation choice appears only in the mode that reads it
- the inert `aggregation: 'avg'` seed is gone from new metric widgets
- **"— any —" is no longer offered** for the three widget types that read metrics; layout and layer-agnostic widgets keep it
## Coverage
`MetricWidget` had no test anywhere — no bundled overview declares one, yet it is the composer's default type.
- **`core`** authors a dashboard of its own, adds a metric widget, sets layer + MQE, saves the local draft, pushes to OAP, waits for the write to become visible, then reads the tile back and asserts **the value**. Asserting the tile's presence would pass on the broken case — the em dash renders the same element.
- **`admin`** asserts the form offers both aggregation modes.
The value assertion lives in `core` because only that fixture has traffic: the admin stack runs no demo app, so a metric there correctly renders nothing. Both specs create their own dashboard rather than editing a bundled one.
## Also
Kind cases name Docker Hub images the way the daemon lists them (`istio/...`, not `docker.io/istio/...`). Spelled with the prefix, infra-e2e's "already present?" check misses an image sitting on the machine and pulls anyway — so a run needed registry reachability it should not need, and failed with Hub down while nothing was missing. Verified by running `istio` to green with Docker Hub unreachable.
## Verification
All six cases run locally against real stacks:
```
core 9/9 browser 3/3 es 3/3
admin 10/10 deployment 4/4 istio 8/8
```
One spec was also corrected along the way: the MESH header can resolve to `istio-ingressgateway` — bookinfo is reached through it, so ALS reports it like any other workload. The peer set (used for the picker and topology assertions) and the set the header may resolve to are now separate.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(overview): the Metric widget's form no longer sets you up for an empty tile [skywalking-horizon-ui]
Posted by "wu-sheng (via GitHub)" <gi...@apache.org>.
wu-sheng merged PR #113:
URL: https://github.com/apache/skywalking-horizon-ui/pull/113
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] fix(overview): the Metric widget's form no longer sets you up for an empty tile [skywalking-horizon-ui]
Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #113:
URL: https://github.com/apache/skywalking-horizon-ui/pull/113#discussion_r3726173578
##########
test/e2e/playwright/specs/admin/overview-metric-widget.spec.ts:
##########
@@ -0,0 +1,44 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import { test, expect } from '../support/diagnostics.js';
+
+// The `metric` widget's aggregation modes — editor behaviour, no data needed.
+//
+// The mode control was gated to kpi-tile / metric-composite, so a `metric`
+// could never reach the page-side path even though the renderer has always
+// honoured it. Authoring-and-rendering lives in `core`, which has traffic;
+// this half belongs here because it asserts the FORM, not a value.
+
+test('the metric widget offers both aggregation modes', async ({ page, pageErrors }) => {
+ await page.goto('/admin/overview-templates');
+ await expect(page.locator('.ot')).toBeVisible({ timeout: 45_000 });
+
+ await page.locator('.ot__pv-grid .ot__cw').first().click();
+ const drawer = page.locator('.ot__drawer, .ot__editor-split').first();
+ await expect(drawer).toBeVisible({ timeout: 45_000 });
Review Comment:
This spec does not ensure the selected widget is actually a `metric` widget. It clicks the first existing cell and then asserts the aggregation-mode radios exist; those radios were already present for `kpi-tile`/`metric-composite`, so the test could pass without ever exercising the new `metric` behavior.
--
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: notifications-unsubscribe@skywalking.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org