Skip to content

Incorrect documentation for max_request_body_size #11066

@ntkme

Description

@ntkme

Describe the bug

https://github.com/open-telemetry/opentelemetry-collector/blob/main/receiver/otlpreceiver/config.md#confighttp-httpserversettings

The linked document says:

MaxRequestBodySize configures the maximum allowed body size in bytes for a single request. The default 0 means there's no restriction

However, in actual code if max_request_body_size is set to 0, the actual effective value is 20MiB, instead of no restriction:

const defaultMaxRequestBodySize = 20 * 1024 * 1024 // 20MiB

if hss.MaxRequestBodySize <= 0 {
hss.MaxRequestBodySize = defaultMaxRequestBodySize
}

Steps to reproduce

Send a larger than 20MiB payload to otlp receiver via otlp/http.

What did you expect to see?

Large payload is accepted

What did you see instead?

HTTP Status Code 400, Message=http: request body too large

What version did you use?

0.107.0

What config did you use?

Default otlp receiver config from otel collector helm chart 0.102.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions