Today SDK batching is generally described in terms of batch size limits such as max_export_batch_size, but the specification does not consistently define how SDKs should support sizing batches in different units across signals and configuration surfaces.
We want the specification to define SDK batching support in terms of:
items: the smallest independently splittable unit of telemetry (Spans, LogRecords, or metric points)
bytes: the serialized size of the batch
This should apply to SDK behavior in general, and it should also be expressible
through declarative configuration.
This should allow configurations such as:
tracer_provider:
processors:
- batch:
batch_size_unit: bytes
max_export_batch_size: 65536
exporter:
otlp_http:
endpoint: ${OTEL_EXPORTER_OTLP_ENDPOINT:-http://localhost:4318}/v1/traces
Expected scope:
- Define SDK support for configuring batch size in at least
items and bytes
- Define what
items means for traces, logs, and metrics
- Define that
bytes refers to serialized batch size
- Require SDKs to document which serialized representation is measured when
bytes is used
- Define that
max_export_batch_size is interpreted in the configured unit
- Define splitting behavior needed to enforce the configured maximum batch size consistently across signals
- Define how oversized individual items are handled
- Define how this is represented in declarative configuration for built-in batching components, for example via a
batch_size_unit property
This issue is about the specification changes needed to support that model. A corresponding schema change in opentelemetry-configuration would be needed afterwards.
We currently support this feature in the exporter helper from the OpenTelemetry Collector.
Today SDK batching is generally described in terms of batch size limits such as
max_export_batch_size, but the specification does not consistently define how SDKs should support sizing batches in different units across signals and configuration surfaces.We want the specification to define SDK batching support in terms of:
items: the smallest independently splittable unit of telemetry (Spans,LogRecords, or metric points)bytes: the serialized size of the batchThis should apply to SDK behavior in general, and it should also be expressible
through declarative configuration.
This should allow configurations such as:
Expected scope:
itemsandbytesitemsmeans for traces, logs, and metricsbytesrefers to serialized batch sizebytesis usedmax_export_batch_sizeis interpreted in the configured unitbatch_size_unitpropertyThis issue is about the specification changes needed to support that model. A corresponding schema change in
opentelemetry-configurationwould be needed afterwards.We currently support this feature in the
exporter helperfrom the OpenTelemetry Collector.