Elastic stack version 7.12.0 with Platinium licence
APM Agent language and version: nodeJS - 3.X (latest)
Run on k8s.
Our nodeJS application complains about timeout when sending APM events to intake API. I setup instrumentation on apm-server, and see POST /intake/v2/events can take more than 10s!
This Node.js APM agent issue can happen when the app using the agent is under fairly high load and/or the APM server is being slow or non-responsive. If possible, you could try this branch of the APM agent to see if that helps: GitHub - elastic/apm-agent-nodejs at trentm/blocking-behavior
I don't know apm-server that well, so I don't know if there could also be a server-side issue here. Seeing "queue is full" is the apm-server logs suggests that yes, there might be.
Those requests taking 10s might be normal behaviour. They are long-running requests that an APM agent can keep open while sending up data with a chunked-encoding. The agent's apiRequestTime (Configuration options | APM Node.js Agent Reference [4.x] | Elastic) config var defaults to 10s. That is the time after which it will close an intake request to the APM server and start a new one.
That is the best practice yes. It is slightly more subtle: the serverTimeout is a timeout on socket inactivity, so it will get reset if there is any data being sent through (like APM transactions or spans, or the agent's regular metricsets reporting). Also the agent is gzip'ing the data it sends so there is some buffering happening there as well.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.