# APM Error Property in Payload is Empty

**URL:** <https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911>\
**Category:** APM\
**Tags:** rum\
**Created:** [May 11, 2020, 2:35am UTC](https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911 "2020-05-11T02:35:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![edarioq](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@edarioq](https://discuss.elastic.co/u/edarioq)\
**Post date:** [May 11, 2020, 2:35am UTC](https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911/1 "2020-05-11T02:35:00Z")

</div>

**Kibana version** : 7.6.2

**Elasticsearch version** : 7.6.2

**APM Server version** : 7.6.2

**APM Agent language and version** : `@elastic/apm-rum-angular` 1.1.1. Angular 9.1.0

**Browser version** : Firefox 76.0b8

**Original install method (e.g. download page, yum, deb, from source, etc.) and version** : Used the [Angular Integration](https://www.elastic.co/guide/en/apm/agent/rum-js/master/angular-integration.html) instructions

I have an integration of the above on Angular, whenever a regular type error, or recursion error occurs, the JavaScript RUM agent works flawlessly and sends the error to APM.

However whenever an HTTP error occurs, for example sending a GET request to an endpoint that doesn't exists (404), the Payload error property shows up as empty. Is this normal ?

 ![Screen Shot 2020-05-10 at 9.29.41 PM](https://us1.discourse-cdn.com/elastic/original/3X/4/9/498cc3dd0d0986193392a1a5d33120ea40a6fbd1.png)

Because of the above I created an Angular HTTP Interceptor and whenever an HTTP error occurs, manually call `captureError` to send an error to APM/Kibana. But this has it's own problems, it lacks several important indexes, such as the type of HTTP error. See [this post](https://discuss.elastic.co/t/sending-http-error-to-apm-from-angular-shows-error-custom-name-field-in-kibana/231898).

Anyone know why this is happening?

---

<div class="post-metadata">

**Author:** ![vigneshshanmugam](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vigneshshanmugam/32/40324_2.png) [@vigneshshanmugam](https://discuss.elastic.co/u/vigneshshanmugam)\
**Post date:** [May 11, 2020, 8:46am UTC](https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911/2 "2020-05-11T08:46:11Z")

</div>

Hi Edgar,

The reason is 404 is a considered a valid response and the HTTP span inside the transaction would contain all the information related to the request (eg: status, url etc). RUM agent does not treat the failed network request as an error.

Let me know if you have any further questions.

Thanks,  
Vignesh

---

<div class="post-metadata">

**Author:** ![edarioq](https://avatars.discourse-cdn.com/v4/letter/e/bc79bd/32.png) [@edarioq](https://discuss.elastic.co/u/edarioq)\
**Post date:** [May 11, 2020, 2:05pm UTC](https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911/3 "2020-05-11T14:05:00Z")

</div>

Hi @vigneshshanmugam, thanks for the reply. So what would be the best way to report this to APM as an indexable error? I think a 404 (or 500) response to an API request is an error that should appear in Kibana.

For example, is it possible to `apm.addLabels()` on a per error basis. Meaning that, for example, if I have a 504 error, this gets logged to APM with `apm.captureError()` and I add additional fields such as the HTTP error type, URL, etc. with `apm.addLabels()` that are indexable. But if for example I have a normal error, let's say infinite recursion or such, then that actually works gets logged by the RUM agent quite nicely so I don't need to do anything extra, but it shouldn't go with any additional labels added from `apm.addLabels()` like the HTTP error type.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 1, 2020, 10:05am UTC](https://discuss.elastic.co/t/apm-error-property-in-payload-is-empty/231911/4 "2020-06-01T10:05:05Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.
