Skip to content

Conversation

ArjunJagdale
Copy link
Contributor

Fixes #2495

This PR ensures that total values stored in the cache metrics collection are never negative.

Specifically:

  • In collect_cache_metrics(), we now clamp the total to max(total, 0) before calling .upsert_one()
  • A warning is logged if a negative value is detected and corrected

While the total originates from get_responses_count_by_kind_status_and_error_code(), this fix guarantees data consistency at the write layer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cache/Queue metrics should not be negative

1 participant