Using the sample code found at https://www.elastic.co/guide/en/apm/agent/nodejs/current/lambda.html I get an Ok response from the initial call but the error "APM Server transport error: Error: write after end" for subsequent calls, assuming this is due to the reuse of containers for 'warm' starts.
Turning on the debug log on the agent this error occurs attempting to 'sending transaction %o'
Hmm good question I wonder if this is somehow related to our new intake API that was released in APM Server v6.5 - as this will try to keep the connection open between requests.
Would it be possible for you to install the previous major version of the Node.js agent (^1.14.5) and see if the problem goes away? That version used the old intake API which is still supported by all 6.x versions of the APM Server.
I'm not saying this is a permanent solution, but it would point us in the right direction
I've created an issue so this can get fixed. I unfortunately don't know yet how complicated a fix will be, so it's hard to say how long it will take to fix it.
If you want to be using version 2.x of the agent in the meantime, you could try to set the apiRequestSize config option to a very low value to force it to close the HTTP request to the APM Server each time it transmitted a new event. Unless it's an issue with the underlying TCP socket, then this might be a temporary work around.
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.