Skip to content

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

@iblancasa

Description

@iblancasa

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    spec:miscellaneousFor issues that don't match any other spec labeltriage:deciding:community-feedbackOpen to community discussion. If the community can provide sufficient reasoning, it may be accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions