APM Error Property in Payload is Empty

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 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 ?

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.

Anyone know why this is happening?

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.


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.

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