Monitoring Frontend Performance with Amazon CloudWatch RUM - Real User Monitoring

Simply embed a JavaScript snippet to collect page load times, Web Vitals, JS errors, and HTTP errors in real time. This article explains how to visualize frontend quality using session replay and custom events.

Overview of CloudWatch RUM

CloudWatch RUM (Real User Monitoring) is a service that monitors web application frontend performance in real time. By simply embedding a JavaScript snippet in your page, it automatically collects page load times, Web Vitals (LCP, FID, CLS), JavaScript errors, and HTTP errors from actual users' browsers. Unlike Synthetic Monitoring (CloudWatch Synthetics), which runs scripted periodic synthetic tests, RUM collects data from real user sessions. You can configure a sampling rate to control data collection volume - collecting 100% of all sessions or reducing to 10% to save costs.

Web Vitals and Performance Analysis

RUM automatically collects Google's Core Web Vitals (LCP: Largest Contentful Paint, FID: First Input Delay, CLS: Cumulative Layout Shift) and displays per-page performance scores on a dashboard. Waterfall analysis of page loads visualizes the time spent in each phase: DNS resolution, TCP connection, TLS handshake, TTFB (Time to First Byte), and content download. Performance comparisons by browser, OS, and region help identify issues that occur only in specific environments. You can also send custom events to track user actions such as button clicks, form submissions, and page transitions.

Error Tracking and X-Ray Integration

JavaScript errors (unhandled exceptions, Promise rejections) and HTTP errors (4xx, 5xx responses) are automatically captured, with error frequency, affected session counts, and stack traces displayed on the dashboard. When X-Ray integration is enabled, you can obtain end-to-end traces from frontend requests through backend API Gateway, Lambda, and DynamoDB. You can trace whether an error in a user's browser originated from a specific backend service in a single trace, dramatically improving root cause identification. Cognito integration lets you identify authenticated user sessions and analyze specific users' experiences in detail.

CloudWatch RUM Pricing

CloudWatch RUM pricing is pay-per-use based on the number of events collected. It costs approximately 1.00 USD per 100,000 events (as of August 2026). A single page view generates multiple events (page load, Web Vitals, errors, and so on), so estimate costs at roughly 5-10 events per page view. Lowering the sampling rate can reduce costs, but there is a trade-off with statistical accuracy. If X-Ray tracing is enabled, X-Ray charges (approximately 0.000005 USD per trace) apply separately.

Implementation and Sampling Design

You can start using RUM simply by embedding measurement code in your pages. Even if you deliver your app through CloudFront, embedding the snippet enables measurement of real users. Decide the proportion of sessions to collect (the sampling rate) by balancing accuracy and cost. On high-traffic sites, collecting everything is costly, so you can still grasp the trends well enough even if you narrow collection to a certain proportion. Conversely, when traffic is low, set a higher proportion to ensure statistical reliability. Design an appropriate collection volume according to the size of the site and the purpose of analysis.

Setting Alerts and Quality Targets

Use the metrics collected by RUM in combination with CloudWatch alarms. If you set alerts such as notifying you when Web Vitals like display speed or input responsiveness deteriorate, or when the error rate exceeds a certain level, you can quickly notice degradation of the user experience. For important pages, define quality targets and continuously monitor that quality does not fall below them. It is also effective to compare metrics before and after deployments and confirm that changes have not harmed the experience. By visualizing the numbers and operating with clear standards, you can keep quality consistent.

Privacy Considerations

Since you collect real users' data, consideration for privacy is indispensable. Design collection so that the information does not include data that could identify individuals, and limit it to what is necessary. Depending on regional regulations and your company's policies, also consider providing a mechanism to obtain users' consent for measurement. Define a retention period for collected data, and delete data when it is no longer needed. Stating clearly in your privacy policy what you collect and for what purpose, and maintaining transparency, builds trust. Take care that measurement for convenience does not undermine users' rights.

Using RUM in the Improvement Cycle

The value of RUM is realized only when the collected data leads to actual improvements. Identify which metrics are poor on which pages, and give priority to addressing those with larger impact. By looking at differences by browser, region, and device, you can pinpoint problems that occur only in specific environments. After deploying fixes, check whether the metrics have improved and verify the effect. If you trace where errors occur all the way to backend traces, you can reach the root cause. Continuing to run the cycle of measurement, analysis, improvement, and verification supports continuous improvement of frontend quality.

Summary

CloudWatch RUM is a service that monitors frontend performance and errors in real time simply by embedding a JavaScript snippet. With automatic Web Vitals collection, waterfall analysis, and end-to-end tracing via X-Ray integration, you can quickly identify and resolve user experience issues.

References (Official AWS Resources)

The primary sources for this page are the official AWS website and documentation. Check the official pages below for the latest specifications and pricing.

If this page and the official documentation disagree, treat the official documentation as authoritative.

Share