fix(lifecycle): raise axum body limit to 6 MB for large Lambda payloads#1044
Open
litianningdatadog wants to merge 2 commits intomainfrom
Open
fix(lifecycle): raise axum body limit to 6 MB for large Lambda payloads#1044litianningdatadog wants to merge 2 commits intomainfrom
litianningdatadog wants to merge 2 commits intomainfrom
Conversation
axum 0.7+ applies a 2 MB default body limit globally, causing the /lambda/start-invocation endpoint to reject payloads larger than 2 MB with "length limit exceeded". Raises the limit to 6 MB to match Lambda's maximum synchronous invocation payload size. Fixes #1041
duncanista
approved these changes
Feb 24, 2026
duncanista
reviewed
Feb 26, 2026
Comment on lines
+40
to
+42
| // Lambda's maximum synchronous invocation payload size | ||
| // reference: https://docs.aws.amazon.com/lambda/latest/api/API_Invoke.html | ||
| const LAMBDA_INVOCATION_MAX_PAYLOAD: usize = 6 * 1024 * 1024; |
Contributor
There was a problem hiding this comment.
Wondering how would this look like with streaming lambda payload... do we have guards to not send the payload if it goes over the limit?
Contributor
There was a problem hiding this comment.
Because in streaming the max is 200MB
Contributor
There was a problem hiding this comment.
I mean good for now, but we might want to leave a comment about streaming
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
https://datadoghq.atlassian.net/browse/SVLS-8609
Issue reported: #1041
Summary
/lambda/start-invocationendpoint was rejecting payloads larger than 2 MB withlength limit exceededDefaultBodyLimit::max(6 * 1024 * 1024)) to match Lambda's maximum synchronous invocation payload sizeTest plan
bash local_tests/repro-large-payload.shwhich sets up the local test env and sends a 3 MB payload to/lambda/start-invocationand verifies HTTP 200 with nolength limit exceedederror{"level":"ERROR","message":"DD_EXTENSION | ERROR | Failed to extract request body: Failed to buffer the request body: length limit exceeded"}{"level":"DEBUG","message":"DD_EXTENSION | DEBUG | Received start invocation request from headers:{\"datadog-meta-lang\": \"java\", \"user-agent\": \"curl/8.3.0\", \"host\": \"localhost:8124\", \"lambda-runtime-aws-request-id\": \"test-large-payload-request\", \"expect\": \"100-continue\", \"accept\": \"*/*\", \"content-length\": \"3200074\", \"content-type\": \"application/json\"}"}