> For the complete documentation index, see [llms.txt](https://ilogtail.gitbook.io/ilogtail-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ilogtail.gitbook.io/ilogtail-docs/pre-release/plugins/kuo-zhan-cha-jian/ext-request-breaker.md).

# 请求熔断

## 简介

`ext_request_breaker` 扩展插件，实现了 [extensions.RequestInterceptor](https://github.com/alibaba/loongcollector/blob/main/pkg/pipeline/extensions/request_interceptor.go) 接口，课题在 http\_flusher 插件中引用，提供请求熔断的能力。

## 事件能力

列含义见 [概览 · 事件能力列说明](https://ilogtail.gitbook.io/ilogtail-docs/pre-release/plugins/kuo-zhan-cha-jian/pages/V3l051tHPlzCBkmzOfvu#事件能力列说明)。

| v1 接口 | v2 接口 | Log  | Metric | Span |
| ----- | ----- | ---- | ------ | ---- |
| —     | —     | 透传未知 | 透传未知   | 透传未知 |

## 版本

[Alpha](/ilogtail-docs/pre-release/plugins/stability-level.md)

## 版本说明

* 推荐版本：iLogtail v1.5.0 及以上

## 配置参数

| 参数              | 类型    | 是否必选 | 说明                                              |
| --------------- | ----- | ---- | ----------------------------------------------- |
| FailureRatio    | float | 是    | 熔断的阈值，失败的请求在 WindowInSeconds 窗口时间内的失败率，默认值 0.10 |
| WindowInSeconds | int   | 是    | 统计请求成功失败的窗口时间，默认值 10                            |

## 样例

使用 `metric_mock` input 插件生成数据，并将采集结果以 `custom_single` 协议、`json`格式提交到 `http://localhost:8086/write`。

且在flusher处理时，配置熔断策略

```yaml
enable: true
version: v2
inputs:
  - Type: metric_mock
    GroupMeta:
      meta1: meta1
    GroupTags:
      tag1: tag1
  - Type: metric_mock
    GroupMeta:
      meta2: meta2
    GroupTags:
      tag2: tag2
flushers:
  - Type: flusher_http
    RemoteURL: "http://localhost:8086/write"
    Convert:
      Protocol: custom_single
      Encoding: json
    RequestInterceptors: 
      - Type: ext_request_breaker
        FailureRatio: 0.1
        WindowInSeconds: 10
extensions:
  - Type: ext_groupinfo_filter
    Tags:
      tag1: tag1
```
