Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Draft for feb release]feat(On-demand forecast): Added On-demand forecasting content for PP #19667

Merged
merged 33 commits into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
8490a7c
feat(On-demand forecast): Added content for PP
sujitnewrelic Jan 8, 2025
2a62805
Merge branch 'develop' into On-demand-forecast
sujitnewrelic Jan 13, 2025
9cff6c6
Updated the first draft with the PMs feedback
sujitnewrelic Jan 13, 2025
2a11935
Update on-demand-forecasting.mdx
sujitnewrelic Jan 15, 2025
e2e2524
Implemented SME suggestions
sujitnewrelic Jan 15, 2025
e170d3b
Self-review corrections
sujitnewrelic Jan 15, 2025
8475b8c
Self-review corrections
sujitnewrelic Jan 15, 2025
d7bf65c
Update on-demand-forecasting.mdx
sujitnewrelic Jan 15, 2025
7052c15
Self review corrections
sujitnewrelic Jan 16, 2025
2d9087e
Feature name SME comment update
sujitnewrelic Jan 23, 2025
599146e
Update nrql-syntax-clauses-functions.mdx
sujitnewrelic Jan 23, 2025
704eda1
Update nrql-syntax-clauses-functions.mdx
sujitnewrelic Jan 23, 2025
8567304
Update nrql-syntax-clauses-functions.mdx
sujitnewrelic Jan 23, 2025
c862e5b
language correction
sujitnewrelic Jan 23, 2025
bd00f65
Updated the function name from FORECAST to PREDICT
sujitnewrelic Jan 24, 2025
8dc705c
Authoring in progress
sujitnewrelic Jan 30, 2025
d31bb84
Updated editorial review comments
sujitnewrelic Jan 30, 2025
fc95ee8
Updated the limitation about metric timeslice data
sujitnewrelic Feb 9, 2025
b26f661
Ypdate the callout about the Holt-Winters model
sujitnewrelic Feb 9, 2025
2c375e5
Added the point for metric timeslice data
sujitnewrelic Feb 10, 2025
1c4cd91
Updated the term Forecast to Predict
sujitnewrelic Feb 17, 2025
ddde227
Update nrql-predictions.mdx
sujitnewrelic Feb 17, 2025
a5f850c
Updated the screenshots
sujitnewrelic Feb 17, 2025
7ddbde2
Updated the Pricing, and predict model hyperparameter details
sujitnewrelic Feb 19, 2025
2d37d15
Updated the comments from Ashton and team
sujitnewrelic Feb 20, 2025
0c1f067
Update nrql-predictions.mdx
sujitnewrelic Feb 20, 2025
9d60d23
Update nrql-predictions.mdx
sujitnewrelic Feb 20, 2025
6522ba8
Update nrql-predictions.mdx
sujitnewrelic Feb 20, 2025
d238c90
Update nrql-predictions.mdx
sujitnewrelic Feb 21, 2025
497ae75
Updated the pricing section as per the legal team suggestion
sujitnewrelic Feb 21, 2025
939a295
Added link to Predictive Alerts page
sujitnewrelic Feb 24, 2025
04f5aaa
Spell corerctions
sujitnewrelic Feb 25, 2025
1949d0c
Merge branch 'develop' into On-demad-forecast
sujitnewrelic Feb 25, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion src/content/docs/nrql/nrql-syntax-clauses-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -776,6 +776,43 @@ As noted in our [basic NRQL syntax doc](/docs/query-your-data/nrql-new-relic-que
</Callout>
</Collapser>

<Collapser
className="freq-link"
id="#sel-prediction"
title={<><InlineCode>PREDICT</InlineCode> clause</>}
>
<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

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).
</Callout>

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

With the `PREDICT` clause, you can incorporate predictions regarding future data trends into line charts based on historical data. This clause:

* Applies only to queries with a `TIMESERIES` clause.
* Uses the `TIMESERIES <time period>` as the interval for predicted data points.
* Sets the prediction range to 20% of the query window by default.
* Processes historical data from the current query window and the two preceding ones to generate predictions by default.
* 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.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add somewhere that subqueries may need to be updated to include the USING timespan when using predict? Subqueries are resolved before evaluating the training window and thus need to include all information for training and visualization.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @cehme . Please raise a separate PR for this. I will update the document post our today's release.


