Create Charts with RUM Custom Metrics
Overview
RUM-based custom metrics let you summarize event data from your browser and mobile applications and visualize trends for up to 15 months. After you create a custom metric, you can use it anywhere Datadog metrics appear, including dashboards, notebooks, and SLOs.
Add a RUM custom metric to a dashboard
- Open an existing dashboard or create a dashboard.
- Click Add Widgets and select a widget type. See Choose the right widget for guidance.
- In the widget editor, set the data source to Metrics.
- Enter your custom metric name, for example
rum.sessions.count_by_geography. - Apply tag filters to scope the data, for example
env:prod. - Select a group by tag to break down the data, for example
@application.name. - Click Save to add the widget to your dashboard.
The following table maps common RUM use cases to widget types:
| Use case | Recommended widget |
|---|
| Error rate or session count over time | Timeseries |
| Top pages by load time | Top List |
| Single KPI such as crash-free rate | Query Value |
| Distribution of load times (requires percentile aggregation) | Distribution |
| Breakdown by country or version | Geomap or Top List |
You can combine multiple RUM custom metrics in a single widget using formulas. This is useful for calculating derived values such as rates and ratios.
For example, to calculate a crash-free rate, create two custom metrics:
rum.sessions.crash_free: A count of sessions that complete without a crash.rum.sessions.total: A count of all sessions.
In the widget editor, add both metrics as separate queries, then enter the formula a / b * 100 to calculate the percentage.
Use template variables for reusable charts
Template variables let you create dashboards that work across multiple applications, environments, or versions without duplicating widgets.
To add a template variable to a dashboard:
- Click Add Variable at the top of the dashboard.
- Select Metrics as the data source.
- Choose a tag key such as
application.name, env, or version.
After you add the variable, reference it in widget queries using the $variable_name syntax. For example, filter a widget to application.name:$application to let viewers select which application to display.
Charting examples
Track conversion funnel drop-off by country
Use a Geomap widget with a custom metric that counts completed checkout sessions grouped by country. Filter to @session.type:user to exclude synthetic traffic, and group by the @geo.country tag to visualize where users drop off in your conversion funnel.
Monitor crash-free rate by release version
Use a Timeseries widget with the formula pattern from the Combine metrics with formulas section to track crash-free rate over time. Group by version to compare stability across releases and detect regressions introduced by specific builds.
Visualize page load performance trends
Use a Distribution widget with a distribution metric that has percentile aggregation enabled to display P50, P75, P90, and P99 values. Filter to a specific view name to focus on a critical page, such as a checkout or sign-up flow.
Further reading
Additional helpful documentation, links, and articles: