apm-agent-python icon indicating copy to clipboard operation
apm-agent-python copied to clipboard

APM agent crashes if the request body is too large

Open Ofekroz10 opened this issue 3 years ago • 1 comments

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

  1. 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.

Ofekroz10 avatar Mar 07 '22 12:03 Ofekroz10

Fix open in #1610

basepi avatar Aug 11 '22 19:08 basepi