Elastic APM intake/v2/rum/events requests cancelled

I have elastic apm setup for an angular 13 application (using npm package @elastic/apm-rum). I can see https://***.com/intake/v2/rum/events request going responding 202 and being cancelled after 10 secs.

In chrome console, I can see below warning -

[Elastic APM] Failed sending events! DOMException: The user aborted a request.

However, I can see data in the dashboard.

Why the requests are cancelled and how to solve this?

Kibana version:

Elasticsearch version:

APM Server version:

APM Agent language and version:

Browser version: Chrome 105.0.5195.125

Original install method (e.g. download page, yum, deb, from source, etc.) and version:

Fresh install or upgraded from other version? - Fresh Install

Is there anything special in your setup? - None

Description of the problem including expected versus actual behavior. Please include screenshots (if relevant):

Steps to reproduce:

  1. Load the angular application and check network

Errors in browser console (if relevant):

[Elastic APM] Failed sending events! DOMException: The user aborted a request.

Hi @bluestar ,

Thanks for raising this, The RUM agent has a default timeout of 10 seconds for sending the collected data to the APM server and past that, the browser cancels the request as we are past that configured timeout value.

Could you check if the APM server is reachable for those failed requests and if you can provide more debug information like the response headers and data if available.

Thanks,
Vignesh

Hi @vigneshshanmugam ,

APM server is reachable (see 202s), as stated before I can also see the data in the dashboard.

Please find details below -

Request

Request URL: https://***.com/intake/v2/rum/events

Request Method: POST

Status Code: 202

Remote Address: ...

Referrer Policy: strict-origin-when-cross-origin

Response Headers

access-control-allow-origin: https://***.com
content-length: 0
date: Tue, 27 Sep 2022 05:33:41 GMT
x-content-type-options: nosniff

Hi @bluestar,

Checking the screenshot I can see that sometimes the request is being sent properly and sometimes is not.

As @vigneshshanmugam said on a previous comment, the RUM agents times out a request after 10 seconds if the APM server does not respond.

Because of that I have the following questions:

  • What version of the Elastic Stack are you using?
  • What version of the APM server and RUM agent are you using?

When it comes to the APM version: there were a lot of improvements related to memory handling during the 7.x cycles, because of that, I highly recommend you to upgrade to at least 7.16 if possible

Thanks,
Alberto

H @Alberto_Delgado,

We are using version 8.4.1 for both.

Hi @bluestar,

It might be worth checking the size and CPU usage of the APM Server, and/or ES setup. Long response times indicate that the server cannot ingest events fast enough.

Do you have Stack Monitoring enabled to see if the issues happen when higher amount of events are processed?

Thanks,
Alberto

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