From f98a95f09f664971113606b0524a2ddcec864f22 Mon Sep 17 00:00:00 2001 From: "Grot (@grafanabot)" <43478413+grafanabot@users.noreply.github.com> Date: Thu, 7 Apr 2022 08:33:26 -0700 Subject: [PATCH] Docs: Document Promtail global rate limiting (#5737) (#5814) * Docs: Document Promtail global rate limiting * Update docs/sources/clients/promtail/configuration.md Co-authored-by: Jennifer Villa * Revise strings that explain the new configuration parameters * For rate limiting, limit_config becomes limits_config Co-authored-by: Jennifer Villa (cherry picked from commit c860fc6442663170897f1cab73d4f9a4f6af4158) Co-authored-by: Karen Miller <84039272+KMiller-Grafana@users.noreply.github.com> --- clients/pkg/promtail/limit/config.go | 8 +++---- .../sources/clients/promtail/configuration.md | 23 +++++++++++++++++++ 2 files changed, 27 insertions(+), 4 deletions(-) diff --git a/clients/pkg/promtail/limit/config.go b/clients/pkg/promtail/limit/config.go index 6ecef6fdd523e..4584502233b18 100644 --- a/clients/pkg/promtail/limit/config.go +++ b/clients/pkg/promtail/limit/config.go @@ -12,8 +12,8 @@ type Config struct { } func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet) { - f.Float64Var(&cfg.ReadlineRate, prefix+"limit.readline-rate", 10000, "promtail readline Rate.") - f.IntVar(&cfg.ReadlineBurst, prefix+"limit.readline-burst", 10000, "promtail readline Burst.") - f.BoolVar(&cfg.ReadlineRateEnabled, prefix+"limit.readline-rate-enabled", false, "Set to false to disable readline rate limit.") - f.BoolVar(&cfg.ReadlineRateDrop, prefix+"limit.readline-rate-drop", true, "Set to true to drop log when rate limit.") + f.Float64Var(&cfg.ReadlineRate, prefix+"limit.readline-rate", 10000, "The rate limit in log lines per second that this instance of Promtail may push to Loki.") + f.IntVar(&cfg.ReadlineBurst, prefix+"limit.readline-burst", 10000, "The cap in the quantity of burst lines that this instance of Promtail may push to Loki.") + f.BoolVar(&cfg.ReadlineRateEnabled, prefix+"limit.readline-rate-enabled", false, "When true, enforces rate limiting on this instance of Promtail.") + f.BoolVar(&cfg.ReadlineRateDrop, prefix+"limit.readline-rate-drop", true, "When true, exceeding the rate limit causes this instance of Promtail to discard log lines, rather than sending them to Loki.") } diff --git a/docs/sources/clients/promtail/configuration.md b/docs/sources/clients/promtail/configuration.md index 9a6a7bdfd339b..5a949eef47408 100644 --- a/docs/sources/clients/promtail/configuration.md +++ b/docs/sources/clients/promtail/configuration.md @@ -95,6 +95,9 @@ clients: scrape_configs: - [] +# Configures global limits for this instance of Promtail +[limits_config: ] + # Configures how tailed targets will be watched. [target_config: ] ``` @@ -1759,6 +1762,26 @@ scrape_configs: target_label: 'container' ``` +## limits_config + +The optional `limits_config` block configures global limits for this instance of Promtail. + +```yaml +# When true, enforces rate limiting on this instance of Promtail. +[readline_rate_enabled: | default = false] + +# The rate limit in log lines per second that this instance of Promtail may push to Loki. +[readline_rate: | default = 10000] + +# The cap in the quantity of burst lines that this instance of Promtail may push +# to Loki. +[readline_burst: | default = 10000] + +# When true, exceeding the rate limit causes this instance of Promtail to discard +# log lines, rather than sending them to Loki. When false, exceeding the rate limit +# causes this instance of Promtail to temporarily hold off on sending the log lines and retry later. +[readline_rate_drop: | default = true] +``` ## target_config