Skip to content

docs(logs): document batching processor triggers - #5261

Open
aryansk wants to merge 5 commits into
open-telemetry:mainfrom
aryansk:codex/issue-4434-logs-batching-processor
Open

docs(logs): document batching processor triggers#5261
aryansk wants to merge 5 commits into
open-telemetry:mainfrom
aryansk:codex/issue-4434-logs-batching-processor

Conversation

@aryansk

@aryansk aryansk commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Resolves #4434

Description

Document the Logs SDK batching processor's export triggers, empty-queue
behavior, and the relationship between maxExportBatchSize and
scheduledDelayMillis. The wording follows the concise behavior described in
the linked discussion on #4409 and keeps the Logs SDK guidance explicit about
ForceFlush and Shutdown.

Testing

  • git diff --check
  • make markdownlint

@linux-foundation-easycla

linux-foundation-easycla Bot commented Aug 9, 2026

Copy link
Copy Markdown

CLA Signed
The committers listed above are authorized under a signed CLA.

  • ✅ login: aryansk / name: Aryan Singh K. (9546b4f)

@arminru arminru added editorial Editorial changes only (typos, changelog, ...). No content-related changes of any kind. and removed editorial Editorial changes only (typos, changelog, ...). No content-related changes of any kind. labels Aug 10, 2026
Comment thread specification/logs/sdk.md Outdated
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 11, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on the author · refreshed 2026-08-24 18:58 UTC

Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):

  • Inline threads: 1
Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Should this be with reviewers? Comment /dashboard route:reviewers to route it to them.
  • Anything wrong — including the routing? Report it with what you expected; it helps us improve the dashboard.

@aryansk
aryansk marked this pull request as ready for review August 12, 2026 05:28
@aryansk
aryansk requested a review from a team as a code owner August 12, 2026 05:28
Comment thread specification/logs/sdk.md Outdated
Comment thread specification/logs/sdk.md Outdated
Comment thread specification/logs/sdk.md Outdated
Adopt review feedback: invoke the LogRecordExporter's Export, drop the
construction-vs-first-record OR in the first trigger, and remove the
empty-batch OR skip flexibility.
Comment thread specification/logs/sdk.md Outdated
Comment on lines +560 to +561
If the queue is empty when an export is triggered, the processor MAY export
an empty batch.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

An alternative approach for us to consider:

Suggested change
If the queue is empty when an export is triggered, the processor MAY export
an empty batch.
If the queue is empty when an export is triggered, the processor SHOULD invoke the `LogRecordExporter`'s `Export` and provide an empty batch.

In this way the exporter can decide to simply do nothing when the input batch is empty, or the exporter can do some maintenance job (e.g. just sending some heartbeat, so the backend would be able to tell "I don't see data because there is no data, and my app is alive" versus "I don't see data, my app might be dead").

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I like the SHOULD export with empty batch behavior too. Since this was not specified before for Log SDK, I think it is okay. One thing to note is - the wording is copied as-is from Tracing sdk spec, which is marked stable - changing a MAY to SHOULD might not be allowed for existing stable spec.

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.

Adopted — the empty-queue clause now reads: "the processor SHOULD invoke the LogRecordExporter's Export and provide an empty batch, so the exporter can decide how to handle it." Pushed as 5acfb3f.

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 about the stable Trace wording — the Trace SDK text is untouched; this change is only in the Logs SDK block this PR adds (Logs SDK batching wording was previously unspecified), so the stable-spec constraint does not apply here. The clause now reads: "the processor SHOULD invoke the LogRecordExporter's Export and provide an empty batch". Pushed as 5acfb3f.

@reyang reyang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Thank you @aryansk!
I've left a non-blocking suggestion, either way works fine IMO so I'll let you decide.

aryansk and others added 2 commits August 13, 2026 22:54
Adopt review feedback: when an export is triggered with an empty queue, the
processor SHOULD invoke the exporter with an empty batch so the exporter can
decide how to handle it.
@reyang
reyang enabled auto-merge August 17, 2026 16:40
Comment thread specification/logs/sdk.md
Comment on lines +553 to +555
- `scheduledDelayMillis` after the previous export timer ends, OR the previous
export completes, OR the first `LogRecord` is added to the queue after the
previous export timer ends or previous batch completes.

@pellared pellared Aug 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I fail to understand this bullet

"OR the previous export completes" is this correct? Why "OR"? Is it not about "AND the previous export call has returned:" which was defined previously?

What is an export timer? When does it reset?

@pellared pellared Aug 17, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Also note that the preceding MUST already ensures that Export calls are not concurrent, so “AND the previous export call has returned” is redundant if it only restates serialization.

Could we separate export triggers from timer-restart semantics? For example:

The processor SHOULD invoke the `LogRecordExporter`'s `Export` when:
 
- the scheduled-delay timer expires;
- the queue contains `maxExportBatchSize` or more `LogRecord`s;
- `ForceFlush` is called; or
- `Shutdown` is called.

If a trigger occurs while an `Export` call is in progress,
the processor SHOULD service the trigger after that call returns.

@opentelemetry-pr-dashboard

Copy link
Copy Markdown

Hi @aryansk — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.

  • Replying is enough to hand it off — answer, explain why no change is needed, or ask a follow-up. The dashboard routes it onward once nothing on the list is waiting on you.
  • To hand it back for any other reason, including the dashboard getting this wrong, comment /dashboard route:reviewers.

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.

The Batching Processor is missing details which are in the Trace Batching Processor

6 participants