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 Type
    Method
    Description
    void
    Invoked for each call when the future is completed with org.apache.pekko.pattern.CircuitBreakerOpenException
    void
    onCallFailure(long elapsedNanos)
    Invoked for each call when the future is completed with exception, except for scala.concurrent.TimeoutException and pekko.pattern.CircuitBreakerOpenException that are handled by separate methods.
    void
    onCallSuccess(long elapsedNanos)
    Invoked for each successful call.
    void
    onCallTimeoutFailure(long elapsedNanos)
    Invoked for each call when the future is completed with java.util.concurrent.TimeoutException
    void
    Invoked when the circuit breaker transitions to the close state.
    void
    Invoked when the circuit breaker transitions to the half-open state after reset timeout.
    void
    Invoked when the circuit breaker transitions to the open state.
    void
    Called when the circuit breaker is removed, e.g.
  • Method Details

    • onCallBreakerOpenFailure

      void onCallBreakerOpenFailure()
      Invoked for each call when the future is completed with org.apache.pekko.pattern.CircuitBreakerOpenException
    • onCallFailure

      void onCallFailure(long elapsedNanos)
      Invoked for each call when the future is completed with exception, except for scala.concurrent.TimeoutException and pekko.pattern.CircuitBreakerOpenException that 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 with java.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 calling CircuitBreakerTelemetryProvider.start(java.lang.String, org.apache.pekko.actor.ExtendedActorSystem).