<Callout variant="important">
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/).
</Callout>
You can additionally append `PREDICT <model>`, `BY <time range>`, and `USING <time range>` to refine the prediction trend to your specific needs.
To indicate the time range and historical data span, use `integer units`.

```sql
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(beta: 0.5) BY 3 hours USING 1 day
```

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/).
</Collapser>

<Collapser
className="freq-link"
id="show-event-types"
Expand Down Expand Up @@ -1617,7 +1654,7 @@ SELECT histogram(duration, 10, 20) FROM PageView SINCE 1 week ago

* `attribute` The first argument is required and specifies the attribute for
which to count values that fall within each histogram bucket range.
* `width:` Inidicates the width of the sample range. The maximum value of the range is the `start` argument value plus this `width` value.
* `width:` Indicates the width of the sample range. The maximum value of the range is the `start` argument value plus this `width` value.
* When using positional (non-labeled) arguments, `width` is the second argument.
* _Default:_ `10`
* `buckets:` Total number of buckets (between `1` and `500`, inclusive).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,15 @@ Need to perform a more detailed search? Read how to [query your data](/docs/quer

## Why it matters [#why-matters]

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.
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.

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.

Other things metrics and events helps you do:

* See data from different points of view: from raw data to different visualizations that provide insights on evolution, distribution, and more.
* Drill down into data using filters.
* 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)).
* Add your searches to a [dashboard](/docs/dashboards/new-relic-one-dashboards/get-started/introduction-new-relic-one-dashboards).
* Understand how [NRQL](/docs/query-data/nrql-new-relic-query-language/getting-started/introduction-nrql) works: metrics and events shows how queries are built.

Expand Down Expand Up @@ -257,6 +258,35 @@ At the working space you can see:
src="/images/queries-nrql_screenshot-crop_metrics-events-share-export.webp"
/>
</Collapser>

<Collapser
className="freq-link"
id="nrql-predictions"
title="NRQL Predictions"
>

<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

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).
</Callout>

If you have enrolled in NRQL Predictions, you can add predictions to line and area charts, which use historical data to project future trends.
To add a prediction, select <DNT>**Predict trend**</DNT> from the <Icon name="fe-more-horizontal"/> menu of the chart.
The prediction appears in dotted lines, with the default range set to 20% of the query window, highlighted in gray.

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).

<img
title="nrql-prediction"
alt="nrql-prediction"
src="/images/nrql-predictions-default.webp"
/>

<figcaption>
<DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > Metrics and events**</DNT>: Predicted view.
</figcaption>
</Collapser>
</CollapserGroup>

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

<Collapser
className="freq-link"
id="nrql-prediction-use-case"
title="View the prediction on a line or area chart (available with the public preview of NRQL Predictions)"
>

<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

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).
</Callout>

<DNT>
**I want to see the future trend of a line or area chart to take proactive measures based on the predicted data.**
</DNT>

1. Go to <DNT>**[one.newrelic.com](https://one.newrelic.com) > All capabilities > Metrics and events**</DNT>.
2. Select a line or area chart where you want to add prediction.
3. From the <DNT>**Options**</DNT> menu, select <DNT>**Predict trend**</DNT>. The chart with the prediction opens in the <DNT>**Data Explorer**</DNT>.
4. Save it to a dashboard.
</Collapser>

<Collapser
className="freq-link"
id="use-case-troubleshooting"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,13 @@ Need to perform a more detailed search? Read how to [query your data](/docs/quer

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.

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.
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.

Other things the data explorer view helps you:
Other things the data explorer view helps you do:

* View data from different perspectives: from raw data to various visualizations that give insights on evolution, distribution, and more.
* Drill down into data using filters.
* 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)).
* Add your searches to a dashboard.
* Understand how NRQL works: the Data Explorer automatically generates the NRQL queries based on your selections.

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

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

1. **Define the Scope**: Select the data type (metric, event, or log), the account, and the entities.
2. **Select the Time Range**: Use the time picker to define the time range for your query.
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.
* **Define the Scope**: Select the data type (metric, event, or log), the account, and the entities.
* **Select the Time Range**: Use the time picker to define the time range for your query.
* **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.
* **Refine your query**: Modify your query by adding filters, facets, and aggregations.
* **Customize the chart visualization**: Upgrade your chart visualization from the customization options available.
* **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.
* **Add to dashboard**: Add your chart to a dashboard for future reference.

