apm-agent-python
apm-agent-python copied to clipboard
APM agent crashes if the request body is too large
Describe the bug: ... When the request body is too large, reporting to the apm server fails. The error message is:
eapm event processor thread elasticapm.transport:286 - Failed to submit message: 'HTTP 400: {"accepted":4,"errors":[{"message":"event exceeded the permitted size." ...
To Reproduce
- Check the body's size before reporting. If it's too large, report the body as
[Too large]or something like that.
Environment (please complete the following information)
- OS: mac
- Python version: 3.7
- Framework and version [e.g. Django 2.1]: django==2.2.26
- APM Server version: ?
- Agent version: 5.10.1
Elastic apm configuration (in settings.py):
ELASTIC_APM = {
...
"CAPTURE_BODY": "all",
}
Additional context
The issue is that Django client extracts the request body without checking the size of the body. I believe that adding a size check in this function should solve the issue.
Fix open in #1610