Skip to content

docs: add request body size limitation#782

Open
pellared wants to merge 6 commits intoopen-telemetry:mainfrom
pellared:content-size-server
Open

docs: add request body size limitation#782
pellared wants to merge 6 commits intoopen-telemetry:mainfrom
pellared:content-size-server

Conversation

@pellared
Copy link
Copy Markdown
Member

@pellared pellared commented Mar 31, 2026

Per #781 (comment)

Add response body size limitation to mitigate memory usage risks

Reference: https://cwe.mitre.org/data/definitions/789.html

The values are taken from otlpreceiver defaults which are

  • gRPC - 4MiB (I think it would better be 20 MiB)
  • HTTP - 20 MiB

@pellared pellared marked this pull request as ready for review March 31, 2026 10:54
Comment on lines +119 to +129
The server MUST enforce a message size limit when receiving the request to
mitigate possible excessive memory usage caused by a misconfigured or malicious
server. The server implementations typically enforce a default incoming message
size limit of 4 MiB, which is acceptable to use. If the limit is exceeded, the
client MUST treat the error as not-retryable. Note that in such a scenario,
the gRPC server implementations return a `RESOURCE_EXHAUSTED` status code
to the caller.

The client SHOULD limit the size of the request message, including before
compression, to avoid overwhelming the server. It is RECOMMENDED to limit the
request message to 4 MiB.
Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am worried that the value is too small for profiles. However, I wanted to use the Collector defaults for initializing the conversation. Should we change it to 20 MiB? This would also follow the pattern from #781 where we agreed on the same size for gRPC and HTTP.

CC @open-telemetry/collector-maintainers @open-telemetry/profiling-maintainers

@pellared pellared requested a review from Copilot March 31, 2026 10:57
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the OTLP specification documentation to define request size/body limits for OTLP/gRPC and OTLP/HTTP, aiming to reduce memory-exhaustion risk from oversized payloads.

Changes:

  • Documented an OTLP/gRPC request message size limit recommendation (4 MiB) and client behavior on oversize errors.
  • Documented an OTLP/HTTP request body size limit recommendation (20 MiB) and recommended HTTP 413 handling semantics.
  • Added an Unreleased changelog entry for the documentation update.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
docs/specification.md Adds normative guidance for gRPC request message size limits and HTTP request body limits.
CHANGELOG.md Records the docs change in the Unreleased “Added” section.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +121 to +123
server. The server implementations typically enforce a default incoming message
size limit of 4 MiB, which is acceptable to use. If the limit is exceeded, the
client MUST treat the error as not-retryable. Note that in such a scenario,
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the gRPC request size-limit rationale, the actor is incorrect: excessive memory usage here would be caused by a misconfigured or malicious client sending an oversized request, not by a misconfigured/malicious server. This should be corrected to avoid confusing implementers about the threat model and responsibility.

Suggested change
server. The server implementations typically enforce a default incoming message
size limit of 4 MiB, which is acceptable to use. If the limit is exceeded, the
client MUST treat the error as not-retryable. Note that in such a scenario,
client sending an oversized request. The server implementations typically enforce
a default incoming message size limit of 4 MiB, which is acceptable to use. If the
limit is exceeded, the client MUST treat the error as not-retryable. Note that in

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants