You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by "yyqdbngt (via GitHub)" <gi...@apache.org> on 2026/09/21 06:04:14 UTC
[PR] fix(metrics): report an unavailable consumer delay without a timestamp [rocketmq-dashboard]
yyqdbngt opened a new pull request, #4675:
URL: https://github.com/apache/rocketmq-dashboard/pull/4675
<!-- Base branch: `rocketmq-studio`, the RocketMQ Studio trunk. -->
### Brief Description
`ApacheRocketMqBusinessMetricsCollector` skipped the `consumer.delay.seconds` sample entirely
when the broker reported consume stats without a consumed-message timestamp:
```java
if (group.isConsumptionTimestampAvailable()) {
samples.add(delaySample(instance, group, collectedAt));
}
// no else: the delay metric simply disappears for that group
```
The same collector already treats that state as unavailable everywhere else - the
`!group.isConsumeStatsAvailable()` branch right above emits `CONSUMER_DELAY_SECONDS` as
`UNAVAILABLE` with `CONSUMER_STATS_UNAVAILABLE`, and an unknown lag sentinel is reported as
unavailable rather than as a fabricated zero.
The omission is the consequential representation: `CONSUMER_DELAY_SECONDS` is part of the
collector's declared metric scope, and `NativeAlertProcessor.reconcileMissingActiveStates`
walks the active states of that scope and resolves every fingerprint that no collected sample
covers. A group whose broker stops reporting the consumed-message timestamp therefore had its
active `consumer.delay.seconds` alert resolved - including a resolution notification - even
though its delay was merely unknown.
The collector now emits the delay as `UNAVAILABLE` with the reason
`CONSUMER_TIMESTAMP_UNAVAILABLE`, keeping the group's cluster scope like the other per-group
samples.
### How Did You Test This Change?
The new case runs against the unmodified trunk first (red), then against the fix (green).
```
# on the unmodified base (new test copied in, production code untouched)
$ cd server && mvn -B -ntp test -Dtest=ApacheRocketMqBusinessMetricsCollectorTest
[ERROR] Tests run: 7, Failures: 1, Errors: 0, Skipped: 0 -- in ...ApacheRocketMqBusinessMetricsCollectorTest
[ERROR] ApacheRocketMqBusinessMetricsCollectorTest.reportsUnavailableDelayWhenTheConsumptionTimestampIsMissingTest:168
Expected size: 1 but was: 0 in:
```
```
# with the fix
$ cd server && mvn -B -ntp test -Dtest=ApacheRocketMqBusinessMetricsCollectorTest,CloudRocketMqBusinessMetricsCollectorTest,CollectorSchedulerTest
[INFO] --- checkstyle:3.6.0:check (validate) @ rocketmq-studio ---
[INFO] You have 0 Checkstyle violations.
[INFO] Tests run: 7, Failures: 0, Errors: 0, Skipped: 0 -- in ...ApacheRocketMqBusinessMetricsCollectorTest
[INFO] Tests run: 21, Failures: 0, Errors: 0, Skipped: 0
[INFO] BUILD SUCCESS
```
The open PR #4517 changes the neighbouring availability handling of the same collector
(`consumer.lag.max_queue`, `topic.backlog.total` for unknown queue progress) but explicitly
leaves the delay semantics unchanged; this change is the delay counterpart and touches only the
`isConsumptionTimestampAvailable()` branch plus its own helper.
### Checklist
- [x] One coherent change; unrelated modifications are not bundled in
- [x] Commit subject follows Conventional Commits (`feat:` / `fix:` / `refactor:` / `chore:` / `docs:` / `perf:`)
- [x] Tests added or updated for non-trivial changes, test methods named `...Test`
- [x] New UI text has both Chinese and English entries under `web/src/i18n/`
- [x] Architecture constraints stay green (`mvn test` runs the ArchUnit checks)
- [x] New source files carry the ASF license header
- [x] Documentation touched where behaviour changed (README / `docs/` / in-app help)
--
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: [PR] fix(metrics): report an unavailable consumer delay without a timestamp [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on PR #4675:
URL: https://github.com/apache/rocketmq-dashboard/pull/4675#issuecomment-5963527769
This pull request has been automatically closed because there has been no activity for 7 days. If you would like to continue working on this, please reopen the PR with updated changes.
--
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: [PR] fix(metrics): report an unavailable consumer delay without a timestamp [rocketmq-dashboard]
Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed pull request #4675: fix(metrics): report an unavailable consumer delay without a timestamp
URL: https://github.com/apache/rocketmq-dashboard/pull/4675
--
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