chihsuan opened a new pull request, #11445:
URL: https://github.com/apache/ozone/pull/11445

   ## What changes were proposed?
   
   Follow-up to HDDS-16611. `NumSnapshotActive`, `NumSnapshotDeleted` and 
`NumTenants` can go down, but were declared as counters, so Prometheus treats 
every decrease as a counter reset.
   
   This PR:
   - Changes the three metrics in OMMetrics to gauges.
   - Uses `set()` and `decr()` instead of emulating them with `incr(num - 
current)` and `incr(-1)`.
   
   Metric names stay the same; `/prom` now exports them as `gauge` instead of 
`counter`.
   
   `decNumSnapshotDeleted()` is left unchanged since it has no callers and 
#11421 removes it.
   
   ## JIRA
   
   https://issues.apache.org/jira/browse/HDDS-16719
   
   ## How was this patch tested?
   
   https://github.com/chihsuan/ozone/actions/runs/37788493621
   
   - Added `TestOMMetricsSetters#testSnapshotAndTenantCounts`, which fails 
before the change.
   - Updated `TestOmMetrics` to read snapshot counts as gauges.
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to