Skip to content

Add forecasting section #10133

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

Open
wants to merge 25 commits into
base: main
Choose a base branch
from
Open

Add forecasting section #10133

wants to merge 25 commits into from

Conversation

Naarcha-AWS
Copy link
Collaborator

Description

Update #10123 with writer edits.

  • Break up index page intro three different pages, an Introduction, a Getting Started page, and a management page.
  • Security page edits.
  • Make API page fit template as much as possible

Issues Resolved

Closes #10069

Version

List the OpenSearch version to which this PR applies, e.g. 2.14, 2.12--2.14, or all.

Frontend features

If you're submitting documentation for an OpenSearch Dashboards feature, add a video that shows how a user will interact with the UI step by step. A voiceover is optional.

Checklist

  • By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and subject to the Developers Certificate of Origin.
    For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Copy link

Thank you for submitting your PR. The PR states are In progress (or Draft) -> Tech review -> Doc review -> Editorial review -> Merged.

Before you submit your PR for doc review, make sure the content is technically accurate. If you need help finding a tech reviewer, tag a maintainer.

When you're ready for doc review, tag the assignee of this PR. The doc reviewer may push edits to the PR directly or leave comments and editorial suggestions for you to address (let us know in a comment if you have a preference). The doc reviewer will arrange for an editorial review.

@Naarcha-AWS Naarcha-AWS added v3.1.0 release-notes PR: Include this PR in the automated release notes labels Jun 24, 2025
@Naarcha-AWS
Copy link
Collaborator Author

@kaituo: I couldn't add my edits to your original PR. Can you take a look at this updated PR before I pass this to editorial?

@Naarcha-AWS Naarcha-AWS added the 4 - Doc review PR: Doc review in progress label Jun 24, 2025
@Naarcha-AWS Naarcha-AWS changed the title Kaituo forecasting Add forecasting section Jun 24, 2025
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
@natebower
Copy link
Collaborator

@natebower: This is ready for your review.

Thanks @Naarcha-AWS. I'll aim to review tomorrow (6/25).

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@Naarcha-AWS Editorial review complete. Please see my comments and changes. Thanks!


You can specify a custom index for forecast results instead of using the default result index. If the custom index does not already exist, it will be created automatically when you create a forecaster and start a real-time analysis or test run.

