Skip to main content

Module outlier

Module outlier 

Source
Expand description

Passive health checks via outlier detection.

Tracks error rates on live traffic and automatically ejects unhealthy backends. Unlike the circuit breaker (which uses failure rate over a sliding window), outlier detection triggers on consecutive errors, catching hard-down backends faster. Cross-backend coordination via max_ejection_percent prevents ejecting all backends simultaneously.

§Configuration

[[backends]]
name = "flaky-api"
transport = "http"
url = "http://localhost:8080"

[backends.outlier_detection]
consecutive_errors = 5       # eject after 5 consecutive errors
interval_seconds = 10        # evaluation interval
base_ejection_seconds = 30   # how long to eject
max_ejection_percent = 50    # never eject more than half of backends

Structs§

OutlierDetectionLayer
A Tower Layer that applies outlier detection to a backend.
OutlierDetectionService
Per-backend outlier detection middleware.
OutlierDetector
Shared state tracking ejection status across all backends.