Skip to content

Commit 4bbfe44

Browse files
authored
Update the docs to mention the newly added options for rate limiter (#935)
1 parent dc852d3 commit 4bbfe44

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed

docs/guides/ja/web-api-basics.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,24 @@ config.getMethodsConfig().setMetricsDatastore(new MemoryMetricsDatastore(3));
327327
}
328328
```
329329

330+
もしこのメトリクスの管理が全く必要ないという場合は、以下の方法で無効化することもできます。
331+
332+
```java
333+
SlackConfig config = new SlackConfig();
334+
config.setStatsEnabled(false);
335+
Slack slack = Slack.getInstance(config);
336+
```
337+
338+
もう少し細かい単位で制御したい場合は、API クライアント単位で同様のフラグを設定できます。
339+
340+
```java
341+
SlackConfig config = new SlackConfig();
342+
// Web API メソッドに対してのみメトリクスの機能を無効化
343+
config.getMethodsConfig().setStatsEnabled(false);
344+
// SCIM や Audit Logs の API では、引き続きメトリクス昨日は有効
345+
Slack slack = Slack.getInstance(config);
346+
```
347+
330348
### Redis によるメトリクスデータストア
331349

332350
統合された一つのデータストアにすべてのノードのメトリクスを集約したい場合は Redis クラスターを利用することをおすすめします。API クライアント側の設定は非常に簡単です。以下は同じホストで稼働する Redis サーバーを利用する例です。

docs/guides/web-api-basics.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,24 @@ The following example is a JSON representation of a **MethodsStats** instance. T
327327
}
328328
```
329329

330+
If you don't need the traffic metrics at all, you can disable this feature by the following way:
331+
332+
```java
333+
SlackConfig config = new SlackConfig();
334+
config.setStatsEnabled(false);
335+
Slack slack = Slack.getInstance(config);
336+
```
337+
338+
For more granular control, you can set the same flag for each API client:
339+
340+
```java
341+
SlackConfig config = new SlackConfig();
342+
// Disable the metrics only for Web API methods
343+
config.getMethodsConfig().setStatsEnabled(false);
344+
// For SCIM, Audit Logs APIs, the metrics are still available
345+
Slack slack = Slack.getInstance(config);
346+
```
347+
330348
### Metrics Datastore backed by Redis
331349

332350
If your app wants to have a unified datastore to collect all the metrics across the nodes, we recommend having a Redis cluster for it. It's pretty easy to set up the API client configuration. The following is an example to use a Redis server running on the same host.

0 commit comments

Comments
 (0)