AWS RUM: Web App Performance Monitoring
Published: 2021-12-01 18:30:10

As monitoring increases in necessity, so does the need for monitoring specific types of applications and more importantly, different pieces of the application. As software becomes more complex, engineers need to have a way to properly monitor performance and MTTR (Mean Time To Resolve). Otherwise, users will go just as fast as they came to use an application.

At AWS re:Invent 2021, AWS RUM was announced to solve that exact problem.

In this blog post, you'll learn about what RUM is and how you can get started.

## What is AWS RUM

Monitoring application performance, health, and efficiency are crucial. Anything from how an application is working to the code quality to how it's deployed should be in a constant state of monitoring. Otherwise, issues will continue to pop up that you'll either have to resolve in a "putting out the fire" method or you'll be too deep into tech debt to actually fix an issue once you realize it exists.

Standard APM solves one problem, but what about if you want the ability to monitor in real-time? As if it were a literal user using the application? Not only that, but across multiple devices, geolocations, and web browsers? The ability to do this exists, but not without heavy engineering and creating a way to do it from scratch.

Welcome to RUM. AWS RUM is a real-user monitoring solution that's part of the CloudWatch monitoring family to help identify bugs, fix performance issues, view anomalies, and fix app concerns in near real-time.

## Why Should You Care

There are between 1.6 and 1.9 billion web applications in the world.

Think about it for a second; what business in today's world doesn't have a website? What business doesn't have some type of application? Unless it's a small mom and pop shop (and even then, there are many websites) there aren't many businesses that don't have some type of web app.

When thinking about the complexity of an application; different browsers (google, edge, safari, etc.), mobile browsers, user locations, different styles of connectivity, how can you properly test it all? Sure, there are testing methods available, but it's all artificial. 

Simply put, testing application performance for web apps needs to be more real-world at this point.

## Getting Started

In this section, you'll learn how to get started with AWS RUM.

First, log into the AWS portal and go to the [AWS RUM service](https://console.aws.amazon.com/cloudwatch/home?region=us-east-1#rum:dashboard?tab=overview) under CloudWatch and click the orange **Add app monito**r button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gdeqpfitcnpwmdog17lm.png)

Next, specify details like the app monitor name (whatever name you want) and the website.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/d2m2otk0cic6v6hp5c6j.png)

Under the data collection section, you can choose what you want to monitor:

- Performance telemetry
- JavaScript errors
- HTTP errors

You'll also have the opportunity to have RUM set cookies if you wish.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0rl9n9u8kbykn7036ws1.png)

Next, specify the sessions that you want to be analyzed. Ideally, you want all sessions analyzed to collect as much data as possible.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m2r8a9ragohsabipuhbr.png)

Because AWS RUM is a service, it'll need proper permission. You can create a new identity pool, use an existing pool, or set up private auth from outside of AWS. Once complete, click the orange **Add app monitor** button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yujos8lasyq126pk61jz.png)

The final screen will show a JavaScript snippet. You'll need to copy the snippet and put it into your HTML `<head>` section.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jx8ih8ku4nxr9tl7qj22.png)

Once you copy the JavaScript snippet and put it into the `<head>` section of your HTML code, you'll be able to start monitoring the app!