Reduce New Relic Costs: How to Extend New Relic Browser Event Data Retention with Aggregated Metrics
Learn how to extend New Relic Browser event data retention beyond the default 8 days using aggregated metrics. Discover how to track performance trends, optimize storage costs, and configure the Metric Aggregator for long-term insights. Gain actionable tips for using New Relic's tools to monitor key metrics like page load times and backend performance over 13 months.
Introduction
If you rely on New Relic Browser events to track user experience and monitor frontend performance, you may have noticed a limitation: browser event data is only retained for 8 days by default. For teams wanting to analyze trends over months rather than days, this short retention period can hinder historical insights and trend analysis. But there’s a workaround: using aggregated metrics, you can store key Browser performance data over extended periods—up to 13 months. In this post, we’ll show you how to use New Relic's Metric Aggregator and API options to maximize data insights without blowing up your storage costs.
Why Browser Event Data Retention Matters
Browser events—such as page load times, JavaScript errors, and user interactions—offer valuable insights into the health and performance of your application’s frontend. However, with only 8 days of retention, you’re left with a narrow window for detecting long-term performance trends or diagnosing issues that evolve slowly over time. To avoid losing these insights, you can leverage aggregated metrics to preserve essential data points like average load time or error rates. This method allows you to track changes in performance over months, not just days.
When extending browser event storage, it's crucial to ensure that all relevant data is captured. Without proper tracking, missing transactions could complicate your observability setup. If you're experiencing such issues, our guide to missing transactions in New Relic covers troubleshooting steps to help resolve these problems.
The Power of Aggregated Metrics for Browser Data
Instead of storing every raw browser event, aggregated metrics summarize key data points over time, enabling you to track trends without the overhead of retaining all individual events. This approach extends data retention for critical insights like frontend performance while controlling storage costs.
For example, you can use New Relic to aggregate performance metrics such as End User Time and App Server Time as metrics and then query those metrics for longer time periods:
FROM Metric SELECT average(PageView.duration.summary) as 'End User Time', average(PageView.backendDuration.summary) as 'App Server Time' SINCE 3 months ago TIMESERIES UNTIL now
This query extracts aggregated averages for frontend and backend durations over the past 3 months, broken down into a time series. By using such metrics, you can:
Track user experience trends (e.g., page load times).
Monitor backend performance over extended periods.
Reduce storage needs while maintaining actionable insights.
Aggregated metrics provide a practical way to observe trends like slowdowns or improvements in user experience and backend response times without relying on full raw browser event storage.
Let's take a look at how we can achieve this.
How to Use the Metric Aggregator for Browser Data Aggregation
New Relic’s Metric Aggregator simplifies the process of summarizing raw event data into actionable, long-term metrics. Here’s how you can use it to track key Browser performance metrics, like End User Time and App Server Time, by first querying raw data and then aggregating it for storage efficiency.
Step 1: Access the Metric Aggregator App in New Relic
Navigate to the App Catalog in your New Relic dashboard and search for the Metric Aggregator tool.
Install the tool to your New Relic account to start setting up aggregations.
Step 2: Query Raw Data (Before Aggregation)
Before aggregating, you’ll typically query the raw data to get a sense of the performance metrics you want to track. Here's a basic query you might use to measure End User Time and App Server Time:
SELECT average(duration) as 'End User Time', average(backendDuration) as 'App Server Time' FROM PageView SINCE 1 day ago TIME SERIES
Explanation: This query pulls raw data from the
PageView
event type for the past day, calculates averageduration
(End User Time) andbackendDuration
(App Server Time), and breaks it down into time-series data (e.g., hourly).This query gives you a time-series view of how your user experience and server performance are trending over the last 24 hours, but storing raw data like this over a long period can quickly become expensive.
Step 3: Configuring the Metric Aggregator for Browser Data Aggregation
The Metric Aggregator tool in New Relic simplifies the process of summarizing raw event data into aggregated metrics, making it ideal for extending the retention of Browser event data. Here’s a step-by-step guide on what to choose and configure when setting up the Metric Aggregator for tracking End User Time and App Server Time.
From the Metric Aggregator App choose Create Rule.
Choose the Metric Source: When configuring the Metric Aggregator, select the
PageView
event type, since you're aggregating Browser data (e.g.,duration
andbackendDuration
).Metric Fields: The primary metrics you want to aggregate are
duration
andbackendDuration
. However, these raw fields will first be summarized by the Metric Aggregator into more efficient aggregated metrics.
Here's the query that would be configured in the Metric Aggregator:
FROM PageView SELECT summary(`duration`) AS 'PageView.duration.summary' FACET `appName`
Explanation:
summary(duration)
: This is the aggregation function applied to theduration
field, which calculates the summary statistics for page load times across your application.
This query ensures that your Browser metrics are aggregated by duration
and summarized across all instances of the app, which helps reduce the storage overhead while maintaining valuable performance insights.
Aggregation Method: For this example, you're using
summary
, which gives you a comprehensive aggregation ofduration
(e.g., sum, average, min, max, etc.).The
summary
function gives a detailed overview of the metric's behavior across allPageView
events, making it efficient for tracking performance trends without storing every raw event.
You can choose other methods like average or sum depending on the specific metric you need, but for time-related metrics like
duration
, summary is often the best choice.
Step 4: Query the Aggregated Metrics and use them in Dashboards
Once you’ve configured the Metric Aggregator to aggregate the Browser event data, you can now query the newly created aggregated metrics directly from New Relic. These metrics, such as End User Time and App Server Time, will be available for historical analysis over the default metric retention period (13 months).
Example Query for Aggregated Metrics
After the aggregation is set up, you can query the new metrics using the following query:
FROM Metric SELECT average(PageView.duration.summary) as 'End User Time', average(PageView.backendDuration.summary) as 'App Server Time' SINCE 1 day ago TIMESERIES UNTIL now
Explanation:
FROM Metric
: This tells New Relic to pull data from the Metric event type, which contains the aggregated values you configured earlier.SELECT average(PageView.duration.summary)
: This pulls the average of the aggregated PageView.duration.summary metric, representing the End User Time.SELECT average(PageView.backendDuration.summary)
: Similarly, this retrieves the average of the PageView.backendDuration.summary metric, representing the App Server Time.SINCE 1 day ago
: This sets the query’s time range to include data from the last 24 hours. You can adjust this to any period based on your needs (e.g.,1 week ago or last month).TIMESERIES UNTIL now
: This ensures the data is returned in a time-series format, allowing you to track trends over time.
Using the Aggregated Metrics in Dashboards and Alerts
Once you’ve run this query, the aggregated metrics will appear in your New Relic Dashboards as time-series data. You can use these values to monitor performance over time, create visualizations, and even set up alerts to notify you if any of these metrics exceed predefined thresholds during the 13 month period.
Remember, expanding your event storage capacity is only part of the equation. It's also vital to ensure that transactions are being captured accurately. For more guidance on preventing missing transactions, check out our New Relic missing transactions guide.
Ready to optimize your observability strategy?
Learn more about how our services can help transform your New Relic implementation into measurable business outcomes.
FAQs
What is New Relic Browser Event Data Retention? New Relic Browser event data retention refers to how long New Relic stores browser-related metrics, such as page load times and JavaScript errors. By default, this data is retained for 8 days, but it can be extended using aggregated metrics.
Why does New Relic limit browser event data retention to 8 days? The 8-day retention limit is intended to optimize storage and performance for the majority of use cases. However, for teams who need long-term historical data, aggregated metrics provide a way to extend this retention period without excessive storage costs.
How can I extend the retention period for New Relic Browser event data? You can extend the retention period by using New Relic’s Metric Aggregator to summarize key performance data over extended periods. This allows you to retain essential metrics, like average load times, for up to 13 months.
What are aggregated metrics in New Relic, and how do they help? Aggregated metrics in New Relic summarize raw event data over time, providing insights without storing every individual event. This reduces storage requirements while still allowing you to track important performance trends, like page load times or error rates.
How do I use New Relic's Metric Aggregator to extend data retention? The Metric Aggregator allows you to query and aggregate raw data from browser events, like page load times, and store these summaries for extended periods. By setting up aggregation rules, you can track key metrics over 13 months without retaining every individual event.