Skip to content

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

Open
Manvi2402 wants to merge 3 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 3 commits intoopen-telemetry:mainfrom
Manvi2402:fix/batch-log-processor-schedule-delay

Conversation

@Manvi2402
Copy link
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
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)?

CHANGELOG.md Outdated

## Unreleased

- Fix `BatchLogRecordProcessor` default `schedule_delay_millis` to 1000ms per OTel specification
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- Fix `BatchLogRecordProcessor` default `schedule_delay_millis` to 1000ms per OTel specification
- 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).

@Manvi2402
Copy link
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!

Copy link

@themavik themavik left a comment

Choose a reason for hiding this comment

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

Summary: Aligns BatchLogRecordProcessor default schedule_delay_millis from 5000ms to 1000ms per OTel spec.

Done well: Changelog clearly documents the 5x export frequency change for users who rely on defaults. All three touchpoints updated consistently: _DEFAULT_SCHEDULE_DELAY_MILLIS, env var docs, and the three test_args_* assertions (5→1 seconds). The test values correctly reflect seconds internally.

Note: Users not setting OTEL_BLRP_SCHEDULE_DELAY will see more frequent exports; the changelog handles this. Consider whether any performance or rate-limit docs should mention the new default.

@Manvi2402
Copy link
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!

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

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

BatchLogRecordProcessor default schedule_delay is 5000ms but spec requires 1000ms

4 participants