根据 5xxErrors 的百分比触发 Istio 断路器

Trigger Istio Circuit Breaker based on % of 5xxErrors

我正在阅读 the documentation for Istio circuit breaker。我看到对于给定的时间间隔,我们可以设置一个 consecutive5xxErrors 的数值(并检查其他一些设置)以使熔断操作生效。

我想知道是否有可能在 Istio 中根据 5xxerrors 与正常连接的百分比以某种方式进行熔断?

根据您已经找到的文档:

如您所见,outlierDetection:

有特定字段
  • consecutiveGatewayErrors
  • consecutive5xxErrors
  • interval
  • baseEjectionTime
  • maxEjectionPercent
  • minHealthPercent

强制请求不命中特定对象的字段是:consecutive5xxErrors

在文档中也可以看到:

Field Type Description Required
consecutive5xxErrors UInt32Value Number of 5xx errors before a host is ejected from the connection pool. When the upstream host is accessed over an opaque TCP connection, connect timeouts, connection error/failure and request failure events qualify as a 5xx error. This feature defaults to 5 but can be disabled by setting the value to 0. No

-- Istio.io: Latest: Docs: Reference: Config: Networking: Destination Rule: Outlier Detection

它的值是固定的,不能用作百分比。


我在 Istio 的 github 页面上找到了功能请求,我认为它引用了您想要的功能 运行:


我想你可以尝试使用 EnvoyFilter 来修改 Envoy 的配置(还没有测试过)因为 Envoy 本身有一些与failures/successes 的百分比。应该对您有帮助的文档: