Skip to content

Commit 6b31167

Browse files
Merge pull request #19667 from newrelic/On-demad-forecast
[Draft for feb release]feat(On-demand forecast): Added On-demand forecasting content for PP
2 parents 2d5d7e2 + 1949d0c commit 6b31167

File tree

8 files changed

+261
-10
lines changed

8 files changed

+261
-10
lines changed

src/content/docs/nrql/nrql-syntax-clauses-functions.mdx

+38-1
Original file line numberDiff line numberDiff line change
@@ -776,6 +776,43 @@ As noted in our [basic NRQL syntax doc](/docs/query-your-data/nrql-new-relic-que
776776
</Callout>
777777
</Collapser>
778778

779+
<Collapser
780+
className="freq-link"
781+
id="#sel-prediction"
782+
title={<><InlineCode>PREDICT</InlineCode> clause</>}
783+
>
784+
<Callout title="preview">
785+
We're still working on this feature, but we'd love for you to try it out!
786+
787+
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).
788+
</Callout>
789+
790+
```sql
791+
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT
792+
...
793+
```
794+
795+
With the `PREDICT` clause, you can incorporate predictions regarding future data trends into line charts based on historical data. This clause:
796+
797+
* Applies only to queries with a `TIMESERIES` clause.
798+
* Uses the `TIMESERIES <time period>` as the interval for predicted data points.
799+
* Sets the prediction range to 20% of the query window by default.
800+
* Processes historical data from the current query window and the two preceding ones to generate predictions by default.
801+
* Does not support [metric timeslice data](/docs/data-analysis/metrics/analyze-your-metrics/data-collection-metric-timeslice-event-data#timeslice-data) while in Public Preview.
802+
803+
<Callout variant="important">
804+
The `PREDICT` clause is not supported when used with the [`COMPARE WITH`](/docs/nrql/nrql-syntax-clauses-functions/#sel-compare) clause or [nested aggregations](/docs/nrql/using-nrql/nested-aggregation-make-ordered-computations-single-query) inside [subqueries](/docs/nrql/using-nrql/subqueries-in-nrql/).
805+
</Callout>
806+
You can additionally append `PREDICT <model>`, `BY <time range>`, and `USING <time range>` to refine the prediction trend to your specific needs.
807+
To indicate the time range and historical data span, use `integer units`.
808+
809+
```sql
810+
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(beta: 0.5) BY 3 hours USING 1 day
811+
```
812+
813+
To learn more about how and when you can use `PREDICT`, refer to [NRQL Predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions/).
814+
</Collapser>
815+
779816
<Collapser
780817
className="freq-link"
781818
id="show-event-types"
@@ -1617,7 +1654,7 @@ SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago
16171654

16181655
* `attribute` The first argument is required and specifies the attribute for
16191656
which to count values that fall within each histogram bucket range.
1620-
* `width:` Inidicates the width of the sample range. The maximum value of the range is the `start` argument value plus this `width` value.
1657+
* `width:` Indicates the width of the sample range. The maximum value of the range is the `start` argument value plus this `width` value.
16211658
* When using positional (non-labeled) arguments, `width` is the second argument.
16221659
* _Default:_ `10`
16231660
* `buckets:` Total number of buckets (between `1` and `500`, inclusive).

src/content/docs/query-your-data/explore-query-data/browse-data/introduction-data-explorer.mdx

+53-1
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,15 @@ Need to perform a more detailed search? Read how to [query your data](/docs/quer
4242

4343
## Why it matters [#why-matters]
4444

45-
Do you research the state of your systems? Do you need to plan resources, identify and respond to incidents, or troubleshoot faulty behaviors? Metrics and events makes it easy to identify, fetch and visualize the data you are looking for through visual menus, without ever using NRQL or building queries.
45+
Do you research the state of your systems? Do you need to plan resources, identify and respond to incidents, or troubleshoot faulty behaviors? Metrics and events make it easy to identify, fetch and visualize the data you are looking for through visual menus, without ever using NRQL or building queries.
4646

4747
With <DNT>**Metrics and events**</DNT> you can access all data stored in the New Relic database (NRDB) in a quick, intuitive way. You can then select <DNT>**Dimensions**</DNT> to facet by specific dimensions of that data.
4848

4949
Other things metrics and events helps you do:
5050

5151
* See data from different points of view: from raw data to different visualizations that provide insights on evolution, distribution, and more.
5252
* Drill down into data using filters.
53+
* Add predictions to line and area charts (Available with the public preview of [NRQL Predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions)).
5354
* Add your searches to a [dashboard](/docs/dashboards/new-relic-one-dashboards/get-started/introduction-new-relic-one-dashboards).
5455
* Understand how [NRQL](/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) works: metrics and events shows how queries are built.
5556

@@ -257,6 +258,35 @@ At the working space you can see:
257258
src="/images/queries-nrql_screenshot-crop_metrics-events-share-export.webp"
258259
/>
259260
</Collapser>
261+
262+
<Collapser
263+
className="freq-link"
264+
id="nrql-predictions"
265+
title="NRQL Predictions"
266+
>
267+
268+
<Callout title="preview">
269+
We're still working on this feature, but we'd love for you to try it out!
270+
271+
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).
272+
</Callout>
273+
274+
If you have enrolled in NRQL Predictions, you can add predictions to line and area charts, which use historical data to project future trends.
275+
To add a prediction, select <DNT>**Predict trend**</DNT> from the <Icon name="fe-more-horizontal"/> menu of the chart.
276+
The prediction appears in dotted lines, with the default range set to 20% of the query window, highlighted in gray.
277+
278+
You can further refine your query for the prediction by adjusting the range as needed. For more information, refer to [NRQL Predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions/#customize-forecasting-range).
279+
280+
<img
281+
title="nrql-prediction"
282+
alt="nrql-prediction"
283+
src="/images/nrql-predictions-default.webp"
284+
/>
285+
286+
<figcaption>
287+
<DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > Metrics and events**</DNT>: Predicted view.
288+
</figcaption>
289+
</Collapser>
260290
</CollapserGroup>
261291

262292
## Visualize your custom metric after creating it [#visualize-metric]
@@ -310,6 +340,28 @@ See the following examples to learn how and when to use metrics and events.
310340
3. Find the attribute you made changes to and check the update was successful.
311341
</Collapser>
312342

343+
<Collapser
344+
className="freq-link"
345+
id="nrql-prediction-use-case"
346+
title="View the prediction on a line or area chart (available with the public preview of NRQL Predictions)"
347+
>
348+
349+
<Callout title="preview">
350+
We're still working on this feature, but we'd love for you to try it out!
351+
352+
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).
353+
</Callout>
354+
355+
<DNT>
356+
**I want to see the future trend of a line or area chart to take proactive measures based on the predicted data.**
357+
</DNT>
358+
359+
1. Go to <DNT>**[one.newrelic.com](https://one.newrelic.com) > All capabilities > Metrics and events**</DNT>.
360+
2. Select a line or area chart where you want to add prediction.
361+
3. From the <DNT>**Options**</DNT> menu, select <DNT>**Predict trend**</DNT>. The chart with the prediction opens in the <DNT>**Data Explorer**</DNT>.
362+
4. Save it to a dashboard.
363+
</Collapser>
364+
313365
<Collapser
314366
className="freq-link"
315367
id="use-case-troubleshooting"

src/content/docs/query-your-data/explore-query-data/query-builder/introduction-new-data-explorer.mdx

+10-5
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,13 @@ Need to perform a more detailed search? Read how to [query your data](/docs/quer
2020

2121
Do you research the state of your systems? Do you need to plan resources, identify and respond to incidents, or troubleshoot faulty behaviors? The data explorer makes it easy to identify, fetch and visualize the data you are looking for through visual menus, without ever using NRQL or building queries.
2222

23-
With the <DNT>**data explorer**</DNT>, you can access all data stored in the New Relic database (NRDB) in a quick, intuitive way. You can then select facet your queries using the attributes and filter down to the needed value.
23+
With the <DNT>**data explorer**</DNT>, you can access all data stored in the New Relic database (NRDB) in a quick, intuitive way. You can then select facet your queries using attributes and filter down to the needed value.
2424

25-
Other things the data explorer view helps you:
25+
Other things the data explorer view helps you do:
2626

2727
* View data from different perspectives: from raw data to various visualizations that give insights on evolution, distribution, and more.
2828
* Drill down into data using filters.
29+
* View a prediction based on the trend of your data (available with the public preview of [NRQL Predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions)).
2930
* Add your searches to a dashboard.
3031
* Understand how NRQL works: the Data Explorer automatically generates the NRQL queries based on your selections.
3132

@@ -43,9 +44,13 @@ To access the Data Explorer, navigate to the bottom <DNT>**Query your data**</DN
4344

4445
### Use the data explorer [#use-data-explorer]
4546

46-
1. **Define the Scope**: Select the data type (metric, event, or log), the account, and the entities.
47-
2. **Select the Time Range**: Use the time picker to define the time range for your query.
48-
3. **Build Your Search**: Use the blocks on the left to browse the available data and construct your search. Blocks are searchable, and you can use the actions in the action menu to create and update your query.
47+
* **Define the Scope**: Select the data type (metric, event, or log), the account, and the entities.
48+
* **Select the Time Range**: Use the time picker to define the time range for your query.
49+
* **Build Your Search**: Use the blocks on the left to browse the available data and construct your search. Blocks are searchable, and you can use the actions in the action menu to create and update your query.
50+
* **Refine your query**: Modify your query by adding filters, facets, and aggregations.
51+
* **Customize the chart visualization**: Upgrade your chart visualization from the customization options available.
52+
* **Add prediction to a line or area chart (available with the public preview of [NRQL Predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions))**: Use <DNT>**Predict trend**</DNT> from the **Options** menu to get a predicted trend.
53+
* **Add to dashboard**: Add your chart to a dashboard for future reference.
4954

5055
<img
5156
title="Data explorer view"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
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

Comments
 (0)