Skip to content

Keep each export batch within its queue - #147

Merged
ltowarek merged 2 commits into
mainfrom
batch-size-within-queue
Oct 22, 2026
Merged

ltowarek merged 2 commits into
mainfrom
batch-size-within-queue

Conversation

@ltowarek

@ltowarek ltowarek commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Since #143, BatchSpanProcessor waits for a full batch before it exports (open-telemetry/opentelemetry-cpp#4466). The component left max_export_batch_size at the SDK default of 512, but the span queue holds 64. A full batch therefore never formed: spans exported only when the 5 s schedule delay expired, and every span that overflowed the queue meanwhile was dropped with a warning.

Change

  • Bumps third_party/opentelemetry-cpp from upstream main 7f93577b to the v1.30.0 release c7b64ec6. The four commits in between fix baggage parsing and the curl HTTP client and bump the version. None of them touches the batch processors.
  • Adds CONFIG_ESP_OPENTELEMETRY_BATCH_MAX_EXPORT_BATCH_SIZE (default 32, tracing only) and CONFIG_ESP_OPENTELEMETRY_LOGS_BATCH_MAX_EXPORT_BATCH_SIZE (default 64, logs only), each placed next to its queue size. Tracing and logs setup pass them as max_export_batch_size.
  • The default of half the queue matches the SDK's half-full wake-up, so every wake-up has a full batch to export, and it leaves room for items that arrive during an export.
  • The batch ≤ queue rule is not enforced in the component. That belongs in opentelemetry-cpp.

Verification

  • Before the rebase onto Bump third_party/abseil-cpp from d292c59 to 017286b #146 and the v1.30.0 bump, in the dust-mite ESP-IDF 6.0 devcontainer, all 11 CI matrix projects built, all 8 QEMU projects passed, and the symbolizer tests passed. On the current pins, CI is the check.
  • A throwaway QEMU check that ends 128 spans in bursts received none of them within 2 s before this change, and all of them after it.

Closes #145.

🤖 Generated with Claude Code

ltowarek and others added 2 commits October 22, 2026 23:39
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
@ltowarek
ltowarek force-pushed the batch-size-within-queue branch from 333681f to e6b7c6b Compare October 22, 2026 21:44
@ltowarek
ltowarek enabled auto-merge (squash) October 22, 2026 21:46
@ltowarek
ltowarek merged commit e201b8f into main Oct 22, 2026
15 checks passed
@ltowarek
ltowarek deleted the batch-size-within-queue branch October 22, 2026 22:04
ltowarek added a commit to ltowarek/dust-mite that referenced this pull request Oct 24, 2026
* Report each task's minimum free stack

dust_mite_task_stack_min_free_bytes joins the debug-only per-task metrics, read
from the same uxTaskGetSystemState() snapshot. It sizes the stream task's stack
from a measurement (#104).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Give tracing the current trace context as plain strings

tracing_headers() returns traceparent and tracestate for carriers that are not
JSON, such as the Camera stream's part headers (#104); tracing_inject() now
writes those strings into its cJSON object.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Start the web server test cases once the servers have restarted

The car's Wi-Fi often drops once while connecting, which stops the servers
until it gets an IP. wifi_wait_for_ip() returned before the web server had
handled that IP, so its "Starting the ... server" lines could land inside a
case's "Running ..." line; the runner then misread it and ran the case again
without a reset. The test app now waits until the default event loop has
drained.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Bump esp-opentelemetry-cpp to e201b8f

Brings opentelemetry-cpp v1.30.0 and keeps each export batch within its
queue (ltowarek/esp-opentelemetry-cpp#147). Without that fix, the span
queue filled between scheduled exports, spans were dropped and the car's
camera stalled.

opentelemetry-cpp renamed its CMake options to OTELCPP_*. An existing build
directory still caches WITH_ETW and fails to reconfigure; delete its
CMakeCache.txt.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Wait for the web servers in the test app instead of draining the event loop

web_server_wait_for_serving() blocks until every endpoint's server is
running, from an event group the component sets once it has started them and
clears whenever it stops them, the way wifi_wait_for_ip() waits for an IP.
The test app waits on it after wifi_wait_for_ip() instead of posting its own
event and waiting for the default event loop to reach it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Span batch size exceeds the queue size, so spans are dropped since the opentelemetry-cpp bump in #143

1 participant