We're seeing behavior where our instrumentation interferes with the usual return value after a function's initial deployment.
- Create a Lambda Function hooked up to API Gateway
- Configure the env variables
ELASTIC_APM_SECRET_TOKEN, ELASTIC_APM_SERVER_URL, and ELASTIC_APM_SERVICE_NAME with legitimate values
- Ensures the Lambda's
node_modules folder contains the elastic-apm-node source and its dependencies
- Change your lambda source so it looks like the following
const apm = require('elastic-apm-node').start()
exports.handler = apm.lambda(function handler (event, context, callback) {
callback(null, `Hello World`)
})
- Click the Deploy Button
- Invoke your function via its API gateway URL or the aws cli invoke command two times
Expected Behavior: Function returns value Hello World
Actual Behavior: The first invocation after a deploy returns null -- subsequent invocations return the expected Hello World value