OptionalonFired on every circuit breaker transition, with a short reason on the way to open.
OptionalonFired when a flush group fails => the writes go back in the buffer & are retried, this is your hook to log/count the transient failure.
Whatever the driver threw.
Which group failed & how many keys were in it.
OptionalonFired when buffered writes are lost for good => the buffer overflowed while retrying a failed
group, or close()/shutdown couldn't drain what was left.
How many writes were dropped.
Short description of which of the two happened.
OptionalonFired once each time the buffer crosses its high-water mark (80% of the cap) on the way up => the flush isn't keeping up with incoming writes and the breaker is getting closer to tripping.
Buffered writes at the crossing.
The cap the breaker trips at (BreakerState open).
Optional callbacks the collector fires so an app can observe what the buffer is doing.
Remarks
Hooks are for observability => they're called from the flush path, so keep them cheap & don't throw from them (a throwing hook is caught & logged, it can't take the flush down with it).