SIGN IN SIGN UP

opentelemetry-exporter-otlp-proto-http: add max request size limit to OTLP HTTP exporters (#5369)

* opentelemetry-exporter-otlp-proto-http: add max request size limit to OTLP HTTP exporters

Implements the client side of opentelemetry-proto#782: serialized OTLP/HTTP requests larger than a configurable limit are dropped before sending, measured before compression. Adds a max_request_size keyword-only argument to the trace, log, and metric HTTP exporters. Default 64 MiB; 0 (or any non-positive value) disables. Mirrors opentelemetry-go#8157. Refs #4533.

* opentelemetry-exporter-otlp-proto-http: address review on max_request_size

Close the listening socket in the trace exporter's end-to-end HTTP server
tests by calling server_close() after shutdown()/join(), matching the shared
OtlpProtoTestServer utility, so the bound socket is not leaked across tests.

Document how max_request_size interacts with batch processors in the trace,
log, and metric exporter docstrings: batching groups telemetry by count
rather than serialized size, so a batch whose serialized request exceeds the
limit is dropped as a whole and recorded as a failed export. Note the
mitigation of tuning max_export_batch_size or raising/disabling the limit.

* opentelemetry-exporter-otlp-proto-http: move _DEFAULT_MAX_REQUEST_SIZE to _common

Define the 64 MiB default once in the package's _common module, alongside the
shared RequestPayloadTooLargeError and _is_request_too_large helpers, and import
it into the trace, log, and metric HTTP exporters instead of redefining it in
each. Addresses review feedback; no behavior change.
K
Krishna Chaitanya committed
6810d3d77e2690c122e497e5cf646373c10bc5c8
Parent: d585f6d
Committed by GitHub <noreply@github.com> on 7/23/2026, 9:57:27 PM