Skip to content

Commit c54337d

Browse files
committed
throttle: support not drop messages
Signed-off-by: wangzhuzhen <[email protected]>
1 parent a27412d commit c54337d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pipeline/filters/throttle.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ The plugin supports the following configuration parameters:
1212
| Window | Integer | Amount of intervals to calculate average over. Default 5. |
1313
| Interval | String | Time interval, expressed in "sleep" format. e.g 3s, 1.5m, 0.5h etc |
1414
| Print\_Status | Bool | Whether to print status messages with current rate and the limits to information logs |
15+
| Retain | Bool | Whether to whether or not to drop logs if rate limit is exceeded |
1516

1617
## Functional description
1718

@@ -64,6 +65,14 @@ will become:
6465
```
6566

6667
As you can see, last pane of the window was overwritten and 1 message was dropped.
68+
If you can accept the cost of latency for collector messages, you can retain all the logs without dropped use parameter 'Retain'.
69+
70+
### Do not drop messages
71+
The default value for 'Retain' is 'false',
72+
For 'Retain' not set or set as 'false', if rate limit is exceeded, throttle will drop the messages.
73+
In case that, if before fluent-bit first running, there is a input with huge messages which exceeded the throttle's (window * rate * interval), then only the first (window * rate * interval) records will be collected, the others before fluent-bit running will be dropped.
74+
75+
If 'Retain' set as 'true', all messages will be collected without dropped, but at the cost of some latency for collecting all messages, which depends on the account of collected target input.
6776

6877
### Interval vs Window size
6978

@@ -128,6 +137,7 @@ $ bin/fluent-bit -i tail -p 'path=lines.txt' -F throttle -p 'rate=1' -m '*' -o s
128137
Rate 1000
129138
Window 300
130139
Interval 1s
140+
Retain false
131141

132142
[OUTPUT]
133143
Name stdout

0 commit comments

Comments
 (0)