Problem Statement
The OTLP/HTTP specification requires clients to limit response-body size and recommends making that limit configurable. The Go OTLP/HTTP trace, metric, and log exporters currently use a fixed 4 MiB limit, so users cannot lower the limit to reduce memory exposure or raise it for legitimate larger responses.
This work was started in #8443. The original author no longer has bandwidth to continue that PR, so this issue tracks the remaining work for another contributor.
Proposed Solution
Add a WithMaxResponseBodySize(size int64) option to the OTLP/HTTP trace, metric, and log exporters.
- Preserve the current finite 4 MiB default.
- Apply the configured limit to response-body bytes read after decompression.
- Do not allow non-positive values to disable the limit; reject them or retain the default.
- Keep the shared configuration templates and generated exporter code consistent.
- Add tests and documentation for the default, configured, and invalid-value behavior.
Alternatives
Keep the fixed 4 MiB limit. This preserves the existing safety bound but does not implement the specification recommendation that the limit be configurable.
Prior Art
Additional Context
The OTLP/HTTP specification describes the response-size requirement here: https://github.com/open-telemetry/opentelemetry-proto/blob/41ad255e3efd5450096fc167ef6d87edb4bcb4f3/docs/specification.md#L522-L527
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.
Problem Statement
The OTLP/HTTP specification requires clients to limit response-body size and recommends making that limit configurable. The Go OTLP/HTTP trace, metric, and log exporters currently use a fixed 4 MiB limit, so users cannot lower the limit to reduce memory exposure or raise it for legitimate larger responses.
This work was started in #8443. The original author no longer has bandwidth to continue that PR, so this issue tracks the remaining work for another contributor.
Proposed Solution
Add a
WithMaxResponseBodySize(size int64)option to the OTLP/HTTP trace, metric, and log exporters.Alternatives
Keep the fixed 4 MiB limit. This preserves the existing safety bound but does not implement the specification recommendation that the limit be configurable.
Prior Art
Additional Context
The OTLP/HTTP specification describes the response-size requirement here: https://github.com/open-telemetry/opentelemetry-proto/blob/41ad255e3efd5450096fc167ef6d87edb4bcb4f3/docs/specification.md#L522-L527
Tip: React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding
+1orme too, to help us triage it. Learn more here.