Sentinel fault-tolerance middleware component

Use Sentinel middleware to guarantee the reliability and resiliency of your application

Sentinel is a powerful fault-tolerance component that takes “flow” as the breakthrough point and covers multiple fields including flow control, traffic shaping, concurrency limiting, circuit breaking, and adaptive system protection to guarantee the reliability and resiliency of microservices.

The Sentinel HTTP middleware enables Dapr to facilitate Sentinel’s powerful abilities to protect your application. You can refer to Sentinel Wiki for more details on Sentinel.

Component format

In the following definition, the maximum requests per second are set to 10:

kind: Component
  name: sentinel
  type: middleware.http.sentinel
  version: v1
  - name: appName
    value: "nodeapp"
  - name: logDir
    value: "/var/tmp"
  - name: flowRules
    value: >-
          "resource": "POST:/v1.0/invoke/nodeapp/method/neworder",
          "threshold": 10,
          "tokenCalculateStrategy": 0,
          "controlBehavior": 0

Spec metadata fields

Field Details Example
appName the name of current running service nodeapp
logDir the log directory path /var/tmp/sentinel
flowRules json array of sentinel flow control rules flow control rule
circuitBreakerRules json array of sentinel circuit breaker rules circuit breaker rule
hotSpotParamRules json array of sentinel hotspot parameter flow control rules hotspot rule
isolationRules json array of sentinel isolation rules isolation rule
systemRules json array of sentinel system rules system rule

Once the limit is reached, the request will return HTTP Status code 429: Too Many Requests.

Special note to resource field in each rule’s definition. In Dapr, it follows the following format:


All concrete HTTP API information can be found from [Dapr API Reference] In the above sample config, the resource field is set to POST:/v1.0/invoke/nodeapp/method/neworder.

Dapr configuration

To be applied, the middleware must be referenced in configuration. See middleware pipelines.

kind: Configuration
  name: daprConfig
      - name: sentinel
        type: middleware.http.sentinel

Last modified July 19, 2024: Fixed typo in links (#4267) (32fce1d)