コンテンツにスキップ
Kong Logo | Kong Docs Logo
  • ドキュメント
    • API仕様を確認する
      View all API Specs すべてのAPI仕様を表示 View all API Specs arrow image
    • ドキュメンテーション
      API Specs
      Kong Gateway
      軽量、高速、柔軟なクラウドネイティブAPIゲートウェイ
      Kong Konnect
      SaaSのエンドツーエンド接続のための単一プラットフォーム
      Kong AI Gateway
      GenAI インフラストラクチャ向けマルチ LLM AI Gateway
      Kong Mesh
      Kuma と Envoy をベースにしたエンタープライズサービスメッシュ
      decK
      Kongの構成を宣言型で管理する上で役立ちます
      Kong Ingress Controller
      Kubernetesクラスタ内で動作し、Kongをプロキシトラフィックに設定する
      Kong Gateway Operator
      YAMLマニフェストを使用してKubernetes上のKongデプロイメントを管理する
      Insomnia
      コラボレーティブAPI開発プラットフォーム
  • Plugin Hub
    • Plugin Hubを探索する
      View all plugins すべてのプラグインを表示 View all plugins arrow image
    • 機能性 すべて表示 View all arrow image
      すべてのプラグインを表示
      AI's icon
      AI
      マルチ LLM AI Gatewayプラグインを使用してAIトラフィックを管理、保護、制御する
      認証's icon
      認証
      認証レイヤーでサービスを保護する
      セキュリティ's icon
      セキュリティ
      追加のセキュリティレイヤーでサービスを保護する
      トラフィック制御's icon
      トラフィック制御
      インバウンドおよびアウトバウンドAPIトラフィックの管理、スロットル、制限
      サーバーレス's icon
      サーバーレス
      他のプラグインと組み合わせてサーバーレス関数を呼び出します
      分析と監視's icon
      分析と監視
      APIとマイクロサービストラフィックを視覚化、検査、監視
      変革's icon
      変革
      Kongでリクエストとレスポンスをその場で変換
      ログ記録's icon
      ログ記録
      インフラストラクチャに最適なトランスポートを使用して、リクエストと応答データをログに記録します
  • サポート
  • コミュニティ
  • Kongアカデミー
デモを見る 無料トライアルを開始
Kong Mesh
2.2.x
  • Home icon
  • Kong Mesh
  • Policies
  • Circuit Breaker