<img
title="Data explorer view"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
---
title: NRQL Predictions
tags:
- Prediction on a chart
- Forecasting on a chart
- NRQL Predictions
- Forecasting
metaDescription: 'Use NRQL Predictions to predict future trends and potential performance issues.'
redirects:
freshnessValidatedDate: never
---
<Callout title="preview">
We're still working on this feature, but we'd love for you to try it out!

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).
</Callout>

<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.


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.

<Callout variant="tip">
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.
</Callout>

## Pricing [#pricing]

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.

For further details on pricing, please contact our sales team or refer to your Order.

## Enrollment [#enrollment]
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>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"enroll in" or "sign up for"

Copy link
Contributor Author

@sujitnewrelic sujitnewrelic Feb 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"enroll for" is appropriate here.


## Add prediction on a line or area chart [#add-prediction]
To add prediction on a line or area chart, follow these steps:

<Steps>

<Step>
### Access a line or area chart [#access-a-chart]

1. Go to [one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities).
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>.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to add a note somewhere that area charts are converted to line charts for PREDICT. For faceted area charts, this means the original shape will be lost.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a tip as following:
"When you add prediction to an area chart, the chart type changes to a line chart with prediction."

</Step>

<Step>
### Add prediction [#add-prediction]

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.

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.

<Callout variant="tip">
When you add prediction to an area chart, the chart type changes to a line chart with prediction.
</Callout>

</Step>

<Step>
### Add to dashboard [#add-to-dashboard]

1. To add the chart with prediction to a dashboard, click <DNT>**Add to dashboard**</DNT>.
2. Enter a widget name.
3. Select a dashboard in which you want to add the widget, or create a new dashboard for it.

You can now view the chart with prediction on the selected dashboard.

</Step>

</Steps>

## Default prediction range [#default-prediction-range]
When you add a prediction to a chart, the `PREDICT` function appends to the existing chart query with the following default behaviors.
* **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.
* **Historical data**: Processes historical data from the current query window and the two preceding ones to generate predictions.
* **Time interval**: Matches the data point interval of the prediction on the query window, ensuring consistency in data projection.

Example:

```sql
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT
```
The default prediction on the chart appears as follows:

<img
title="default prediction"
alt="default prediction"
src="/images/nrql-predictions-default.webp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Within this image we're using FORECAST in the query bar, we'll need to update this to use PREDICT instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the image. Was waiting for the env to be ready.

/>

<figcaption>
<DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > dashboards**</DNT>: default prediction.

</figcaption>

## Customize the prediction range [#customize-prediction-range]
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).

<CollapserGroup>
<Collapser id="hyperparameters" title="Customize the query using hyperparameters and its smoothing levels">
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`.

Use the following hyperparameters to customize the prediction:

* **`seasonality`**: Represents the length of the seasonal pattern in the time series.
* **`seasonality: <time range>`**: Represents the seasonality of the time series for the specified time range.
* **`seasonality: AUTO`**: Automatically detects the seasonality of the time series.
* **`seasonality: NONE`**: Disables the seasonality of the time series.
* **`alpha`**: Represents the level or average value of the time series.
* **`beta`**: Represents the trend or slope of the time series, indicating upward or downward movements.
* **`gamma`**: Represents the seasonal or repeated patterns of the time series.
* **`phi`**: Represents the damping factor of the time series trend.

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.

</Collapser>
<Collapser id="prediction-range" title="Customize the query by prediction range">
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`.
</Collapser>
<Collapser id="historical-data-range" title="Customize the query by processing historical data for a specified time range">
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`.

</Collapser>
</CollapserGroup>

Example:

```sql
FROM Transaction SELECT count(*) WHERE error IS TRUE TIMESERIES PREDICT holtwinters(beta: 0.5) BY 3 hours USING 1 day
```

The customized prediction on the chart appears as follows:

<img
title="Refined prediction"
alt="Refined prediction"
src="/images/nrql-predictions-refined.webp"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need to update the query bar in this image to use PREDICT instead of FORECAST

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated the image. Was waiting for the env to be ready.

/>

<figcaption>
<DNT>**[one.newrelic.com > All capabilities](https://one.newrelic.com/all-capabilities) > dashboards**</DNT>: customized prediction.

</figcaption>
Loading
Loading