Skip to content

Fix BatchLogRecordProcessor default schedule_delay_millis to 1000ms per OTel spec#4998

Open
Manvi2402 wants to merge 6 commits intoopen-telemetry:mainfrom
Manvi2402:fix/batch-log-processor-schedule-delay
Open

Fix BatchLogRecordProcessor default schedule_delay_millis to 1000ms per OTel spec#4998
Manvi2402 wants to merge 6 commits intoopen-telemetry:mainfrom
Manvi2402:fix/batch-log-processor-schedule-delay

Conversation

@Manvi2402
Copy link
Copy Markdown
Contributor

…er OTel spec

Description

The BatchLogRecordProcessor._DEFAULT_SCHEDULE_DELAY_MILLIS was set to
5000ms, but the OTel specification defines OTEL_BLRP_SCHEDULE_DELAY
default as 1000ms.

Fixes #4991

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Updated existing unit tests in opentelemetry-sdk/tests/logs/test_export.py
to reflect the corrected default value of 1000ms instead of 5000ms.

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • [ x ] No.

Checklist:

  • [ x ] Followed the style guidelines of this project
  • [ x ] Changelogs have been updated
  • [ x ] Unit tests have been added
  • [ x ] Documentation has been updated

Copy link
Copy Markdown
Member

@pmcollins pmcollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the change. Can you also update the default value in the docstring for OTEL_BLRP_SCHEDULE_DELAY (in environment_variables/__init__.py)?

@Manvi2402
Copy link
Copy Markdown
Contributor Author

Hi @pmcollins , I've made both the requested changes — updated the CHANGELOG wording and the OTEL_BLRP_SCHEDULE_DELAY docstring default to 1000ms. Please let me know if anything else is needed!

@Manvi2402
Copy link
Copy Markdown
Contributor Author

Thank you for the detailed review @themavik . Agreed on the performance/rate-limit docs — that feels like a separate issue. Happy to open one if that would be helpful!

@xrmx xrmx moved this to Approved PRs in Python PR digest Mar 20, 2026
CHANGELOG.md Outdated

## Unreleased

- Fix `BatchLogRecordProcessor` default `schedule_delay_millis` from 5000ms to 1000ms to comply with the OTel specification. Note: logs will be exported 5x more frequently by default (e.g. for users who don't explicitly set the `OTEL_BLRP_SCHEDULE_DELAY` env var).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

They MAY be exported 5x more frequently.. An export occurs when we hit the first of: delay millis or max_queue_size

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated to "may be" since export can also be triggered by max_queue_size before the delay. Thanks!

from opentelemetry.sdk.resources import Resource

_DEFAULT_SCHEDULE_DELAY_MILLIS = 5000
_DEFAULT_SCHEDULE_DELAY_MILLIS = 1000
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! Yes, BatchSpanProcessor should also be updated to match the OTel spec, but since this PR is focused on BatchLogRecordProcessor (logs), I'd prefer to address the span processor in a separate follow-up issue/PR. Happy to open that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Approved PRs

Development

Successfully merging this pull request may close these issues.

BatchLogRecordProcessor default schedule_delay is 5000ms but spec requires 1000ms

5 participants