report-issue問題を報告する
  • Kong Gateway
  • Kong Konnect
  • Kong Mesh
  • Kong AI Gateway
  • Plugin Hub
  • decK
  • Kong Ingress Controller
  • Kong Gateway Operator
  • Insomnia
  • Kuma

  • ドキュメント投稿ガイドライン
  • 2.10.x (latest)
  • 2.9.x
  • 2.8.x
  • 2.7.x (LTS)
  • 2.6.x
  • 2.5.x
  • 2.4.x
  • 2.3.x
  • 2.2.x
  • Introduction
    • About service meshes
    • Overview of Kong Mesh
    • How Kong Mesh works
    • Architecture
    • Stages of software availability
    • Version support policy
    • Mesh requirements
    • Release notes
  • Getting Started
  • Kong Mesh in Production
    • Overview
    • Deployment topologies
      • Overview
      • Standalone deployment
      • Multi-zone deployment
    • Install kumactl
    • Use Kong Mesh
    • Control plane deployment
      • Kong Mesh license
      • Deploy a standalone control plane
      • Deploy a multi-zone global control plane
      • Zone Ingress
      • Zone Egress
      • Configure zone proxy authentication
      • Control plane configuration reference
      • Systemd
    • Create multiple service meshes in a cluster
    • Data plane configuration
      • Data plane proxy
      • Configure the data plane on Kubernetes
      • Configure the data plane on Universal
      • Configure the Kong Mesh CNI
      • Configure transparent proxying
      • IPv6 support
    • Secure your deployment
      • Manage secrets
      • Authentication with the API server
      • Authentication with the data plane proxy
      • Configure data plane proxy membership
      • Secure access across services
      • Kong Mesh RBAC
      • FIPS support
    • Kong Mesh user interface
    • Upgrades and tuning
      • Upgrade Kong Mesh
      • Performance fine-tuning
  • Deploy
    • Explore Kong Mesh with the Kubernetes demo app
    • Explore Kong Mesh with the Universal demo app
  • Explore
    • Gateway
      • Delegated
      • Builtin
    • CLI
      • kumactl
    • Observability
      • Demo setup
      • Control plane metrics
      • Configuring Prometheus
      • Configuring Grafana
      • Configuring Datadog
      • Observability in multi-zone
    • Inspect API
      • Matched policies
      • Affected data plane proxies
      • Envoy proxy configuration
    • Kubernetes Gateway API
      • Installation
      • Usage
      • TLS termination
      • Customization
      • Multi-mesh
      • Multi-zone
      • How it works
  • Networking
    • Service Discovery
    • DNS
      • How it works
      • Installation
      • Configuration
      • Usage
    • Non-mesh traffic
      • Incoming
      • Outgoing
    • Transparent Proxying
  • Monitor & manage
    • Dataplane Health
      • Circuit Breaker Policy
      • Kubernetes and Universal Service Probes
      • Health Check Policy
    • Control Plane Configuration
      • Modifying the configuration
      • Inspecting the configuration
      • Store
  • Policies
    • Introduction
    • General notes about Kong Mesh policies
    • Applying Policies
    • How Kong Mesh chooses the right policy to apply
    • Understanding TargetRef policies
    • Protocol support in Kong Mesh
    • Mutual TLS
      • Usage of "builtin" CA
      • Usage of "provided" CA
      • Permissive mTLS
      • Certificate Rotation
    • Traffic Permissions
      • Usage
      • Access to External Services
    • Traffic Route
      • Usage
    • Traffic Metrics
      • Expose metrics from data plane proxies
      • Expose metrics from applications
      • Override Prometheus settings per data plane proxy
      • Filter Envoy metrics
      • Secure data plane proxy metrics
    • Traffic Trace
      • Add a tracing backend to the mesh
      • Add TrafficTrace resource
    • Traffic Log
      • Add a logging backend
      • Add a TrafficLog resource
      • Logging external services
      • Builtin Gateway support
      • Access Log Format
    • Locality-aware Load Balancing
      • Enabling locality-aware load balancing
    • Fault Injection
      • Usage
      • Matching
    • Health Check
      • Usage
      • Matching
    • Circuit Breaker
      • Usage
      • Matching
      • Builtin Gateway support
      • Non-mesh traffic
    • External Service
      • Usage
      • Builtin Gateway support
    • Retry
      • Usage
      • Matching
      • Builtin Gateway support
    • Timeout
      • Usage
      • Configuration
      • Default general-purpose Timeout policy
      • Matching
      • Builtin Gateway support
      • Inbound timeouts
      • Non-mesh traffic
    • Rate Limit
      • Usage
      • Matching destinations
      • Builtin Gateway support
    • Virtual Outbound
      • Examples
    • MeshGateway
      • TLS Termination
    • MeshGatewayRoute
      • Listener tags
      • Matching
      • Filters
      • Reference
    • MeshGatewayInstance
    • Service Health Probes
      • Kubernetes
      • Universal probes
    • MeshAccessLog (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshCircuitBreaker (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshFaultInjection (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshHealthCheck (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshHTTPRoute (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
      • Merging
    • MeshProxyPatch (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
      • Merging
    • MeshRateLimit (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshRetry (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTimeout (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTrace (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshTrafficPermission (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • MeshLoadBalancingStrategy (Beta)
      • TargetRef support matrix
      • Configuration
      • Examples
    • OPA policy
    • MeshOPA (beta)
    • MeshGlobalRateLimit (beta)
  • Enterprise Features
    • Overview
    • HashiCorp Vault CA
    • Amazon ACM Private CA
    • cert-manager Private CA
    • OPA policy support
    • MeshOPA (beta)
    • Multi-zone authentication
    • FIPS support
    • Certificate Authority rotation
    • Role-Based Access Control
    • UBI Images
    • Windows Support
    • ECS Support
    • Auditing
    • MeshGlobalRateLimit (beta)
  • Reference
    • HTTP API
    • Kubernetes annotations and labels
    • Kuma data collection
    • Control plane configuration reference
    • Envoy proxy template
  • Community
    • Contribute to Kuma
enterprise-switcher-icon 次に切り替える: OSS
On this pageOn this page
  • Usage
    • interval
    • baseEjectionTime
    • maxEjectionPercent
    • splitExternalAndLocalErrors
    • Detectors
    • Thresholds
  • Matching
  • Builtin Gateway support
  • Non-mesh traffic
  • All policy options

このページは、まだ日本語ではご利用いただけません。翻訳中です。

旧バージョンのドキュメントを参照しています。 最新のドキュメントはこちらをご参照ください。

Circuit Breaker

Circuit Breaker is an outbound policy. Dataplanes whose configuration is modified are in the sources matcher.

This policy will look for errors in the live traffic being exchanged between our data plane proxies and it will mark a data proxy as an unhealthy if certain conditions are met and - by doing so - making sure that no additional traffic can reach an unhealthy data plane proxy until it is healthy again.

Circuit breakers - unlike active Health Checks - do not send additional traffic to our data plane proxies but they rather inspect the existing service traffic. They are also commonly used to prevent cascading failures in our services.

Like a real-world circuit breaker when the circuit is closed then traffic between a source and destination data plane proxy is allowed to freely flow through it, and when it is open then the traffic is interrupted.

The conditions that determine when a circuit breaker is closed or open are being configured in what we call “detectors”. This policy provides 5 different types of detectors and they are triggered on some deviations in the upstream service behavior. All detectors could coexist on the same outbound interface.

Once one of the detectors has been triggered the corresponding data plane proxy is ejected from the set of the load balancer for a period equal to baseEjectionTime. Every further ejection of the same data plane proxy will further extend the baseEjectionTime multiplied by the number of ejections: for example the 4th ejection will be lasting for a period of time of 4 * baseEjectionTime.

Available detectors:

  • Total Errors
  • Gateway Errors
  • Local Errors
  • Standard Deviation
  • Failures

Usage

As usual, we can apply sources and destinations selectors to determine how circuit breakers will be applied across our data plane proxies.

For example:

Kubernetes
Universal
apiVersion: kuma.io/v1alpha1
kind: CircuitBreaker
mesh: default
metadata:
  name: circuit-breaker-example
spec:
  sources:
  - match:
      kuma.io/service: web
  destinations:
  - match:
      kuma.io/service: backend
  conf:
    interval: 5s
    baseEjectionTime: 30s
    maxEjectionPercent: 20
    splitExternalAndLocalErrors: false 
    thresholds:
      maxConnections: 2
      maxPendingRequests: 2
      maxRequests: 2
      maxRetries: 2
    detectors:
      totalErrors: 
        consecutive: 20
      gatewayErrors: 
        consecutive: 10
      localErrors: 
        consecutive: 7
      standardDeviation:
        requestVolume: 10
        minimumHosts: 5
        factor: 1.9
      failure:
        requestVolume: 10
        minimumHosts: 5
        threshold: 85

We will apply the configuration with kubectl apply -f [..].

type: CircuitBreaker
mesh: default
name: circuit-breaker-example
sources:
- match:
    kuma.io/service: web
destinations:
- match:
    kuma.io/service: backend
conf:
  interval: 1s
  baseEjectionTime: 30s
  maxEjectionPercent: 20
  splitExternalAndLocalErrors: false
  thresholds:
    maxConnections: 2
    maxPendingRequests: 2
    maxRequests: 2
    maxRetries: 2
  detectors:
    totalErrors: 
      consecutive: 20
    gatewayErrors: 
      consecutive: 10
    localErrors: 
      consecutive: 7
    standardDeviation:
      requestVolume: 10
      minimumHosts: 5
      factor: 1.9
    failure:
      requestVolume: 10
      minimumHosts: 5
      threshold: 85

We will apply the configuration with kumactl apply -f [..] or via the HTTP API.

The example demonstrates a complete configuration. A CircuitBreaker can also be configured in a simpler way by leveraging the default values of Envoy for any property that is not explicitly defined, for instance:

Kubernetes
Universal
apiVersion: kuma.io/v1alpha1
kind: CircuitBreaker
mesh: default
metadata:
  name: circuit-breaker-example
spec:
  sources:
  - match:
      kuma.io/service: web_default_svc_80
  destinations:
  - match:
      kuma.io/service: backend_default_svc_80
  conf:
    detectors:
      totalErrors: {}
      standardDeviation: {}

We will apply the configuration with kubectl apply -f [..].

type: CircuitBreaker
mesh: default
name: circuit-breaker-example
sources:
- match:
    kuma.io/service: web
destinations:
- match:
    kuma.io/service: backend
conf:
  detectors:
    totalErrors: {}
    standardDeviation: {}

We will apply the configuration with kumactl apply -f [..] or via the HTTP API.

In this example when we get five errors in a row of any type (5 is default Envoy value for totalErrors.consecutive) the data plane proxy will be ejected for 30s the first time, 60s for the second time, and so on.

In the current version of Kong Mesh destinations only supports the service tag.

interval

Time interval between ejection analysis sweeps. Defaults to 10s.

baseEjectionTime

The base time that a data plane proxy is ejected for. The real time is equal to the base time multiplied by the number of times the data plane proxy has been ejected. Defaults to 30s.

maxEjectionPercent

The maximum percent of an upstream Envoy cluster that can be ejected due to outlier detection. Defaults to 10% but will eject at least one data plane proxy regardless of the value.

splitExternalAndLocalErrors

Activates Split Mode.

Split Mode: There are two types of errors that might occur in a circuit breaker:

  • Locally originated: errors triggered locally when estabilishing a connection at the TCP layer (ie: connection refused, connection reset).
  • Externally originated: errors triggered remotely like a 5xx error in the response.

If Split Mode is off, Kong Mesh won’t distinguish errors by their origin and they will be counted together. If Split Mode is on, different parameters can be used to fine tune the detectors. All detectors counts errors according to the state of this parameter.

Detectors

Below is a list of available detectors that can be configured in Kong Mesh.

Total Errors

Errors with status code 5xx and locally originated errors, in Split Mode just errors with status code 5xx.

  • consecutive - how many consecutive errors in a row will trigger the detector. Defaults to 5.

Gateway Errors

Subset of totalErrors related to gateway errors (502, 503 or 504 status code).

  • consecutive - how many consecutive errors in a row will trigger the detector. Defaults to 5.

Local Errors

Taken into account only in Split Mode, number of locally originated errors.

  • consecutive - how many consecutive errors in a row will trigger the detector. Defaults to 5.

Standard Deviation

Detection based on success rate, aggregated from every data plane proxy in the Envoy cluster.

  • requestVolume - ignore data plane proxies with a number of requests less than requestVolume. Defaults to 100.
  • minimumHosts - ignore counting the success rate for an Envoy cluster if the number of data plane proxies with required requestVolume is less than minimumHosts. Defaults to 5.
  • factor - resulting threshold equals to mean - (stdev * factor). Defaults to 1.9.

Failures

Detection based on success rate with an explicit threshold (unlike standardDeviation).

  • requestVolume - ignore data plane proxies with a number of requests less than requestVolume. Defaults to 50.
  • minimumHosts - ignore counting the success rate for an Envoy cluster if the number of data plane proxies with required requestVolume is less than minimumHosts. Defaults to 5.
  • threshold - eject the data plane proxy if its percentage of failures is greater than - or equal to - this value. Defaults to 85.

Thresholds

Alongside the detectors, CircuitBreaker allows configuring thresholds:

  • maxConnections - the maximum number of connections that Envoy will make to the upstream cluster. If not specified, the default is 1024.
  • maxPendingRequests - the maximum number of pending requests that Envoy will allow to the upstream cluster. If not specified, the default is 1024.
  • maxRequests - the maximum number of parallel requests that Envoy will make to the upstream cluster. If not specified, the default is 1024.
  • maxRetries - the maximum number of parallel retries that Envoy will allow to the upstream cluster. If not specified, the default is 3.

Matching

CircuitBreaker is an Outbound Connection Policy. The only supported value for destinations.match is kuma.io/service.

Builtin Gateway support

Circuit Breaker policies are supported on the builtin gateway like any other dataplane.

Non-mesh traffic

When passthrough mode is activated any non-mesh traffic is passing Envoy without applying the CircuitBreaker policies. Read more about Non-mesh traffic.

All policy options

$schema: http://json-schema.org/draft-04/schema#

$ref: #/definitions/CircuitBreaker

definitions

CircuitBreaker

  • ## Circuit Breaker

  • CircuitBreaker defines circuit breaking policy for dataplane's outbound

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • sources
      • List of selectors to match dataplanes that are sources of traffic.
      • Type: array
        • Items
        • $ref: #/definitions/kuma.mesh.v1alpha1.Selector
    • destinations
      • List of selectors to match services that are destinations of traffic.
      • Type: array
        • Items
        • $ref: #/definitions/kuma.mesh.v1alpha1.Selector
    • conf
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf
      • This schema accepts additional properties.
      • Properties kuma.mesh.v1alpha1.CircuitBreaker.Conf
  • ## Conf

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • interval
      • Time interval between ejection analysis sweeps
      • Type: string
      • String format must be a "regex"
      • The value must match this pattern: ^([0-9]+\.?[0-9]*|\.[0-9]+)s$
    • baseEjectionTime
      • The base time that a host is ejected for. The real time is equal to the base time multiplied by the number of times the host has been ejected
      • Type: string
      • String format must be a "regex"
      • The value must match this pattern: ^([0-9]+\.?[0-9]*|\.[0-9]+)s$
    • maxEjectionPercent
      • The maximum percent of an upstream cluster that can be ejected due to outlier detection, has to be in [0 - 100] range
      • Type: integer
    • splitExternalAndLocalErrors
      • Enables Split Mode in which local and external errors are distinguished
      • Type: boolean
    • detectors
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors
      • This schema accepts additional properties.
      • Properties
    • thresholds
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Thresholds
      • This schema accepts additional properties.
      • Properties kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors
  • ## Detectors

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • totalErrors
      • Errors with status code 5xx and locally originated errors, in Split Mode - just errors with status code 5xx
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Errors
      • This schema accepts additional properties.
      • Properties
    • gatewayErrors
      • Subset of 'total' related to gateway errors (502, 503 or 504 status code)
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Errors
      • This schema accepts additional properties.
      • Properties
    • localErrors
      • Takes into account only in Split Mode, number of locally originated errors
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Errors
      • This schema accepts additional properties.
      • Properties
    • standardDeviation
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.StandardDeviation
      • This schema accepts additional properties.
      • Properties
    • failure
      • Type: object
      • $ref: #/definitions/kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Failure
      • This schema accepts additional properties.
      • Properties kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Errors
  • ## Errors

  • Detector based on counting consecutive number of errors

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • consecutive
      • Type: integer kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.Failure
  • ## Failure

  • Detection based on success rate, but threshold is set explicitly (unlike 'standardDeviation')

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • requestVolume
      • Ignore hosts with less number of requests than 'requestVolume'
      • Type: integer
    • minimumHosts
      • Won't count success rate for cluster if number of hosts with required 'requestVolume' is less than 'minimumHosts'
      • Type: integer
    • threshold
      • Eject host if failure percentage of a given host is greater than or equal to this value, has to be in [0 - 100] range
      • Type: integer kuma.mesh.v1alpha1.CircuitBreaker.Conf.Detectors.StandardDeviation
  • ## Standard Deviation

  • Detection based on success rate, aggregated from every host in the cluser

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • requestVolume
      • Ignore hosts with less number of requests than 'requestVolume'
      • Type: integer
    • minimumHosts
      • Won't count success rate for cluster if number of hosts with required 'requestVolume' is less than 'minimumHosts'
      • Type: integer
    • factor
      • *Resulting threshold = mean - (stdev * factor)*
      • Type: number kuma.mesh.v1alpha1.CircuitBreaker.Conf.Thresholds
  • ## Thresholds

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • maxConnections
      • The maximum number of connections that Envoy will make to the upstream cluster. If not specified, the default is 1024.
      • Type: integer
    • maxPendingRequests
      • The maximum number of pending requests that Envoy will allow to the upstream cluster. If not specified, the default is 1024.
      • Type: integer
    • maxRetries
      • The maximum number of parallel retries that Envoy will allow to the upstream cluster. If not specified, the default is 3.
      • Type: integer
    • maxRequests
      • The maximum number of parallel requests that Envoy will make to the upstream cluster. If not specified, the default is 1024.
      • Type: integer kuma.mesh.v1alpha1.Selector
  • ## Selector

  • Selector defines structure for selecting tags for given dataplane

  • Type: object

  • This schema accepts additional properties.

  • Properties

    • match
      • Tags to match, can be used for both source and destinations
      • Type: object
      • This schema accepts additional properties.
      • Properties

Generated with json-schema-md-doc Sun May 11 2025 23:32:40 GMT+0000 (Coordinated Universal Time)

Thank you for your feedback.
Was this page useful?
情報が多すぎる場合 close cta icon
Kong Konnectを使用すると、より多くの機能とより少ないインフラストラクチャを実現できます。月額1Mリクエストが無料。
無料でお試しください
  • Kong
    APIの世界を動かす

    APIマネジメント、サービスメッシュ、イングレスコントローラーの統合プラットフォームにより、開発者の生産性、セキュリティ、パフォーマンスを大幅に向上します。

    • 製品
      • Kong Konnect
      • Kong Gateway Enterprise
      • Kong Gateway
      • Kong Mesh
      • Kong Ingress Controller
      • Kong Insomnia
      • 製品アップデート
      • 始める
    • ドキュメンテーション
      • Kong Konnectドキュメント
      • Kong Gatewayドキュメント
      • Kong Meshドキュメント
      • Kong Insomniaドキュメント
      • Kong Konnect Plugin Hub
    • オープンソース
      • Kong Gateway
      • Kuma
      • Insomnia
      • Kongコミュニティ
    • 会社概要
      • Kongについて
      • お客様
      • キャリア
      • プレス
      • イベント
      • お問い合わせ
  • 利用規約• プライバシー• 信頼とコンプライアンス
© Kong Inc. 2025