How RUM and APM works

Hi,

I need your help to understand how RUM works. I've seen it linked to APM, but I know very little about APM.
Can someone describe how RUM works and how to use it?

Thank you very much.

Hi @GinkoLucas , great question!

So this is our pitch from our docs site here:

"Real User Monitoring captures user interaction with clients such as web browsers. The JavaScript Agent is Elastic’s RUM Agent.

Unlike Elastic APM backend agents which monitor requests and responses, the RUM JavaScript agent monitors the real user experience and interaction within your client-side application. The RUM JavaScript agent is also framework-agnostic, which means it can be used with any front-end JavaScript application.

You will be able to measure metrics such as "Time to First Byte", domInteractive, and domComplete which helps you discover performance issues within your client-side application as well as issues that relate to the latency of your server-side application."

So in my words, APM monitors and traces a back end system while RUM monitors real-time user activity on the front-end (browser) using Javascript. This means creating distributed tracing of front end navigation and metrics of performance (loads, paints, etc.)

Here's our docs to get up and running with RUM. I'd check out the distributed tracing and breakdown metrics sections in particular to get a good handle on things.

Let me know if this helps!

1 Like

Thank you for your help.

Can RUM be used without APM?

1 Like

I think there is a possibility to send RUM telemetry data to Elasticsearch directly, with an ingest pipeline to convert the data for ES consumption, but I've never tried it. You could even theoretically use an OTel collector as an intermediary to handle data processing, but again, that's untried and untested. You won't have the automatic correlations, visualizations, and out of the box Observability features that APM offers, but it might work.

Out of curiosity, is there any particular goal for implementing RUM with APM? Sounds like an interesting use-case.

Thx for your help.

I only need to get user metrics, so APM may not be mandatory. But from what I understand, it's still easier to use RUM with APM, so I'll do this.

So if I understand correctly, there's a script (RUM) in the HTTP requests (requests sent to the back-end), and in the back-end is the APM agent, right?

1 Like

I'll answer that for myself : RUM is front-end, and that's all. There nothing in the back, just an APM server on my Elastic Cloud deployment.

If there ever is a need, you may extend your RUM into your back-end as they will propagate a trace-id you would use to to see the entire path of your user's actions and impact. This might be useful in the future if you want to track user metrics and their impact on your application's performance. Glad I could help!

Oh that's interesting, can you tell me more?