From e9d7f4379caeebe2065c0487c2c872ca0779841f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A1szl=C3=B3=20V=C3=A1rady?= Date: Wed, 25 Sep 2024 19:42:30 +0200 Subject: [PATCH] otel: fix fetch_limit calculation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: László Várady --- modules/grpc/otel/otel-source.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/modules/grpc/otel/otel-source.cpp b/modules/grpc/otel/otel-source.cpp index efb6844ab..f0b8dca06 100644 --- a/modules/grpc/otel/otel-source.cpp +++ b/modules/grpc/otel/otel-source.cpp @@ -117,7 +117,12 @@ syslogng::grpc::otel::SourceDriver::init() msg_info("OpenTelemetry server accepting connections", evt_tag_int("port", port)); if (fetch_limit == -1) - fetch_limit = super->super.worker_options.super.init_window_size; + { + if (super->super.worker_options.super.init_window_size != -1) + fetch_limit = super->super.worker_options.super.init_window_size / super->super.num_workers; + else + fetch_limit = 100; + } /* * syslog-ng-otlp(): the original HOST is always kept