> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trace0hq.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Browser Metrics

> Monitor real-user experience with Real User Monitoring (RUM) and Web Vitals.

## How are Metrics Calculated?

Trace0 calculates browser metrics from telemetry collected by the [OpenTelemetry Browser SDK and instrumentation libraries](https://github.com/open-telemetry/opentelemetry-browser).

See our [Browser JavaScript](https://docs.trace0hq.com/setup/browser-javascript.md) guide for instructions on instrumenting your application with the OpenTelemetry Browser SDK.

## Metrics

We currently display the following application metrics for browser services:

### RUM

**Single Value**

| Metric | Unit |
| - | - |
| Users | Number |
| Unique Sessions | Number |
| Events Per Session | Number |
| Sessions With Errors Rate | Percentage |

**Chart**

| Metric | Description | Chart Type |
| - | - | - |
| Event Count By Type | Number of browser events over time, per event type. | Line chart, one line per event type |
| Event Count By Page Route | Total number of browser events in the selected time period, per page route. | Horizontal bar chart, one bar per page route, sorted highest first |
| Event Count By Platform | Total number of browser events in the selected time period, per browser platform. | Horizontal bar chart, one bar per platform, sorted highest first |

![RUM Metrics Light 1](https://mintcdn.com/trace0/kXzJrFxt8xw-n1Wc/images/rum-metrics-1-light.png?fit=max\&auto=format\&n=kXzJrFxt8xw-n1Wc\&q=85\&s=a5ac825556099f7b4b1022206806f724)

![RUM Metrics Light 2](https://mintcdn.com/trace0/kXzJrFxt8xw-n1Wc/images/rum-metrics-2-light.png?fit=max\&auto=format\&n=kXzJrFxt8xw-n1Wc\&q=85\&s=44ea825af937290ddbcae22fd70a2927)

### Core Web Vitals

Each chart shows the 75th percentile (p75) value for the selected time period, its rating (`Good`, `Needs improvement` or `Poor`), the percentage of page loads rated Good, and the number of page loads. The chart background is shaded green, amber and red to show the rating ranges. Points with fewer than 5 samples are greyed out.

A status badge at the top shows **Passing** when the p75 of LCP, INP and CLS are all rated Good, **Failing** (with the metrics that are not Good) otherwise, and **Not enough data** when any of the three has no data.

Thresholds follow [Google's Web Vitals guidance](https://web.dev/articles/vitals).

| Metric | Description | Chart Type | How is it Calculated? |
| - | - | - | - |
| LCP (Largest Contentful Paint) | Time (in seconds) for the largest image or text block in the viewport to render. Measures loading speed. | Line chart, p75 over time | The p75 of the [LCP](https://web.dev/articles/lcp) values reported by page loads. |
| INP (Interaction to Next Paint) | Time (in ms) from a user interaction to the next paint. Measures responsiveness. | Line chart, p75 over time | The p75 of the [INP](https://web.dev/articles/inp) values reported by page loads. |
| CLS (Cumulative Layout Shift) | Unitless score of how much visible content shifts unexpectedly during the page's lifetime. Measures visual stability. | Line chart, p75 over time | The p75 of the [CLS](https://web.dev/articles/cls) values reported by page loads. |

![Core Web Vitals Metrics Light](https://mintcdn.com/trace0/kXzJrFxt8xw-n1Wc/images/core-web-vitals-metrics-light.png?fit=max\&auto=format\&n=kXzJrFxt8xw-n1Wc\&q=85\&s=08e951abbfb49238b4e316985fdb9f99)

### Loading Performance

Same layout as Core Web Vitals: p75 value, rating, % good, page loads, and shaded rating bands.

| Metric | Description | Chart Type | How is it Calculated? |
| - | - | - | - |
| FCP (First Contentful Paint) | Time (in seconds) until the first text or image is rendered. | Line chart, p75 over time | The p75 of the [FCP](https://web.dev/articles/fcp) values reported by page loads. |
| TTFB (Time to First Byte) | Time (in ms) from the start of navigation until the first byte of the response arrives. | Line chart, p75 over time | The p75 of the [TTFB](https://web.dev/articles/ttfb) values reported by page loads. |

Thresholds follow [Google's Web Vitals guidance](https://web.dev/articles/vitals).

## Example Service

To see these metrics in action, check out our example apps for working Browser JavaScript services with Trace0 installed:

| Example | Environment |
| - | - |
| [React Frontend example app](https://github.com/Trace0-HQ/trace0-examples/tree/main/react-frontend) | Browser (React) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.