Skip to content

opentelemetry-sdk: add 'force_flush' method to LogRecordExporter ABC#5294

Merged
lzchen merged 12 commits into
open-telemetry:mainfrom
herin049:feat/logging-force-flush
Jul 13, 2026
Merged

opentelemetry-sdk: add 'force_flush' method to LogRecordExporter ABC#5294
lzchen merged 12 commits into
open-telemetry:mainfrom
herin049:feat/logging-force-flush

Conversation

@herin049

@herin049 herin049 commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fixes #5359

Description

The OpenTelemetry SDK specification for logs documents the force flush operation, but this function is currently not required for log exporter implementation. This PR addresses this by adding force_flush to the LogRecordExporter ABC.

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

uv run tox -e py314-test-opentelemetry-sdk

Does This PR Require a Contrib Repo Change?

  • Yes. - Link to PR:
  • No.

Checklist:

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

@herin049
herin049 requested a review from a team as a code owner June 11, 2026 21:00
@xrmx xrmx moved this from Todo to In Progress in Python Logging API/SDK RC Jun 24, 2026

@ocelotl ocelotl left a comment

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.

Please review the type and value of the timeout, besides that, I am ready to approve ✌️ .

Comment thread opentelemetry-sdk/src/opentelemetry/sdk/_logs/_internal/export/__init__.py Outdated
@github-project-automation github-project-automation Bot moved this to Reviewed PRs that need fixes in Python PR digest Jun 24, 2026
@github-project-automation github-project-automation Bot moved this from Reviewed PRs that need fixes to Approved PRs in Python PR digest Jul 10, 2026
@xrmx
xrmx requested a review from DylanRussell July 10, 2026 15:12
@carlosalberto

Copy link
Copy Markdown
Contributor

#5403 created as a follow up, so this PR doesn't get stuck.

@lzchen lzchen left a comment

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.

This will cause previous child implementations to require the new method but I think this is fine to enforce.

@lzchen
lzchen added this pull request to the merge queue Jul 13, 2026
Merged via the queue into open-telemetry:main with commit 23dc0b2 Jul 13, 2026
560 checks passed
@github-project-automation github-project-automation Bot moved this from Approved PRs to Done in Python PR digest Jul 13, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in Python Logging API/SDK RC Jul 13, 2026
Eason09053360 added a commit to Eason09053360/opentelemetry-python that referenced this pull request Jul 14, 2026
…pen-telemetry#5294)

* opentelemetry-sdk: add 'force_flush' method to LogRecordExporter ABC

* update unit tests

* update 'force_flush' doc-string

* add changelog fragment

* switch timeout millis from float to int

* update remaining type hints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Logging stability review: [minor] No force_flush on LogRecordExporter

7 participants