You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "Wang1rrr (via GitHub)" <gi...@apache.org> on 2026/09/21 16:35:52 UTC

[I] [Bug] Metrics chart reuses truncated labels as identities for distinct time series [rocketmq-dashboard]

Wang1rrr opened a new issue, #4781:
URL: https://github.com/apache/rocketmq-dashboard/issues/4781

   ### Before Creating the Bug Report
   
   - [x] Searched open/closed issues and reviewed related PR diffs.
   - [x] This concerns RocketMQ Studio.
   - [x] Exact version and reproduction scope are stated below.
   
   ### Studio Version
   
   `rocketmq-studio` at `4c697f07acde460e2344375cb1f82669f5b270fd`.
   
   ### Runtime Environment
   
   Windows, Node.js 22.23.2, existing locked frontend dependencies and Vitest/jsdom.
   The real MetricsExplorer, SVG chart, Ant Design legend Tooltip and series Drawer
   were exercised with synthetic metrics-service responses. Typography overflow geometry
   was supplied because jsdom has no text layout; the real tooltip and label
   transformation were not mocked. No production code was
   changed for the reproduction.
   
   ### Connected RocketMQ Cluster
   
   None. No Prometheus endpoint, Java backend or Broker was used. The observations
   are frontend rendering behavior for valid synthetic series data, not a claim of
   backend data loss.
   
   ### Describe the Bug
   
   `metricSeriesLabel` intentionally formats only the first three sorted labels
   (excluding __name__) for compact display. `MetricChart` then uses this truncated
   string both as React child identity and as the legend's hover tooltip.
   
   Two distinct series that differ only in their fourth label therefore have the
   same child key and indistinguishable legends/tooltips. Complete labels still
   exist in the response and details Drawer; the identity is lost only in the chart
   presentation path.
   
   ### Steps to Reproduce
   
   Supply two scalar series with labels:
   
   ```json
   [
     {"cluster":"prod","job":"rmq","namespace":"ns","pod":"a"},
     {"cluster":"prod","job":"rmq","namespace":"ns","pod":"b"}
   ]
   ```
   
   Give each normal numeric samples with the same timestamps, but different values
   so both polylines are visible. Query them through MetricsExplorer using its
   existing component-test service fixtures.
   
   1. Both legend labels become `cluster=prod / job=rmq / namespace=ns`.
   2. Hover each legend: both tooltips repeat the same short label and omit pod.
   3. React reports duplicate child keys for the polylines and legend entries.
   4. Open series details: complete pod=a and pod=b labels are still present.
   
   Single-variable control: change only the second series' namespace to ns-other.
   Its short label and hover tooltip become distinguishable, and the duplicate-key
   warning disappears.
   
   ### What Did You Expect to See?
   
   Distinct complete label sets should have distinct stable rendering identities.
   Compact visible legends may stay compact, but their hover tooltip should expose
   the full label set so operators can tell the series apart.
   
   ### What Did You See Instead?
   
   The real-component diagnostic observed two polylines in BOTH cases. With the
   fourth-label-only difference it observed two duplicate-key warnings and identical
   legend/hover text; the single-variable namespace control observed no such warning.
   Both cases retained complete labels in the real details Drawer.
   
   No missing curve, stale curve, numeric corruption, export loss or backend label
   loss is claimed. Initial Drawer-selector setup failures were resolved separately
   and are not counted as product evidence.
   
   ### Additional Context
   
   - `web/src/utils/metricsExplorerDiagnostics.ts:146-151` truncates display labels.
   - `web/src/components/MetricsExplorer.tsx:220,256` uses display label plus kind as
     the child keys; line 264 also uses that short label for the tooltip.
   - The existing `stableLabelsText` helper preserves and sorts the full label map,
     including __name__; it can be reused rather than adding another serializer.
   
   The narrow proposed fix separates complete series identity and tooltip content
   from the compact display text, retaining the existing scalar/histogram distinction
   and chart layout. No backend, response schema, dependency or color-policy change
   is needed.
   
   Related #4358 handles float/histogram samples of one series; #4570 changes color
   allocation. Neither fixes identity collisions between different original series
   with identical first-three-label displays. A fix here should not duplicate the
   color change; the shared component may need ordinary rebasing if #4570 lands.
   
   Prepared with AI assistance; confirmed through actual component interactions and
   synthetic service data. No browser/backend/Prometheus E2E is claimed.
   
   ### Are You Willing to Submit a Pull Request?
   
   - [x] Yes, after this issue, with focused regressions and independent review.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Metrics chart reuses truncated labels as identities for distinct time series [rocketmq-dashboard]

Posted by "RockteMQ-AI (via GitHub)" <gi...@apache.org>.
RockteMQ-AI commented on issue #4781:
URL: https://github.com/apache/rocketmq-dashboard/issues/4781#issuecomment-5764509955

   ## Evaluation
   
   **Classification:** Bug (MEDIUM) — Studio MetricsExplorer UI rendering
   
   **Verification:** Code references confirmed against `4c697f0` (current studio master).
   
   - `metricSeriesLabel` in `metricsExplorerDiagnostics.ts:146-154` indeed applies `.slice(0, 3)` after filtering `__name__`, producing a truncated label string.
   - `MetricsExplorer.tsx:220,256,264` uses `series.label` (the truncated string) as:
     1. React `key` for `<polyline>` elements (line 220)
     2. React `key` for legend `<Flex>` entries (line 256)
     3. Tooltip content via `ellipsis={{ tooltip: series.label }}` (line 264)
   
   Two series differing only in the 4th+ label will collide on all three uses.
   
   **Impact:** Operators cannot visually distinguish series that share the first 3 sorted labels. React duplicate-key warnings may also mask real reconciliation issues. No data loss — complete labels remain in the Drawer and raw response.
   
   **Suggested fix direction:**
   1. Use `stableLabelsText(series.labels)` (already exported from the same file) as the React key — it is a full deterministic serialization.
   2. Keep the compact 3-label string for visible legend text, but set the hover tooltip to the full label set (e.g. `stableLabelsText` or a multi-line format of all `key=value` pairs).
   3. This preserves the compact UI while restoring distinct identity and hover detail.
   
   **Priority:** MEDIUM — rendering correctness issue affecting observability in multi-series scenarios.


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Metrics chart reuses truncated labels as identities for distinct time series [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins closed issue #4781: [Bug] Metrics chart reuses truncated labels as identities for distinct time series
URL: https://github.com/apache/rocketmq-dashboard/issues/4781


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Bug] Metrics chart reuses truncated labels as identities for distinct time series [rocketmq-dashboard]

Posted by "lizhimins (via GitHub)" <gi...@apache.org>.
lizhimins commented on issue #4781:
URL: https://github.com/apache/rocketmq-dashboard/issues/4781#issuecomment-5806547790

   Fixed in 4dbdb54cb (#4836) on the `rocketmq-studio` branch.
   
   Closing manually: GitHub only auto-closes an issue when the pull request is merged into the repository's default branch, and `rocketmq-studio` is not it.
   


-- 
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: commits-unsubscribe@rocketmq.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org