Your data. Anywhere you go.

New Relic for iOS or Android

Download on the App Store    Android App on Google play

New Relic Insights App for iOS

Download on the App Store

Learn more

Close icon

What aggregator function should I use in Timeseries widget?




I am now learning New Relic as a new monitoring tool for me. I used to use signalfx. It’s not clear to me why I cannot use a metric without an aggregate function to create timeseries widget. In signalfx, this is possible. Take for example the simplest metric - cpuPercent. I want to know how this metric has changed over time. Which function should I use? I thought that functions like latest (), average () or median () might work, but they all give different results on the graph (see screenshot). If I want to use timeseries, but am not sure about the choice of an aggregate function, which should I use by default?

Thank You!


Hi, @dananwork1: The reason you must use an aggregator function is that timeseries widgets can display a maximum of 366 data points; that means for time windows greater than 30 minutes, each data point contains aggregate data.

For time windows of 30 minutes or less, you can see that the aggregator functions simply return the value of each sample:

SELECT latest(cpuPercent), min(cpuPercent), max(cpuPercent) 
FROM SystemSample 
WHERE hostname = 'my-hostname' 
SINCE 20 minutes ago 
TIMESERIES 5 seconds

In your query above, you have specified TIMESERIES 15 minutes, meaning that each data point on the chart represents 180 samples (Infrastructure samples metrics every 5 seconds). Which sample should it display: The average? The minimum value? The maximum? The 90th percentile?

The aggregator function you choose is up to you; it depends on what data you want to see.