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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]