-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sampler: Support thereafter of zero (#1033)
The Zap sampling logger accepts three configuration parameters: interval, first, and thereafter. After we see `first` log with the same message in `interval`, the sampler kicks in. Following that, we let through every `thereafter`-th log. So for example, NewSamplerWithOptions(core, time.Second, 100, 50) This will allow 100 logs with the same message in a second, and following that, every 50th message with that message. In #1032, the user wanted the sampler to reject *all* duplicate messages once the limit was reached, but our sampler panics if `thereafter = 0`. This change adds support for setting `thereafter` to 0, dropping all messages in that interval once the limit is reached. It also adds further explanation to the documentation to address the misuse in #1032. Resolves #1032
- Loading branch information
Showing
2 changed files
with
52 additions
and
2 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