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

**URL:** <https://discuss.elastic.co/t/not-able-to-see-request-body-for-errors-in-nodejs-elastic-apm-agent-for-express-framework/336760>\
**Category:** APM\
**Tags:** nodejs\
**Created:** [June 23, 2023, 10:01am UTC](https://discuss.elastic.co/t/not-able-to-see-request-body-for-errors-in-nodejs-elastic-apm-agent-for-express-framework/336760 "2023-06-23T10:01:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![Kesha\_Shah](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kesha_shah/32/122625_2.png) [@Kesha\_Shah](https://discuss.elastic.co/u/Kesha_Shah)\
**Post date:** [June 27, 2023, 12:05pm UTC](https://discuss.elastic.co/t/not-able-to-see-request-body-for-errors-in-nodejs-elastic-apm-agent-for-express-framework/336760/5 "2023-06-27T12:05:54Z")

</div>

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

```auto
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 😃

Since it was not related to our current discussion, I have created new discussion [here](https://discuss.elastic.co/t/not-able-to-find-a-way-to-add-event-json-in-apm-serverless-lambda-transactions/336984)

---

_[View the full topic](https://discuss.elastic.co/t/not-able-to-see-request-body-for-errors-in-nodejs-elastic-apm-agent-for-express-framework/336760)._
