unbridled-41 opened a new pull request, #5422:
URL: https://github.com/apache/rocketmq-dashboard/pull/5422

   ## Problem / Evidence
   
   The bundled "RocketMQ DLQ & Retry" dashboard 
(`server/src/main/resources/grafana/rocketmq-dlq.json:101`, generated by 
`server/scripts/gen_grafana_dashboards.py:275`) draws its panel **"DLQ Resend 
Count (1m)"** from:
   
   ```
   rate(rocketmq_dlq_resend_count{cluster="$cluster"}[1m])
   ```
   
   The panel is configured with unit `short` and titled as a count over the 
1-minute window, but `rate()` returns the average increase **per second**. The 
rendered number is therefore 60× smaller than the count the title promises: a 
panel reading `3` means 3 resends/second (~180 in the window).
   
   The sibling panel in the same bundle, "Reject Count (1m)", already expresses 
this contract correctly with 
`increase(rocketmq_threadpool_reject_count{cluster="$cluster",broker="$broker"}[1m])`.
   
   User-facing surface: `GrafanaDashboardController` serves the JSON and packs 
the whole set into `rocketmq-grafana-dashboards.zip` for import.
   
   ## Root cause / Fix
   
   `rate()` was used where a windowed count was intended. Fix:
   
   ```
   increase(rocketmq_dlq_resend_count{cluster="$cluster"}[1m])
   ```
   
   Changed in the generator and the checked-in JSON regenerated from it (the 
only line that differs).
   
   ## Priority & scoring
   
   PRIORITY 54 = 影响 16 (a DLQ-operator facing panel understates resend volume 
by 60x) + 波及 8 (one panel in a dashboard shipped to every user who imports the 
bundle) + 可复现 20 (deterministic PromQL semantics) + 维护价值 10.
   
   FIX_CONFIDENCE 88: matches the adjacent panel's established idiom; no title, 
unit, layout or uid change.
   
   ## Tests
   
   ```
   cd server/scripts && python3 -m unittest test_gen_grafana_dashboards
   ```
   
   - Red before the fix: 
`'increase(rocketmq_dlq_resend_count{cluster="$cluster"}[1m])' != 
'rate(rocketmq_dlq_resend_count{cluster="$cluster"}[1m])'`
   - Green after: `Ran 5 tests ... OK`
   - Regenerating all 12 dashboards reproduces the checked-in 
`server/src/main/resources/grafana` directory byte for byte (`diff -rq` clean).
   
   ## Risk
   
   Low. One `expr` string in one panel; panel id, title, unit and layout are 
untouched.


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