|
| 1 | +--- |
| 2 | +title: NRQL Predictions |
| 3 | +tags: |
| 4 | + - Prediction on a chart |
| 5 | + - Forecasting on a chart |
| 6 | + - NRQL Predictions |
| 7 | + - Forecasting |
| 8 | +metaDescription: 'Use NRQL Predictions to predict future trends and potential performance issues.' |
| 9 | +redirects: |
| 10 | +freshnessValidatedDate: never |
| 11 | +--- |
| 12 | +<Callout title="preview"> |
| 13 | + We're still working on this feature, but we'd love for you to try it out! |
| 14 | + |
| 15 | + This feature is currently provided as part of a preview program pursuant to our [pre-release policies](/docs/licenses/license-information/referenced-policies/new-relic-pre-release-policy). |
| 16 | +</Callout> |
| 17 | + |
| 18 | +<DNT>**NRQL Predictions**</DNT> in New Relic uses historical data to predict future trends, providing insights into how metrics might behave in the future. This proactive approach helps you visualize trends and anticipate potential issues, enabling timely interventions to maintain optimal system performance. While <DNT>**NRQL Predictions**</DNT> itself does not identify potential issues, it equips you with the information needed to assess trends and plan for future challenges. |
| 19 | + |
| 20 | + |
| 21 | +For automatic identification of potential issues, you can enroll for the <DNT>**[Predictive Alerts](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions)**</DNT> feature, currently available in public preview. <DNT>**Predictive Alerts**</DNT> work alongside <DNT>**NRQL Predictions**</DNT> to automatically trigger alerts when projected trends indicate a potential issue, allowing for proactive management of your systems. |
| 22 | + |
| 23 | +<Callout variant="tip"> |
| 24 | + New Relic currently uses the [Holt-Winters model](https://en.wikipedia.org/wiki/Exponential_smoothing#Triple_exponential_smoothing_(Holt_Winters)) for predicting, which supports hourly, daily, and weekly seasonal patterns and trends in your data. |
| 25 | +</Callout> |
| 26 | + |
| 27 | +## Pricing [#pricing] |
| 28 | + |
| 29 | + Your use of <DNT>**NRQL Predictions**</DNT> is billable during preview in accordance with your Order as applicable to the pricing model associated with your Account. New Relic Query Language queries (NRQLS) related to use of this feature are billable as the Core Compute Product. If this feature becomes generally available, your use will be billable in accordance with your Order. |
| 30 | + |
| 31 | + For further details on pricing, please contact our sales team or refer to your Order. |
| 32 | + |
| 33 | +## Enrollment [#enrollment] |
| 34 | +To enroll for the <DNT>**NRQL Predictions**</DNT> feature, navigate to <DNT>**[one.newrelic.com > Administration](https://one.newrelic.com//admin-portal) > Preview & Trials**</DNT>, and enable <DNT>**NRQL predictions**</DNT>. |
| 35 | + |
| 36 | +## Add prediction on a line or area chart [#add-prediction] |
| 37 | +To add prediction on a line or area chart, follow these steps: |
| 38 | + |
| 39 | +<Steps> |
| 40 | + |
| 41 | + <Step> |
| 42 | + ### Access a line or area chart [#access-a-chart] |
| 43 | + |
| 44 | + 1. Go to [one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities). |
| 45 | + 2. To add prediction to a line or area chart, select it from <DNT>**Dashboards**</DNT>, or open it from <DNT>**Metrics and events**</DNT>. |
| 46 | + </Step> |
| 47 | + |
| 48 | + <Step> |
| 49 | + ### Add prediction [#add-prediction] |
| 50 | + |
| 51 | + To add prediction, from the <Icon name="fe-more-horizontal"/> menu, select <DNT>**Predict trend**</DNT>. In **Data Explorer**, the prediction trend appears on the chart, projecting future trends. The prediction range is automatically set to 20% of the query window, and highlighted in gray. The graph appears in dotted lines within the predicted range. |
| 52 | + |
| 53 | + The `PREDICT` keyword is appended to the chart query. You can [refine the query](#customize-prediction-range) according to your requirements and run it to get the updated trend. |
| 54 | + |
| 55 | + <Callout variant="tip"> |
| 56 | + When you add prediction to an area chart, the chart type changes to a line chart with prediction. |
| 57 | + </Callout> |
| 58 | + |
| 59 | + </Step> |
| 60 | + |
| 61 | + <Step> |
| 62 | + ### Add to dashboard [#add-to-dashboard] |
| 63 | + |
| 64 | + 1. To add the chart with prediction to a dashboard, click <DNT>**Add to dashboard**</DNT>. |
| 65 | + 2. Enter a widget name. |
| 66 | + 3. Select a dashboard in which you want to add the widget, or create a new dashboard for it. |
| 67 | + |
| 68 | + You can now view the chart with prediction on the selected dashboard. |
| 69 | + |
| 70 | + </Step> |
| 71 | + |
| 72 | +</Steps> |
| 73 | + |
| 74 | +## Default prediction range [#default-prediction-range] |
| 75 | +When you add a prediction to a chart, the `PREDICT` function appends to the existing chart query with the following default behaviors. |
| 76 | +* **Prediction range**: Projects 20% of the total time specified in your query window, allowing you to see a short-term projection based on current trends. |
| 77 | +* **Historical data**: Processes historical data from the current query window and the two preceding ones to generate predictions. |
| 78 | +* **Time interval**: Matches the data point interval of the prediction on the query window, ensuring consistency in data projection. |
| 79 | + |
| 80 | +Example: |
| 81 | + |
| 82 | +```sql |
| 83 | +FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT |
| 84 | +``` |
| 85 | +The default prediction on the chart appears as follows: |
| 86 | + |
| 87 | + <img |
| 88 | + title="default prediction" |
| 89 | + alt="default prediction" |
| 90 | + src="/images/nrql-predictions-default.webp" |
| 91 | + /> |
| 92 | + |
| 93 | + <figcaption> |
| 94 | + <DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > dashboards**</DNT>: default prediction. |
| 95 | + |
| 96 | +</figcaption> |
| 97 | + |
| 98 | +## Customize the prediction range [#customize-prediction-range] |
| 99 | +You can customize the prediction in the following ways. To get familiar with NRQL, refer to [NRQL documentation](/docs/nrql/get-started/introduction-nrql-new-relics-query-language). |
| 100 | + |
| 101 | +<CollapserGroup> |
| 102 | +<Collapser id="hyperparameters" title="Customize the query using hyperparameters and its smoothing levels"> |
| 103 | + As <DNT>**Holt-Winters**</DNT> is the only prediction model we support currently, you can fine tune the prediction model to your use case by adjusting the hyperparameters and its smoothing factors with `holtwinters`. |
| 104 | + |
| 105 | + Use the following hyperparameters to customize the prediction: |
| 106 | + |
| 107 | + * **`seasonality`**: Represents the length of the seasonal pattern in the time series. |
| 108 | + * **`seasonality: <time range>`**: Represents the seasonality of the time series for the specified time range. |
| 109 | + * **`seasonality: AUTO`**: Automatically detects the seasonality of the time series. |
| 110 | + * **`seasonality: NONE`**: Disables the seasonality of the time series. |
| 111 | + * **`alpha`**: Represents the level or average value of the time series. |
| 112 | + * **`beta`**: Represents the trend or slope of the time series, indicating upward or downward movements. |
| 113 | + * **`gamma`**: Represents the seasonal or repeated patterns of the time series. |
| 114 | + * **`phi`**: Represents the damping factor of the time series trend. |
| 115 | + |
| 116 | +You can set the smoothing factors for **`alpha`**, **`beta`**, **`gamma`**, and **`phi`**, from 0 to 1. Higher values indicate more weight on recent data, while lower values give more weight to historical data. |
| 117 | + |
| 118 | +</Collapser> |
| 119 | +<Collapser id="prediction-range" title="Customize the query by prediction range"> |
| 120 | + You can customize the query by projecting the prediction up to a specified time range. Use the `BY` keyword to project the prediction up to the specified time range. For example, `PREDICT BY 3 hours`. |
| 121 | +</Collapser> |
| 122 | +<Collapser id="historical-data-range" title="Customize the query by processing historical data for a specified time range"> |
| 123 | + You can customize the query by processing historical data from the defined time range to project the prediction. Use the `USING` keyword to process historical data. For example, `PREDICT USING 1 day`. |
| 124 | + |
| 125 | +</Collapser> |
| 126 | +</CollapserGroup> |
| 127 | + |
| 128 | +Example: |
| 129 | + |
| 130 | +```sql |
| 131 | +FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(beta: 0.5) BY 3 hours USING 1 day |
| 132 | +``` |
| 133 | + |
| 134 | +The customized prediction on the chart appears as follows: |
| 135 | + |
| 136 | + <img |
| 137 | + title="Refined prediction" |
| 138 | + alt="Refined prediction" |
| 139 | + src="/images/nrql-predictions-refined.webp" |
| 140 | + /> |
| 141 | + |
| 142 | + <figcaption> |
| 143 | + <DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > dashboards**</DNT>: customized prediction. |
| 144 | + |
| 145 | +</figcaption> |
0 commit comments