Skip to content

Support configuring SDK batch size in config using items or bytes#5070

Closed
iblancasa wants to merge 1 commit into
open-telemetry:mainfrom
iblancasa:5068
Closed

Support configuring SDK batch size in config using items or bytes#5070
iblancasa wants to merge 1 commit into
open-telemetry:mainfrom
iblancasa:5068

Conversation

@iblancasa

@iblancasa iblancasa commented May 6, 2026

Copy link
Copy Markdown
Member

Fixes #5068

Changes

Add in-development guidance for configuring SDK batch size using items or bytes, including declarative configuration support via batch_size_unit.

Similar to what we currently support in exporter helper from OpenTelemetry Collector https://github.com/open-telemetry/opentelemetry-collector/tree/main/exporter/exporterhelper

Prototype for go: open-telemetry/opentelemetry-go#8321

…or bytes

Signed-off-by: Israel Blancas <iblancasa@gmail.com>
@iblancasa
iblancasa requested review from a team as code owners May 6, 2026 10:11
@iblancasa iblancasa changed the title Support configuring SDK batch size in declarative config using items or bytes Support configuring SDK batch size in config using items or bytes May 6, 2026
@dashpole

dashpole commented May 6, 2026

Copy link
Copy Markdown
Contributor

I think first you need to define the SDK surface that actually allows it to be configured with a batch size in units other than spans/logs/data-points.

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk.md#batching-processor has a maxExportBatchSize, which is defined in terms of the number of spans.

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/sdk.md#batching-processor has a maxExportBatchSize, which is defined in terms of the number of log records.

https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/metrics/sdk.md#periodic-exporting-metricreader has (development) maxExportBatchSize, which is defined in terms of the number of metric data points.

Then we can add a declarative configuration surface for it as well. I think it should be possible to add a unit without it being a breaking change, but we need to check and make sure implementations didn't do something like name it "maxLogRecordBatchSize", or something that would make it harder to use for bytes.

I don't think library guidelines are the right place to put the specification for how SDKs handle batching.

@iblancasa
iblancasa marked this pull request as draft May 6, 2026 13:56
@jmacd

jmacd commented May 6, 2026

Copy link
Copy Markdown
Contributor

Please have a look at open-telemetry/opentelemetry-collector#15132: the same discussion is happening for collector exporterhelper.

@jmacd jmacd self-assigned this May 6, 2026
@github-actions

Copy link
Copy Markdown

This PR was marked stale. It will be closed in 14 days without additional activity.

@github-actions github-actions Bot added the Stale label May 23, 2026
@jmacd

jmacd commented May 26, 2026

Copy link
Copy Markdown
Contributor

please see https://gist.github.com/braydonk/78ec0cfe9079ab8b611f52c49830116c, recommend closing this PR. @braydonk

@github-actions github-actions Bot removed the Stale label May 27, 2026
@iblancasa iblancasa closed this May 27, 2026
@braydonk

Copy link
Copy Markdown
Contributor

For future readers: The project from the gist has been opened as a proper project proposal in the community repo. open-telemetry/community#3477

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.

Support configuring SDK batch size in declarative config using items or bytes

4 participants