From f2d4c0501f1b2a08e85ef10d1b6a9d53764f6919 Mon Sep 17 00:00:00 2001 From: Lukasz Towarek Date: Thu, 22 Oct 2026 23:39:06 +0200 Subject: [PATCH 1/2] Bump third_party/opentelemetry-cpp to v1.30.0 The pin moves from upstream main 7f93577b to the v1.30.0 release c7b64ec6, four commits later: a baggage parsing fix, a curl HTTP client fix, and the version bump. Nothing in the batch processors changes. Refs #145 Co-Authored-By: Claude Opus 5.5 --- third_party/opentelemetry-cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/third_party/opentelemetry-cpp b/third_party/opentelemetry-cpp index 7f93577..c7b64ec 160000 --- a/third_party/opentelemetry-cpp +++ b/third_party/opentelemetry-cpp @@ -1 +1 @@ -Subproject commit 7f93577ba15329828aba241610a6670defea64a7 +Subproject commit c7b64ec660c1b6c65dff0932b3d1c3483bc6db64 From e6b7c6b586635055358757deebb8cbffc0501447 Mon Sep 17 00:00:00 2001 From: Lukasz Towarek Date: Thu, 22 Oct 2026 17:38:59 +0200 Subject: [PATCH 2/2] Keep each export batch within its queue The span and log record processors left max_export_batch_size at the SDK default of 512, larger than their queues of 64 and 128. Since opentelemetry-cpp waits for a full batch before exporting spans, a full batch never formed: spans exported only when the schedule delay expired, and every span that overflowed the queue meanwhile was dropped with a warning. CONFIG_ESP_OPENTELEMETRY_BATCH_MAX_EXPORT_BATCH_SIZE and CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_MAX_EXPORT_BATCH_SIZE set the batch size next to each queue size, defaulting to half of it (32 and 64). Half the queue matches the SDK's half-full wake-up, so every wake-up has a full batch, and leaves room for items that arrive during an export. Closes #145 Co-Authored-By: Claude Opus 5.5 --- Kconfig.projbuild | 10 ++++++++++ src/integration/esp_logs.cpp | 3 ++- src/integration/esp_tracing.cpp | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 7b32c68..22024eb 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -208,6 +208,11 @@ menu "OpenTelemetry" depends on ESP_OPENTELEMETRY_TRACING_ENABLED default 64 + config ESP_OPENTELEMETRY_BATCH_MAX_EXPORT_BATCH_SIZE + int "Max spans per export batch" + depends on ESP_OPENTELEMETRY_TRACING_ENABLED + default 32 + config ESP_OPENTELEMETRY_BATCH_SCHEDULE_DELAY_MS int "Batch span processor schedule delay (ms)" depends on ESP_OPENTELEMETRY_TRACING_ENABLED @@ -240,6 +245,11 @@ menu "OpenTelemetry" Records emitted once the queue is full are dropped rather than blocking the logging call site. + config ESP_OPENTELEMETRY_LOGS_BATCH_MAX_EXPORT_BATCH_SIZE + int "Max log records per export batch" + depends on ESP_OPENTELEMETRY_LOGS_ENABLED + default 64 + config ESP_OPENTELEMETRY_LOGS_BATCH_SCHEDULE_DELAY_MS int "Batch log record processor schedule delay (ms)" depends on ESP_OPENTELEMETRY_LOGS_ENABLED diff --git a/src/integration/esp_logs.cpp b/src/integration/esp_logs.cpp index 2ed25a7..5f03a9d 100644 --- a/src/integration/esp_logs.cpp +++ b/src/integration/esp_logs.cpp @@ -106,7 +106,8 @@ void esp_opentelemetry_logs_setup( } sdk_logs::BatchLogRecordProcessorOptions batch_options; - batch_options.max_queue_size = CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_MAX_QUEUE_SIZE; + batch_options.max_queue_size = CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_MAX_QUEUE_SIZE; + batch_options.max_export_batch_size = CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_MAX_EXPORT_BATCH_SIZE; batch_options.schedule_delay_millis = std::chrono::milliseconds(CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_SCHEDULE_DELAY_MS); diff --git a/src/integration/esp_tracing.cpp b/src/integration/esp_tracing.cpp index f0d0e5d..f89d7d7 100644 --- a/src/integration/esp_tracing.cpp +++ b/src/integration/esp_tracing.cpp @@ -59,6 +59,7 @@ void esp_opentelemetry_tracing_setup( sdk_trace::BatchSpanProcessorOptions batch_options; batch_options.max_queue_size = CONFIG_ESP_OPENTELEMETRY_BATCH_MAX_QUEUE_SIZE; + batch_options.max_export_batch_size = CONFIG_ESP_OPENTELEMETRY_BATCH_MAX_EXPORT_BATCH_SIZE; batch_options.schedule_delay_millis = std::chrono::milliseconds(CONFIG_ESP_OPENTELEMETRY_BATCH_SCHEDULE_DELAY_MS);