If the custom index already exists, the Forecasting plugin checks that the index mapping matches the expected forecast result structure. To ensure compatibility, the index must conform to the schema defined in the [`forecast-results.json`](https://github.com/opensearch-project/anomaly-detection/blob/main/src/main/resources/mappings/forecast-results.json) file.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
If the custom index already exists, the Forecasting plugin checks that the index mapping matches the expected forecast result structure. To ensure compatibility, the index must conform to the schema defined in the [`forecast-results.json`](https://github.com/opensearch-project/anomaly-detection/blob/main/src/main/resources/mappings/forecast-results.json) file.
If the custom index already exists, the Forecasting API checks that the index mapping matches the expected forecast result structure. To ensure compatibility, the index must conform to the schema defined in the [`forecast-results.json`](https://github.com/opensearch-project/anomaly-detection/blob/main/src/main/resources/mappings/forecast-results.json) file.


If the custom index already exists, the Forecasting plugin checks that the index mapping matches the expected forecast result structure. To ensure compatibility, the index must conform to the schema defined in the [`forecast-results.json`](https://github.com/opensearch-project/anomaly-detection/blob/main/src/main/resources/mappings/forecast-results.json) file.

When a user creates a forecaster—either in OpenSearch Dashboards or by calling the Forecasting API—the system verifies that the user has the following index-level permissions on the custom index:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
When a user creates a forecaster—either in OpenSearch Dashboards or by calling the Forecasting API—the system verifies that the user has the following index-level permissions on the custom index:
When a user creates a forecaster—either in OpenSearch Dashboards or by calling the Forecasting API—the system verifies that the user has the following index-level permissions for the custom index:


- `indices:admin/create` – Required to create and roll over the custom result index.
- `indices:admin/aliases` – Required to create and manage the index alias.
- `indices:data/write/index` – Required to write forecast results into the index (single-stream forecasters).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
- `indices:data/write/index` – Required to write forecast results into the index (single-stream forecasters).
- `indices:data/write/index` – Required to write forecast results to the index (single-stream forecasters).


## Next step

For additional guidance on Transport Layer Security (TLS), authentication backends, tenant isolation, and audit logging, refer to the [Security plugin documentation]({{site.url}}{{site.baseurl}}/security/).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
For additional guidance on Transport Layer Security (TLS), authentication backends, tenant isolation, and audit logging, refer to the [Security plugin documentation]({{site.url}}{{site.baseurl}}/security/).
For more information about TLS, authentication backends, tenant isolation, and audit logging, see the [Security plugin documentation]({{site.url}}{{site.baseurl}}/security/).

Copy link
Collaborator

@natebower natebower left a comment

Choose a reason for hiding this comment

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

@Naarcha-AWS Editorial review complete. Please see my comments and changes. Thanks!

@natebower natebower removed the 5 - Editorial review PR: Editorial review in progress label Jun 25, 2025

### Example request: Built-in query with distance under a threshold

The following request returns the top entities whose forecast values fall farthest under a specified threshold, based on the `DISTANCE_TO_THRESHOLD_VALUE` metric:
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
The following request returns the top entities whose forecast values fall farthest under a specified threshold, based on the `DISTANCE_TO_THRESHOLD_VALUE` metric:
The following request returns the top entities whose forecast values fall farthest from a specified threshold, based on the `DISTANCE_TO_THRESHOLD_VALUE` metric:

The `DISTANCE_TO_THRESHOLD_VALUE` metric calculates `forecast_value – threshold`. Because `relation_to_threshold` is `LESS_THAN`, the API returns negative distances only and sorts them in ascending order (most negative first). Each bucket includes the following values:

- `doc_count`: The number of forecast points that matched.
- `DISTANCE_TO_THRESHOLD_VALUE`: The worst (most negative) distance within the forecast horizon.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
- `DISTANCE_TO_THRESHOLD_VALUE`: The worst (most negative) distance within the forecast horizon.
- `DISTANCE_TO_THRESHOLD_VALUE`: The largest distance within the forecast horizon from the threshold value.

**Introduced 3.1**
{: .label .label-purple }

Returns execution-time state such as initialization progress, per-entity model metadata, and errors. This API is useful for inspecting forecaster internals during runtime.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
Returns execution-time state such as initialization progress, per-entity model metadata, and errors. This API is useful for inspecting forecaster internals during runtime.
Returns execution-time state such as initialization progress, per-entity model metadata, and errors. This API is useful for inspecting forecaster intervals during runtime.

```


4. Under **Timestamp field**, select the field that stores event time.
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
4. Under **Timestamp field**, select the field that stores event time.
4. Under **Timestamp field**, select the field that stores the timestamps.

|----------|-------------|------|------|---------|----------|
| `result_index_min_size` | The minimum total primary shard size before rollover. | Integer | MB | `51200` (50 GB) | No |
| `result_index_min_age` | The minimum index age to trigger rollover. | Integer | Days | `7` | No |
| `result_index_ttl` | The minimum age before deletion. | Integer | Days | `60` | No |
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
| `result_index_ttl` | The minimum age before deletion. | Integer | Days | `60` | No |
| `result_index_ttl` | The minimum amount of time before rolled-over indexes are deleted | Integer | Days | `60` | No |

Naarcha-AWS and others added 2 commits June 25, 2025 13:16
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>

To isolate results for another team, such as `human-resources`, create a separate role (for example, `forecast_human_resources_result_access`) and update the term value to match the appropriate backend role.

### Define data-source read access
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Suggested change
### Define data-source read access
### Define `data-source` read access

Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Naarcha-AWS and others added 3 commits June 26, 2025 13:54
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
Co-authored-by: Nathan Bower <[email protected]>
Signed-off-by: Naarcha-AWS <[email protected]>
@natebower
Copy link
Collaborator

@Naarcha-AWS Just this one comment outstanding, and then we can merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes PR: Include this PR in the automated release notes v3.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DOC]Add docs for forecsting GA
3 participants