feat: Increase trace payload limit from 2 MiB to 50 MiB #902
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.
This PR
Change the trace request limit from 2 MiB to 50 MiB.
Motivation
When the Node.js tracer layer sends a request to Lambda extension that's between 2 MiB and 50 MiB, the extension closes the HTTP connection, the tracer gets an
EPIPEerror and breaks. (Maybe the tracer should handle the error better, but that's out of scope of this PR.)According to @rochdev:
So let's change the limit on agent side to match the expectation.
Testing
Tested with Node.js 22 Lambda with this handler:
Before:
There are errors like:
After
When Lambda's memory is 1024 MB, the error no longer happens.
When Lambda's memory is 512 MB, the invocation can fail due to OOM. But I think that's a legit error. We can ask customers to increase memory limit for high-volume workload like this.
Notes
cc @astuyve who set a
MAX_CONTENT_LENGTHof 10 MiB in #294. This PR increases it to 50 MiB as well.Thanks @dougqh @duncanista @lucaspimentel @rochdev for discussion.
#899
Jira: https://datadoghq.atlassian.net/browse/SVLS-7777