Not able to see request body for errors in NodeJS elastic-apm agent for express framework

Thanks @trentm for the reply. Adding transaction filter has solved my issue and I am able to capture body for all my failed http transactions.

I have tried debugging more on error body just for curiosity but its not even going to addErrorFilter in my case in the case of

app.post('/err1', async (req, res, next) => {
  console.log(`received request: ${req.method} ${req.url}, content-type:${req.headers['content-type']}`);
  next(new Error('boom sent to next'));
});

Since its not really my use case any more I have not spent much time debugging this.

After resolving my request body issue with your help, I am trying to configure aws lambda serverless functions to APM and I was not able to find a way to add event.json to my transactions as well :smiley:

Since it was not related to our current discussion, I have created new discussion here