From b1a799924a8070fa188135191815a1e3ad123663 Mon Sep 17 00:00:00 2001 From: Samuele Date: Thu, 1 Feb 2024 19:21:57 +0100 Subject: [PATCH] perf(opentelemetry): increase max batch size (#12488) The max batch size for Opentelemetry was set to the default value: 1 the value actually refers to the number of spans in a batch, so we are increasing the default value to 200 which corresponds to what the default value used to be with the "old" queue implementation. (cherry picked from commit c7cb900f4919e6b320b7bdf9132cfa4747679760) --- .../unreleased/kong/otel-increase-queue-max-batch-size.yml | 3 +++ kong/plugins/opentelemetry/schema.lua | 6 +++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 changelog/unreleased/kong/otel-increase-queue-max-batch-size.yml diff --git a/changelog/unreleased/kong/otel-increase-queue-max-batch-size.yml b/changelog/unreleased/kong/otel-increase-queue-max-batch-size.yml new file mode 100644 index 00000000000..6936adcf761 --- /dev/null +++ b/changelog/unreleased/kong/otel-increase-queue-max-batch-size.yml @@ -0,0 +1,3 @@ +message: "**Opentelemetry**: increase queue max batch size to 200" +type: performance +scope: Plugin diff --git a/kong/plugins/opentelemetry/schema.lua b/kong/plugins/opentelemetry/schema.lua index 375d87fa00b..8aa002df8dc 100644 --- a/kong/plugins/opentelemetry/schema.lua +++ b/kong/plugins/opentelemetry/schema.lua @@ -44,7 +44,11 @@ return { }, } }, { resource_attributes = resource_attributes }, - { queue = typedefs.queue }, + { queue = typedefs.queue { + default = { + max_batch_size = 200, + }, + } }, { batch_span_count = { description = "The number of spans to be sent in a single batch.", type = "integer" } }, { batch_flush_delay = { description = "The delay, in seconds, between two consecutive batches.", type = "integer" } }, { connect_timeout = typedefs.timeout { default = 1000 } },