Interface CircuitBreakerTelemetry
- All Known Implementing Classes:
CircuitBreakerNoopTelemetry$
public interface CircuitBreakerTelemetry
Service Provider Interface (SPI) for collecting metrics from Circuit Breaker.
Implementations must include a single constructor with two arguments: Circuit Breaker id
and ExtendedActorSystem. To setup your implementation, add a setting in your application.conf:
pekko.circuit-breaker.telemetry.implementations += com.example.MyMetrics
-
Method Summary
Modifier and TypeMethodDescriptionvoidInvoked for each call when the future is completed withorg.apache.pekko.pattern.CircuitBreakerOpenExceptionvoidonCallFailure(long elapsedNanos) Invoked for each call when the future is completed with exception, except forscala.concurrent.TimeoutExceptionandpekko.pattern.CircuitBreakerOpenExceptionthat are handled by separate methods.voidonCallSuccess(long elapsedNanos) Invoked for each successful call.voidonCallTimeoutFailure(long elapsedNanos) Invoked for each call when the future is completed withjava.util.concurrent.TimeoutExceptionvoidonClose()Invoked when the circuit breaker transitions to the close state.voidInvoked when the circuit breaker transitions to the half-open state after reset timeout.voidonOpen()Invoked when the circuit breaker transitions to the open state.voidstopped()Called when the circuit breaker is removed, e.g.
-
Method Details
-
onCallBreakerOpenFailure
void onCallBreakerOpenFailure()Invoked for each call when the future is completed withorg.apache.pekko.pattern.CircuitBreakerOpenException -
onCallFailure
void onCallFailure(long elapsedNanos) Invoked for each call when the future is completed with exception, except forscala.concurrent.TimeoutExceptionandpekko.pattern.CircuitBreakerOpenExceptionthat are handled by separate methods.- Parameters:
elapsedNanos- the elapsed duration of the call in nanoseconds
-
onCallSuccess
void onCallSuccess(long elapsedNanos) Invoked for each successful call.- Parameters:
elapsedNanos- the elapsed duration of the call in nanoseconds
-
onCallTimeoutFailure
void onCallTimeoutFailure(long elapsedNanos) Invoked for each call when the future is completed withjava.util.concurrent.TimeoutException- Parameters:
elapsedNanos- the elapsed duration of the call in nanoseconds
-
onClose
void onClose()Invoked when the circuit breaker transitions to the close state. -
onHalfOpen
void onHalfOpen()Invoked when the circuit breaker transitions to the half-open state after reset timeout. -
onOpen
void onOpen()Invoked when the circuit breaker transitions to the open state. -
stopped
void stopped()Called when the circuit breaker is removed, e.g. expired due to inactivity. It is also called if the circuit breaker is re-configured, before callingCircuitBreakerTelemetryProvider.start(java.lang.String, org.apache.pekko.actor.ExtendedActorSystem).
-