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

Draft
wants to merge 14 commits into
base: develop
Choose a base branch
from
Draft
37 changes: 37 additions & 0 deletions src/content/docs/nrql/nrql-syntax-clauses-functions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,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>FORECAST</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 NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST
...
```

With the FORECAST clause, you can incorporate predictions regarding future data trends into line and area 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.

<Callout variant="important">
The `FORECAST` clause is not supported with the [`COMPARE WITH`](/docs/nrql/nrql-syntax-clauses-functions/#sel-compare) clause, [nested aggregations](/docs/nrql/using-nrql/nested-aggregation-make-ordered-computations-single-query), and inside [subqueries](/docs/nrql/using-nrql/subqueries-in-nrql/), or JSON functions.
</Callout>
You can additionally append `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`. For example:

```sql
FORECAST BY 1 hour USING 2 days
```

To learn more about how and when you can use `FORECAST`, see [NRQL predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions/).
</Collapser>

<Collapser
className="freq-link"
id="sel-join"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ 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 the NRQL predictions, you can add prediction to line and area charts, which uses historical data to project future trends.
Select <DNT>**Predict trend**</DNT> from the <DNT>**Options**</DNT> menu on 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 per your needs. For more information, see [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-prediction.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.
3. Select <DNT>**Predict trend**</DNT> from the <DNT>**Options**</DNT> menu. The predicted chart 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 @@ -26,6 +26,7 @@ Other things the data explorer view helps you:

* 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 the prediction on your data trend (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,115 @@
---
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 in the <DNT>**Predictive alerts**</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 reliably captures seasonal patterns and trends in your data.
</Callout>

To enroll in <DNT>**NRQL predictions**</DNT>, see the **Trial & Preview** section.

## 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. Select a line or area chart from <DNT>**Dashboards**</DNT>, or open it from <DNT>**Metrics and events**</DNT>.
</Step>

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

To add prediction, select <DNT>**Predict trend**</DNT> from the <Icon name="fe-more-horizontal"/> menu.
The prediction trend appears on the chart, projecting future trends in **Data Explorer**. The prediction range is automatically set to 20% of the query window, and highlighted in gray. The graph appears in dotted lines within the forecast range.

The chart query populates with the `FORECAST` function. you can [refine the query](/docs/nrql/nrql-syntax-clauses-functions/#sel-prediction) according to your requirements and run it to get the updated trend.

</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 on a chart, the `FORECAST` function is appended to the existing chart query. The following default behaviors are set:
* **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 NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST
```
The default prediction on the chart appears as following:

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

<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 part of the chart by adding the projection range and historical data span in the chart query.
To get familiar with NRQL, see [NRQL documentation](/docs/nrql/get-started/introduction-nrql-new-relics-query-language).

Use the following keywords to refine a prediction:
* **`BY <time range>`**: Project the prediction up to the specified time range.
* **`USING <time range>`**: Process historical data from the defined time range to project the prediction.

Example:

```sql
FROM NrAiIncidentDebug SELECT count(*) WHERE environment LIKE 'production'
TIMESERIES 1 hour FACET event SINCE 1 day ago FORECAST BY 1 day USING 30 days
```

The refined prediction on the chart appears as following:

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

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

</figcaption>
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,17 @@ For more chart type-specific features, see [Chart types](/docs/insights/use-insi

## Chart share and view options [#share-charts]

Most charts have various options, including a chart-embed option, getting a chart as an image, and adding a chart to a dashboard. See [Import, export, add, and share dashboards and charts](/docs/query-your-data/explore-query-data/dashboards/dashboards-charts-import-export-data/)
Most charts have various options, including a chart-embed option, getting a chart as an image, and adding a chart to a dashboard. See [Import, export, add, and share dashboards and charts](/docs/query-your-data/explore-query-data/dashboards/dashboards-charts-import-export-data/).

## Chart with a predicted trend [#chart-forecasted-trend]

<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 are enrolled in the [NRQL predictions](/docs/query-your-data/explore-query-data/use-charts/nrql-predictions) public preview, you can create predictions on line and area charts to project future trends based on historical data.

## Use open-source charting library [#victory-charts]

Expand Down
4 changes: 3 additions & 1 deletion src/nav/dashboards.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,10 @@ pages:
path: /docs/query-your-data/explore-query-data/use-charts/use-your-charts
- title: Chart types
path: /docs/query-your-data/explore-query-data/use-charts/chart-types
- title: Chart refresh rates
- title: Chart refresh rates
path: /docs/query-your-data/explore-query-data/use-charts/chart-refresh-rates
- title: On-demand forecasting
path: /docs/query-your-data/explore-query-data/use-charts/on-demand-forecasting
- title: Dashboards
pages:
- title: Get started with dashboards
Expand Down
Binary file added static/images/nrql-prediction.webp
Binary file not shown.
Binary file added static/images/nrql-predictions-default.webp
Binary file not shown.
Binary file added static/images/nrql-predictions-refined.webp
Binary file not shown.
Loading