From f7a6a72c221fe40930b0bbc376aca55431ded27f Mon Sep 17 00:00:00 2001 From: Denis Machard <5562930+dmachard@users.noreply.github.com> Date: Mon, 23 Sep 2024 15:54:22 +0200 Subject: [PATCH] set as warning log message when the buffer is full (#820) * set as warning log message when the buffer is full * Update docs --- README.md | 2 +- docs/configuration.md | 2 +- docs/performance.md | 4 ++-- workers/elasticsearch.go | 4 ++-- workers/worker.go | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 744476a3..0cd4fed7 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ - [`Scalyr`](docs/loggers/logger_scalyr.md) - [`Redis`](docs/loggers/logger_redis.md) publisher - [`Kafka`](docs/loggers/logger_kafka.md) producer - - [`ClickHouse`](docs/loggers/logger_clickhouse.md) client *(not yet production ready)* + - [`ClickHouse`](docs/loggers/logger_clickhouse.md) client - *Send to security tools* - [`Falco`](docs/loggers/logger_falco.md) diff --git a/docs/configuration.md b/docs/configuration.md index eb8bc826..a6dbfdd7 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -58,7 +58,7 @@ global: The `interval-monitor` in second(s) is used to count every XX second the number of in/out packets. -The `buffer-size` settings enable to adjust the size of the buffer before discard additional packets. If you encounter the error message buffer is full, xxx packet(s) dropped, consider increasing this parameter to prevent message drops. +The `buffer-size` settings enable to adjust the size of the buffer before discard additional packets. If you encounter the warning message buffer is full, xxx packet(s) dropped, consider increasing this parameter to prevent message drops. ```yaml global: diff --git a/docs/performance.md b/docs/performance.md index ab80ad13..d92631c7 100644 --- a/docs/performance.md +++ b/docs/performance.md @@ -1,8 +1,8 @@ # Performance tuning All loggers and collectors are based on buffered channels. -The size of these buffers can be configured with `chan-buffer-size`. -If you encounter the following error message in your logs, it indicates that you need to increase the chan-buffer-size: +The size of these buffers can be configured with `buffer-size` in global section. +If you encounter the following warning message in your logs, it indicates that you need to increase the buffer size: ```bash logger[elastic] buffer is full, 7855 packet(s) dropped diff --git a/workers/elasticsearch.go b/workers/elasticsearch.go index b74fc4ad..209c81bb 100644 --- a/workers/elasticsearch.go +++ b/workers/elasticsearch.go @@ -167,7 +167,7 @@ func (w *ElasticSearchClient) StartLogging() { select { case dataBuffer <- bufCopy: default: - w.LogError("Send buffer is full, bulk dropped") + w.LogWarning("Send buffer is full, bulk dropped") } } @@ -183,7 +183,7 @@ func (w *ElasticSearchClient) StartLogging() { select { case dataBuffer <- bufCopy: default: - w.LogError("automatic flush, send buffer is full, bulk dropped") + w.LogWarning("automatic flush, send buffer is full, bulk dropped") } } diff --git a/workers/worker.go b/workers/worker.go index afc4faca..f793065d 100644 --- a/workers/worker.go +++ b/workers/worker.go @@ -225,7 +225,7 @@ func (w *GenericWorker) Monitor() { case <-timerMonitor.C: for v, k := range w.droppedWorkerCount { if k > 0 { - w.LogError("worker[%s] buffer is full, %d dnsmessage(s) dropped", v, k) + w.LogWarning("worker[%s] buffer is full, %d dnsmessage(s) dropped", v, k) w.droppedWorkerCount[v] = 0 } }