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

   ## Problem
   
   Studio-native alert aggregation reads historical samples from 
`MetricSnapshotRepository.findRecent(...)` using `windowSeconds`, while 
`CollectorScheduler` deletes samples older than the configured 
`studio.alerting.snapshot-retention` (default `PT24H`). Alert rule create and 
update currently validate only that `windowSeconds` is non-negative.
   
   A native rule can therefore request a window longer than the retained 
history. For example, a 48-hour AVG rule with the default 24-hour retention is 
accepted but is silently evaluated from an incomplete sample set, which can 
produce misleading thresholds and alerts.
   
   ## Expected behavior
   
   - When `snapshot-retention` is positive, native alert rules must reject 
`windowSeconds` values longer than the configured retention.
   - A window equal to the retention remains valid.
   - `windowSeconds=0` keeps the current single-sample behavior.
   - Non-native Prometheus rules are not constrained by the native snapshot 
store.
   - Non-positive retention keeps the existing cleanup-disabled behavior and 
does not impose a window cap.
   - Create, update, and import use the same write-path validation.
   
   ## Acceptance criteria
   
   - Reject an oversized native window with HTTP/business code 400 before 
repository mutation.
   - Apply the same check to create and update.
   - Add focused coverage for oversized, equal-boundary, non-native, and 
cleanup-disabled cases.
   - Do not change snapshot collection, retention cleanup, or aggregation math.
   
   ## Scope
   
   This change validates writes against the currently configured retention. 
Migration or runtime reporting for rules created under an older, longer 
retention configuration is separate operational work.


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