opentelemetry-python icon indicating copy to clipboard operation
opentelemetry-python copied to clipboard

Add HTTP OTLPMetricExporter configurable max export batch size, like gRPC

Open tammy-baylis-swi opened this issue 7 months ago • 0 comments

Is your feature request related to a problem?

When an instrumented service generates lots of metrics (many data points / high cardinality) and is configured to export by HTTP, it would help to limit how many metrics data points are exported with each request by splitting into multiple smaller requests.

Describe the solution you'd like

HTTP OTLPMetricExporter could support a configurable max_export_batch_size, like the gRPC OTLPMetricExporter already does (completed through issue https://github.com/open-telemetry/opentelemetry-python/issues/2710 with PR https://github.com/open-telemetry/opentelemetry-python/pull/2809) -- bonus for exporter consistency.

Describe alternatives you've considered

For some environments it's not possible to switch from HTTP to gRPC export to use the existing batching. For example, the OTel Lambda layer and OTel Operator image for Python are built by pre-installing dependencies (SDK, exporters, etc). It's not reasonable to pre-install grpcio because it requires a C extension specific to each Python version and architecture; layer/image size would bloat and builds would be slow.

Additional Context

  1. https://github.com/open-telemetry/opentelemetry-python/issues/2710
  2. https://github.com/open-telemetry/opentelemetry-python/pull/2809
  3. https://github.com/open-telemetry/opentelemetry-specification/issues/2772

Would you like to implement a fix?

Yes

tammy-baylis-swi avatar May 09 '25 18:05 tammy-baylis-swi