unbridled-41 opened a new issue, #5457:
URL: https://github.com/apache/rocketmq-dashboard/issues/5457

   ### Studio Version
   branch: `rocketmq-studio` @ `6a68042f` (the revision verified; the branch is 
based on it)
   deployed as: built from source (asset regeneration check)
   
   ### Runtime Environment
   
   Not environment-specific: the defect is in a bundled Grafana dashboard JSON.
   
   ### Connected RocketMQ Cluster
   
   Any cluster with more than one topic: the count grows with the number of 
topics.
   
   ### Describe the Bug
   
   The bundled "RocketMQ Cluster Overview" dashboard renders its **Broker 
Count** stat panel from
   
   ```
   count(rocketmq_messages_in_total{cluster="$cluster"})
   ```
   
   `rocketmq_messages_in_total` carries a `broker` label *and* a `topic` label 
— the same dashboard derives its `$broker` and `$topic` template variables from 
that metric — so `count()` returns the number of broker/topic series. A 
two-broker cluster with 300 topics reports 600 brokers. The neighbouring "Total 
Topics" panel uses the intended idiom, `count(count by (topic) (...))`.
   
   The dashboard is user-facing: `GrafanaDashboardController` lists it, serves 
its JSON and packs the set into `rocketmq-grafana-dashboards.zip`.
   
   ### Steps to Reproduce
   
   1. Open `server/src/main/resources/grafana/rocketmq-overview.json` and read 
the "Broker Count" panel's `expr` (or import the dashboard from the API's zip).
   2. Compare it with the same dashboard's template variables, which read the 
`broker` and `topic` labels from `rocketmq_messages_in_total`.
   
   ### What Did You Expect to See?
   
   A count of distinct brokers in the selected cluster.
   
   ### What Did You See Instead?
   
   A count of broker/topic series, i.e. brokers multiplied by topics.
   
   ### Evidence
   
   - `server/src/main/resources/grafana/rocketmq-overview.json:316`; generator 
`server/scripts/gen_grafana_dashboards.py` (overview panel 6).
   - `cd server/scripts && python3 -m unittest test_gen_grafana_dashboards` — 
the added case fails against the bare `count(...)` and passes against 
`count(count by (broker) (...))`; regenerating all 12 dashboards reproduces the 
checked-in resources byte for byte.
   
   ### Impact
   
   A headline cluster statistic is wrong by orders of magnitude on any 
multi-topic cluster.
   
   ### Acceptance Criteria
   
   - The panel counts distinct brokers.
   - A regression test pins the expression and the assets stay byte-identical 
to the generator's output.
   
   **Corresponding PR:** #5421
   


-- 
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