← Writings

NRQL Predictions: Forecasting Future Trends in New Relic

2026-05-20observabilityNRQLMLforecasting

Overview

NRQL predictions in New Relic uses your time series' historical data patterns to predict future trends, providing insights into how metrics might behave in the future.

[!IMPORTANT] NRQL predictions are only compatible with time series queries using the TIMESERIES clause.

How It Works

The system fits a machine learning model to historical data and projects it forward. It supports both seasonal and non-seasonal time series.

Algorithm

NRQL predictions use the Holt-Winters (triple exponential smoothing) algorithm:

SeasonalityDescriptionMin Data Required
HourlyEach minute behaves like the same minute in past hours2 hours
DailyEach hour mirrors the same hour from yesterday2 days
WeeklyEach day repeats weekly patterns2 weeks

Usage

Basic prediction query:

FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT

With a custom prediction window:

FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT BY 30 minutes

With specified seasonality:

FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(seasonality: 1 hour)

When to Use Predictions

  • Disk space running out as log volume increases
  • Memory leaks slowly consuming container resources
  • Projecting future infrastructure costs based on growth trends

System Architecture

Hyperparameters

For advanced users, you can tune the model:

ParameterEffectRange
alphaLevel smoothing — higher = more weight on recent values0 to 1
betaTrend smoothing factor0 to 1
gammaSeasonal smoothing (not for non-seasonal)0 to 1
phiTrend damping — lower = flatter long-term forecast0.98 to 1

Example with all parameters:

FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES
PREDICT holtwinters(alpha: 0.2, beta: 0.5, gamma: 0.5, phi: 0.99)
BY 1 hour USING 2 hours

[!TIP] The default PREDICT clause (no extra keywords) gives the best results for most use cases. Only customize if you need fine-grained control.