semian
semian copied to clipboard
[Draft] use current metrics for adaptive circuit breaker reporting
Use current metrics instead of last window for the error state transition message. This way, we get an up-to-date understanding of the error rate at the moment of transition.
This is also missing last_error_message and error_last_at to be parity with legacy.
On a 100% error rate spike, now prints:
I, [2025-12-07T18:53:39.989926 #98450] INFO -- : [Semian::AdaptiveCircuitBreaker] State transition from closed to open. success_count= error_count= rejected_count= rejection_rate=87.64% error_rate=98.38% ideal_error_rate=1.0% integral=9.7378 name="my_service"