Apm-server gives error "message": "event exceeded the permitted size."

Hi Team,

I am using elastic apm java agent 1.49 version along with elasticsearch,kibana and apm-server with version 8.5.1

I am having few transactions wherein i see following message :

Response body: {
  "accepted": 105,
  "errors": [
    {
      "message": "event exceeded the permitted size.",
      "document": "json document"
    }
  ]
}

I tried increasing the max_event_size to 10000000 in the apm-server.yml and restarted the apm-server and then performed transactions. Still I am facing the same issue.

Are there any additional properties that needs to be in the configurations and are been missed out.
Kindly advise.

Thanks & Regards,
Namita Jaokar

This isn't an error from the Java agent, but presumably there is somehow a too large json document being sent to the apm server. Turn on DEBUG level in the Java agent and look for the error messages related to this (there should be something about being rejected by the APM server) so that you can see exactly what the json doc it refers to is. (If the DEBUG level shows the error but insufficient information, try again with TRACE level using the earlier DEBUG log to identify exactly where to look as TRACE is very verbose). Then we'll have some more information to look at