You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shenyu.apache.org by sa...@apache.org on 2021/09/01 08:16:39 UTC
[incubator-shenyu-website] branch main updated: add SPI en and zh
doc. (#215)
This is an automated email from the ASF dual-hosted git repository.
sabersola pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-shenyu-website.git
The following commit(s) were added to refs/heads/main by this push:
new ea5d97a add SPI en and zh doc. (#215)
ea5d97a is described below
commit ea5d97ab0fae12aaf3518a1b9b5910fb826a0d5b
Author: ttttangzhen <28...@qq.com>
AuthorDate: Wed Sep 1 16:16:33 2021 +0800
add SPI en and zh doc. (#215)
* add SPI document.
* add SPI document.
* add SPI document.
* add SPI document.
* add SPI document.
* update SPI document img.
* revert old version
* revert old version
* revert old version
---
docs/developer/spi/custom-condition-match.md | 2 +-
docs/developer/spi/custom-load-balance.md | 80 +++++++++++++++++
docs/developer/spi/custom-metrics-monitor.md | 55 ++++++++++++
docs/developer/spi/custom-rate-limiter.md | 96 ++++++++++++++++++++
.../developer/spi/custom-condition-match.md | 2 +-
.../developer/spi/custom-load-balance.md | 79 +++++++++++++++++
.../developer/spi/custom-metrics-monitor.md | 55 ++++++++++++
.../developer/spi/custom-rate-limiter.md | 97 +++++++++++++++++++++
.../img/shenyu/custom/custom-load-balance-en.jpg | Bin 0 -> 109321 bytes
.../img/shenyu/custom/custom-load-balance-zh.jpg | Bin 0 -> 107533 bytes
.../img/shenyu/custom/custom-rate-limiter-en.jpg | Bin 0 -> 143305 bytes
.../img/shenyu/custom/custom-rate-limiter-zh.jpg | Bin 0 -> 146635 bytes
.../developer/spi/custom-condition-match.md | 2 +-
.../developer/spi/custom-load-balance.md | 80 +++++++++++++++++
.../developer/spi/custom-metrics-monitor.md | 55 ++++++++++++
.../developer/spi/custom-rate-limiter.md | 96 ++++++++++++++++++++
16 files changed, 696 insertions(+), 3 deletions(-)
diff --git a/docs/developer/spi/custom-condition-match.md b/docs/developer/spi/custom-condition-match.md
index a95c087..0973fcc 100644
--- a/docs/developer/spi/custom-condition-match.md
+++ b/docs/developer/spi/custom-condition-match.md
@@ -35,7 +35,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
-<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%" height="30%" />
+<img src="/static/img/shenyu/custom/custom-condition-match-en.png" width="40%" height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/docs/developer/spi/custom-load-balance.md b/docs/developer/spi/custom-load-balance.md
new file mode 100644
index 0000000..3f412ae
--- /dev/null
+++ b/docs/developer/spi/custom-load-balance.md
@@ -0,0 +1,80 @@
+---
+title: Custom Load Balance
+keywords: ["LoadBalance"]
+description: Custom Load Balance
+---
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom).
+
+* This article describes how to customize the extension of `org.apache.shenyu.plugin.divide.balance.LoadBalance` .
+
+## Extension
+
+* Create a new class `${you class}`, implements `org.apache.shenyu.plugin.divide.balance.LoadBalance`
+
+```java
+public class ${you class} implements LoadBalance {
+
+ /**
+ * select one from upstream list.
+ *
+ * @param upstreamList upstream list
+ * @param ip ip
+ * @return divide upstream
+ */
+ @Override
+ public DivideUpstream doSelect(final List<DivideUpstream> upstreamList,
+ final String ip) {
+ //coding and return
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.divide.balance.LoadBalance`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `LOAD_BALANCE`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-load-balance-en.jpg" width="40%" height="30%" />
+
+* Or execute the following custom `SQL` statement:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+
+
diff --git a/docs/developer/spi/custom-metrics-monitor.md b/docs/developer/spi/custom-metrics-monitor.md
new file mode 100644
index 0000000..d02db1f
--- /dev/null
+++ b/docs/developer/spi/custom-metrics-monitor.md
@@ -0,0 +1,55 @@
+---
+title: Custom Metrics Monitor
+keywords: ["MetricsMonitor"]
+description: custom Metrics Monitor
+---
+
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom)
+
+* This article describes how to customize the extension of `org.apache.shenyu.metrics.spi.MetricsBootService`.
+
+## Extension
+
+* Create a new class `${you class}`,implements `org.apache.shenyu.metrics.spi.MetricsBootService`
+
+```
+public class ${you class} implements MetricsBootService {
+
+ /**
+ * Start metrics tracker.
+ *
+ * @param metricsConfig metrics config
+ * @param metricsRegister the metrics register
+ */
+ public void start(MetricsConfig metricsConfig, MetricsRegister metricsRegister){
+ //your code
+ }
+
+ /**
+ * Stop metrics tracker.
+ */
+ public void stop() {
+ //your code
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.metrics.spi.MetricsBootService`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Plugin , Find the `Monitor` plugin, edit config, pay attention to the `metricsName` name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%" height="30%" />
+
+
+
+
+
+
diff --git a/docs/developer/spi/custom-rate-limiter.md b/docs/developer/spi/custom-rate-limiter.md
new file mode 100644
index 0000000..ba0c21e
--- /dev/null
+++ b/docs/developer/spi/custom-rate-limiter.md
@@ -0,0 +1,96 @@
+---
+title: Custom Rate Limiter
+keywords: ["RateLimiter"]
+description: Custom Rate Limiter
+---
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom).
+
+* This article describes how to customize the extension of `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm` .
+
+## Extension
+
+* Create a new class `${you class}`, implements `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`
+
+```java
+public class ${you class} implements RateLimiterAlgorithm<T> {
+
+ /**
+ * Gets script.
+ *
+ * @return the script
+ */
+ public RedisScript<T> getScript() {
+ //coding and return
+ }
+
+ /**
+ * Gets keys.
+ *
+ * @param id the id
+ * @return the keys
+ */
+ public List<String> getKeys(String id) {
+ //coding and return
+ }
+
+ /**
+ * Callback string.
+ *
+ * @param script the script
+ * @param keys the keys
+ * @param scriptArgs the script args
+ */
+ public void callback(final RedisScript<?> script, final List<String> keys, final List<String> scriptArgs) {
+ //coding and return
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `ALGORITHM_*`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%" height="30%" />
+
+* Or execute the following custom `SQL` statement:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
index 864dac4..517111c 100644
--- a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-condition-match.md
@@ -34,7 +34,7 @@ ${you spi name} = ${you class path}
* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `MATCH_MODE`,新增一条数据,注意字典名称要为: `${you spi name}`。
-<img src="/img/shenyu/custom/custom-condition-match-zh.png" width="40%" height="30%" />
+<img src="/static/img/shenyu/custom/custom-condition-match-zh.png" width="40%" height="30%" />
* 或者执行以下自定义`SQL`语句:
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
new file mode 100644
index 0000000..dfeba56
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-load-balance.md
@@ -0,0 +1,79 @@
+---
+title: 自定义负载均衡策略
+description: 自定义负载均衡策略
+---
+
+
+## 说明
+
+* 在自定义开发前,请先自定义搭建好网关环境,请参考: [自定义部署](../../deployment/deployment-custom)
+
+* 本文介绍如何对 `org.apache.shenyu.plugin.divide.balance.LoadBalance` 进行自定义扩展。
+
+## 扩展实现
+
+* 新增一个类 `${you class}`,实现 `org.apache.shenyu.plugin.divide.balance.LoadBalance`
+
+```java
+public class ${you class} implements LoadBalance {
+
+ /**
+ * 从上游列表中选择一个服务返回
+ *
+ * @param upstreamList 上游列表
+ * @param ip 请求的远程地址
+ * @return divide upstream
+ */
+ @Override
+ public DivideUpstream doSelect(final List<DivideUpstream> upstreamList,
+ final String ip) {
+ //开发你的选择逻辑,返回结果
+ }
+}
+```
+
+* 在项目 `resources` 目录下,新建 `META-INF/shenyu` 目录, 并且新增文件名为 : `org.apache.shenyu.plugin.divide.balance.LoadBalance`.
+内容新增 `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `LOAD_BALANCE`,新增一条数据,注意字典名称要为: `${you spi name}`。
+
+<img src="/static/img/shenyu/custom/custom-load-balance-zh.jpg" width="40%" height="30%" />
+
+* 或者执行以下自定义`SQL`语句:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
new file mode 100644
index 0000000..b25042c
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
@@ -0,0 +1,55 @@
+---
+title: 自定义指标监控
+description: 自定义指标监控
+---
+
+
+## 说明
+
+* 在自定义开发前,请先自定义搭建好网关环境,请参考: [自定义部署](../../deployment/deployment-custom)
+
+* 本文介绍如何对 `org.apache.shenyu.metrics.spi.MetricsBootService` 进行自定义扩展。
+
+## 扩展实现
+
+* 新增一个类 `${you class}`,实现 `org.apache.shenyu.metrics.spi.MetricsBootService`
+
+```java
+public class ${you class} implements MetricsBootService {
+
+ /**
+ * Start metrics tracker.
+ *
+ * @param metricsConfig metrics config
+ * @param metricsRegister the metrics register
+ */
+ public void start(MetricsConfig metricsConfig, MetricsRegister metricsRegister){
+ //自定义监控逻辑
+ }
+
+ /**
+ * Stop metrics tracker.
+ */
+ public void stop() {
+ //自定义关闭逻辑
+ }
+}
+```
+
+* 在项目 `resources` 目录下,新建 `META-INF/shenyu` 目录, 并且新增文件名为 : `org.apache.shenyu.metrics.spi.MetricsBootService`.
+内容新增 `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* 在 `Admin` 后台 ---> 基础管理 ---> 插件管理 , 找到 `Monitor` 插件,编辑插件信息,注意``metricsName要为: `${you spi name}`。
+<img src="/static/img/shenyu/custom/custom-metrics-monitor-zh.jpg" width="40%" height="30%" />
+
+
+
+
+
+
+
+
diff --git a/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
new file mode 100644
index 0000000..c1a43ce
--- /dev/null
+++ b/i18n/zh/docusaurus-plugin-content-docs/version-2.4.0/developer/spi/custom-rate-limiter.md
@@ -0,0 +1,97 @@
+---
+title: 自定义限流策略
+description: 自定义限流策略
+---
+
+
+## 说明
+
+* 在自定义开发前,请先自定义搭建好网关环境,请参考: [自定义部署](../../deployment/deployment-custom)
+
+* 本文介绍如何对 `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm` 进行自定义扩展。
+
+## 扩展实现
+
+* 新增一个类 `${you class}`,实现 `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`
+
+```java
+public class ${you class} implements RateLimiterAlgorithm<T> {
+
+ /**
+ * Gets script.
+ *
+ * @return the script
+ */
+ public RedisScript<T> getScript() {
+ //你的开发逻辑
+ }
+
+ /**
+ * Gets keys.
+ *
+ * @param id the id
+ * @return the keys
+ */
+ public List<String> getKeys(String id) {
+ //你的开发逻辑
+ }
+ /**
+ * Callback string.
+ *
+ * @param script the script
+ * @param keys the keys
+ * @param scriptArgs the script args
+ */
+ default void callback(final RedisScript<?> script, final List<String> keys, final List<String> scriptArgs) {
+ //你的开发逻辑
+ }
+}
+```
+
+* 在项目 `resources` 目录下,新建 `META-INF/shenyu` 目录, 并且新增文件名为 : `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`.
+内容新增 `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* 在 `Admin` 后台 ---> 基础管理 ---> 字典管理 , 找到字典编码为 `ALGORITHM_*`,新增一条数据,注意字典名称要为: `${you spi name}`。
+
+<img src="/static/img/shenyu/custom/custom-rate-limiter-zh.jpg" width="40%" height="30%" />
+
+* 或者执行以下自定义`SQL`语句:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+
+
+
diff --git a/static/img/shenyu/custom/custom-load-balance-en.jpg b/static/img/shenyu/custom/custom-load-balance-en.jpg
new file mode 100644
index 0000000..3a5c698
Binary files /dev/null and b/static/img/shenyu/custom/custom-load-balance-en.jpg differ
diff --git a/static/img/shenyu/custom/custom-load-balance-zh.jpg b/static/img/shenyu/custom/custom-load-balance-zh.jpg
new file mode 100644
index 0000000..b0af515
Binary files /dev/null and b/static/img/shenyu/custom/custom-load-balance-zh.jpg differ
diff --git a/static/img/shenyu/custom/custom-rate-limiter-en.jpg b/static/img/shenyu/custom/custom-rate-limiter-en.jpg
new file mode 100644
index 0000000..fc48289
Binary files /dev/null and b/static/img/shenyu/custom/custom-rate-limiter-en.jpg differ
diff --git a/static/img/shenyu/custom/custom-rate-limiter-zh.jpg b/static/img/shenyu/custom/custom-rate-limiter-zh.jpg
new file mode 100644
index 0000000..810aca9
Binary files /dev/null and b/static/img/shenyu/custom/custom-rate-limiter-zh.jpg differ
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md b/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
index a95c087..0973fcc 100644
--- a/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-condition-match.md
@@ -35,7 +35,7 @@ ${you spi name} = ${you class path}
* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `MATCH_MODE`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
-<img src="/img/shenyu/custom/custom-condition-match-en.png" width="40%" height="30%" />
+<img src="/static/img/shenyu/custom/custom-condition-match-en.png" width="40%" height="30%" />
* Or execute the following custom `SQL` statement:
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md b/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
new file mode 100644
index 0000000..3f412ae
--- /dev/null
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-load-balance.md
@@ -0,0 +1,80 @@
+---
+title: Custom Load Balance
+keywords: ["LoadBalance"]
+description: Custom Load Balance
+---
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom).
+
+* This article describes how to customize the extension of `org.apache.shenyu.plugin.divide.balance.LoadBalance` .
+
+## Extension
+
+* Create a new class `${you class}`, implements `org.apache.shenyu.plugin.divide.balance.LoadBalance`
+
+```java
+public class ${you class} implements LoadBalance {
+
+ /**
+ * select one from upstream list.
+ *
+ * @param upstreamList upstream list
+ * @param ip ip
+ * @return divide upstream
+ */
+ @Override
+ public DivideUpstream doSelect(final List<DivideUpstream> upstreamList,
+ final String ip) {
+ //coding and return
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.divide.balance.LoadBalance`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `LOAD_BALANCE`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-load-balance-en.jpg" width="40%" height="30%" />
+
+* Or execute the following custom `SQL` statement:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+
+
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md b/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
new file mode 100644
index 0000000..d02db1f
--- /dev/null
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-metrics-monitor.md
@@ -0,0 +1,55 @@
+---
+title: Custom Metrics Monitor
+keywords: ["MetricsMonitor"]
+description: custom Metrics Monitor
+---
+
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom)
+
+* This article describes how to customize the extension of `org.apache.shenyu.metrics.spi.MetricsBootService`.
+
+## Extension
+
+* Create a new class `${you class}`,implements `org.apache.shenyu.metrics.spi.MetricsBootService`
+
+```
+public class ${you class} implements MetricsBootService {
+
+ /**
+ * Start metrics tracker.
+ *
+ * @param metricsConfig metrics config
+ * @param metricsRegister the metrics register
+ */
+ public void start(MetricsConfig metricsConfig, MetricsRegister metricsRegister){
+ //your code
+ }
+
+ /**
+ * Stop metrics tracker.
+ */
+ public void stop() {
+ //your code
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.metrics.spi.MetricsBootService`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Plugin , Find the `Monitor` plugin, edit config, pay attention to the `metricsName` name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-metrics-monitor-en.jpg" width="40%" height="30%" />
+
+
+
+
+
+
diff --git a/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md b/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
new file mode 100644
index 0000000..ba0c21e
--- /dev/null
+++ b/versioned_docs/version-2.4.0/developer/spi/custom-rate-limiter.md
@@ -0,0 +1,96 @@
+---
+title: Custom Rate Limiter
+keywords: ["RateLimiter"]
+description: Custom Rate Limiter
+---
+
+## Explanation
+
+* Before custom development, please customize and build the gateway environment first, please refer to: [custom deployment](../deployment-custom).
+
+* This article describes how to customize the extension of `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm` .
+
+## Extension
+
+* Create a new class `${you class}`, implements `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`
+
+```java
+public class ${you class} implements RateLimiterAlgorithm<T> {
+
+ /**
+ * Gets script.
+ *
+ * @return the script
+ */
+ public RedisScript<T> getScript() {
+ //coding and return
+ }
+
+ /**
+ * Gets keys.
+ *
+ * @param id the id
+ * @return the keys
+ */
+ public List<String> getKeys(String id) {
+ //coding and return
+ }
+
+ /**
+ * Callback string.
+ *
+ * @param script the script
+ * @param keys the keys
+ * @param scriptArgs the script args
+ */
+ public void callback(final RedisScript<?> script, final List<String> keys, final List<String> scriptArgs) {
+ //coding and return
+ }
+}
+```
+
+* In the project `resources` directory,Create a new `META-INF/shenyu` directory, and the new file name is : `org.apache.shenyu.plugin.ratelimiter.algorithm.RateLimiterAlgorithm`.
+add `${you spi name}` = `${you class path}`:
+
+```
+${you spi name} = ${you class path}
+```
+
+* In the `Admin` service ---> BasicConfig ---> Dictionary , Find the dictionary code as `ALGORITHM_*`, add a new piece of data, pay attention to the dictionary name: `${you spi name}`.
+
+<img src="/static/img/shenyu/custom/custom-rate-limiter-en.jpg" width="40%" height="30%" />
+
+* Or execute the following custom `SQL` statement:
+
+```sql
+INSERT IGNORE INTO `shenyu_dict` (
+ `id`,
+ `type`,
+ `dict_code`,
+ `dict_name`,
+ `dict_value`,
+ `desc`,
+ `sort`,
+ `enabled`,
+ `date_created`,
+ `date_updated`
+ )
+VALUES (
+ 'you id',
+ 'matchMode',
+ 'MATCH_MODE',
+ 'you spi name',
+ 'you value',
+ 'you spi name',
+ 0,
+ 1,
+ '2021-08-30 19:29:10',
+ '2021-08-30 20:15:23'
+ );
+```
+
+
+
+
+
+