Repository navigation
opentelemetry-sdk: allow zero schedule delay in batch span and log record processors - #5807
Merged
herin049 merged 4 commits intoOct 22, 2026
Merged
Conversation
Pull request dashboard statusMerged · refreshed 2026-10-22 18:35 UTC Status above doesn't look right?
|
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
Static review found no blocking issues in validation, worker notification handling, or regression coverage; tests were not executed.
No open issues 🎉
What changed in this PR
This PR aligns SDK batch processors with declarative configuration by accepting a zero schedule delay and exporting telemetry promptly without idle polling.
Changes:
- Allow zero schedule delay for batch span and log record processors while continuing to reject negative values.
- Update worker notifications to support immediate export, including telemetry emitted during an export.
- Add SDK, configuration, and end-to-end regression coverage, plus a changelog entry.
| File | Description |
|---|---|
tests/opentelemetry-docker-tests/tests/declconfig/scenarios/general_batch_zero_schedule_delay/scenario.yaml |
Defines expected span and log exports. |
tests/opentelemetry-docker-tests/tests/declconfig/scenarios/general_batch_zero_schedule_delay/run.py |
Emits spans and a correlated log record. |
tests/opentelemetry-docker-tests/tests/declconfig/scenarios/general_batch_zero_schedule_delay/otel-config.yaml |
Configures zero-delay batch processors with OTLP/HTTP exporters. |
opentelemetry-sdk/tests/trace/export/test_export.py |
Checks that span processors accept zero delay. |
opentelemetry-sdk/tests/shared_internal/test_batch_processor.py |
Tests immediate export and emission during export. |
opentelemetry-sdk/tests/logs/test_export.py |
Checks that log processors accept zero delay. |
opentelemetry-sdk/src/opentelemetry/sdk/trace/export/__init__.py |
Allows non-negative span processor delays. |
opentelemetry-sdk/src/opentelemetry/sdk/_shared_internal/__init__.py |
Implements event-driven zero-delay export handling. |
opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/export/__init__.py |
Allows non-negative log processor delays. |
opentelemetry-configuration/tests/test_tracer_provider.py |
Verifies zero-delay tracer configuration. |
opentelemetry-configuration/tests/test_logger_provider.py |
Verifies zero-delay logger configuration. |
.changelog/5807.fixed |
Documents the fix. |
Review effort: Balanced
lzchen
approved these changes
Oct 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
BatchSpanProcessorandBatchLogRecordProcessorrejectedschedule_delay_millis=0with aValueError. The declarative configuration schema allowsschedule_delay: 0, so a config that set it failed during SDK setup and no telemetry was exported.Type of change
Please delete options that are not relevant.
Checklist:
See contributing.md for styleguide, changelog guidelines, and more.
tox -e precommittox -e typecheck