-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
filter_ratelimit: Add message rate limiter
Add a filter to limit messages per configurable source field. The benefit of this is the overall logging infrastructure can be protected from a rogue logging source (e.g. an application that spams a high volume of messages in a short period of time). Rate limiting is implemented using a typical token based algorithm. Some n tokens per second are added, with a total burst limit of q. This limits messages to n messages per second on average, with a max amount of q per second. Configuration: Bucket_Field filename-field ----------------------------------------------------------------- Field to use for grouping messages into a rate limited bucket. Rate limits apply to the bucket. Buckets are independent from each other. Events_Per_Second 10 ----------------------------------------------------------------- Average number of events per second allowed. Events_Burst 20 ----------------------------------------------------------------- Max number of events in a second allowed. Initial_Burst 100 ----------------------------------------------------------------- Max number of events to allow on startup. Useful when expected to load a lot of log messages at startup from new log files. Max_Buckets 256 ----------------------------------------------------------------- Number of expected active buckets. If too small, rate limiting won't function very well.
- Loading branch information
James Ravn
committed
Nov 15, 2017
1 parent
fe2a224
commit 438e500
Showing
13 changed files
with
592 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
set(src | ||
ratelimit.c) | ||
|
||
FLB_PLUGIN(filter_ratelimit "${src}" "") |
Oops, something went wrong.