Count local failures separately from upstream errors
Use splitExternalAndLocalErrors so connection-level problems such as timeouts and resets are detected on their own, rather than being counted alongside the errors a destination returns.
Configuration
apiVersion: kuma.io/v1alpha1
kind: MeshCircuitBreaker
metadata:
name: backend-split-errors
namespace: kong-mesh-demo
labels:
kuma.io/mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
outlierDetection:
interval: 5s
baseEjectionTime: 30s
splitExternalAndLocalErrors: true
detectors:
totalFailures:
consecutive: 10
localOriginFailures:
consecutive: 5
successRate:
minimumHosts: 5
requestVolume: 10
standardDeviationFactor: '1.9'Copied!
type: MeshCircuitBreaker
name: backend-split-errors
mesh: default
spec:
targetRef:
kind: Dataplane
labels:
app: web
to:
- targetRef:
kind: MeshService
labels:
kuma.io/display-name: backend
default:
outlierDetection:
interval: 5s
baseEjectionTime: 30s
splitExternalAndLocalErrors: true
detectors:
totalFailures:
consecutive: 10
localOriginFailures:
consecutive: 5
successRate:
minimumHosts: 5
requestVolume: 10
standardDeviationFactor: '1.9'Copied!
Adjust konnect_mesh_control_plane.my_meshcontrolplane.id and konnect_mesh.my_mesh.name according to your current configuration.
resource "konnect_mesh_circuit_breaker" "backend_split_errors" {
provider = konnect-beta
type = "MeshCircuitBreaker"
name = "backend-split-errors"
spec = {
target_ref = {
kind = "Dataplane"
labels = {
app = "web"
}
}
to = [
{
target_ref = {
kind = "MeshService"
labels = {
"kuma.io/display-name" = "backend"
}
}
default = {
outlier_detection = {
interval = "5s"
base_ejection_time = "30s"
split_external_and_local_errors = true
detectors = {
total_failures = {
consecutive = 10
}
local_origin_failures = {
consecutive = 5
}
success_rate = {
minimum_hosts = 5
request_volume = 10
standard_deviation_factor = { str = "1.9" }
}
}
}
}
}
]
}
labels = {
"kuma.io/mesh" = konnect_mesh.my_mesh.name
}
cp_id = konnect_mesh_control_plane.my_meshcontrolplane.id
mesh = konnect_mesh.my_mesh.name
}
Copied!