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

[DOC} Reconcile Alerting Monitors 2.9 Documentation Changes #4710

Merged
merged 35 commits into from
Aug 21, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
d746d7f
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
08377c3
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
94ae28f
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
77d6df4
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
14614f9
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
6454948
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
2da06ef
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
b67143a
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
fa2de7d
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
d837d56
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
9cf5327
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
57a63af
Reconcile PR changes that weren't published due to files being edited…
vagimeli Aug 7, 2023
589727b
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 16, 2023
02046b7
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 16, 2023
9e43c69
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 16, 2023
5b9c51f
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 16, 2023
e3d8559
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 16, 2023
51cef56
Address doc reviewer feedback
vagimeli Aug 16, 2023
a87bedb
Make copy edits
vagimeli Aug 16, 2023
3f7a749
Make copy edits
vagimeli Aug 16, 2023
4b3bed8
Make copy edits
vagimeli Aug 16, 2023
f5f42cb
Make copy edits
vagimeli Aug 16, 2023
013d0f4
Make copy edits
vagimeli Aug 18, 2023
32ff232
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
2007e0d
Update _observing-your-data/alerting/monitors.md
vagimeli Aug 21, 2023
fd6eb1c
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
b7e53c0
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
29cc3fd
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
a37a368
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
30cb8d8
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
f9cab4d
Update _observing-your-data/alerting/per-document-monitors.md
vagimeli Aug 21, 2023
e162c27
Update _observing-your-data/alerting/per-query-bucket-monitors.md
vagimeli Aug 21, 2023
4fa621d
Update _observing-your-data/alerting/per-query-bucket-monitors.md
vagimeli Aug 21, 2023
dc92009
Update _observing-your-data/alerting/per-query-bucket-monitors.md
vagimeli Aug 21, 2023
824a820
Update _observing-your-data/alerting/per-cluster-metrics-monitors.md
vagimeli Aug 21, 2023
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
20 changes: 10 additions & 10 deletions _observing-your-data/ad/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ An anomaly in OpenSearch is any unusual behavior change in your time-series data

It can be challenging to discover anomalies using conventional methods such as creating visualizations and dashboards. You could configure an alert based on a static threshold, but this requires prior domain knowledge and isn't adaptive to data that exhibits organic growth or seasonal behavior.

Anomaly detection automatically detects anomalies in your OpenSearch data in near real-time using the Random Cut Forest (RCF) algorithm. RCF is an unsupervised machine learning algorithm that models a sketch of your incoming data stream to compute an `anomaly grade` and `confidence score` value for each incoming data point. These values are used to differentiate an anomaly from normal variations. For more information about how RCF works, see [Random Cut Forests](https://www.semanticscholar.org/paper/Robust-Random-Cut-Forest-Based-Anomaly-Detection-on-Guha-Mishra/ecb365ef9b67cd5540cc4c53035a6a7bd88678f9).
Anomaly detection automatically detects anomalies in your OpenSearch data in near real-time using the Random Cut Forest (RCF) algorithm. RCF is an unsupervised machine learning algorithm that models a sketch of your incoming data stream to compute an `anomaly grade` and `confidence score` value for each incoming data point. These values are used to differentiate an anomaly from normal variations. For more information about how RCF works, see [Random Cut Forests](https://www.semanticscholar.org/paper/Robust-Random-Cut-Forest-Based-Anomaly-Detection-on-Guha-Mishra/ecb365ef9b67cd5540cc4c53035a6a7bd88678f9).

You can pair the anomaly detection plugin with the [alerting plugin]({{site.url}}{{site.baseurl}}/monitoring-plugins/alerting/) to notify you as soon as an anomaly is detected.
You can pair the Anomaly Detection plugin with the [Alerting plugin]({{site.url}}{{site.baseurl}}/monitoring-plugins/alerting/) to notify you as soon as an anomaly is detected.

To get started, choose **Anomaly Detection** in OpenSearch Dashboards.
To first test with sample streaming data, you can try out one of the preconfigured detectors with one of the sample datasets.
Expand All @@ -43,21 +43,21 @@ A detector is an individual anomaly detection task. You can define multiple dete

- (Optional) To add extra processing time for data collection, specify a **Window delay** value.
- This value tells the detector that the data is not ingested into OpenSearch in real time but with a certain delay. Set the window delay to shift the detector interval to account for this delay.
- For example, say the detector interval is 10 minutes and data is ingested into your cluster with a general delay of 1 minute. Assume the detector runs at 2:00. The detector attempts to get the last 10 minutes of data from 1:50 to 2:00, but because of the 1-minute delay, it only gets 9 minutes of data and misses the data from 1:59 to 2:00. Setting the window delay to 1 minute shifts the interval window to 1:49 - 1:59, so the detector accounts for all 10 minutes of the detector interval time.
- For example, say the detector interval is 10 minutes and data is ingested into your cluster with a general delay of 1 minute. Assume the detector runs at 2:00. The detector attempts to get the last 10 minutes of data from 1:50 to 2:00, but because of the 1-minute delay, it only gets 9 minutes of data and misses the data from 1:59 to 2:00. Setting the window delay to 1 minute shifts the interval window to 1:49--1:59, so the detector accounts for all 10 minutes of the detector interval time.
1. Specify custom result index.
- If you want to store the anomaly detection results in your own index, choose **Enable custom result index** and specify the custom index to store the result. The anomaly detection plugin adds an `opensearch-ad-plugin-result-` prefix to the index name that you input. For example, if you input `abc` as the result index name, the final index name is `opensearch-ad-plugin-result-abc`.

You can use the dash “-” sign to separate the namespace to manage custom result index permissions. For example, if you use `opensearch-ad-plugin-result-financial-us-group1` as the result index, you can create a permission role based on the pattern `opensearch-ad-plugin-result-financial-us-*` to represent the "financial" department at a granular level for the "us" area.
{: .note }

- If the custom index you specify doesn’t already exist, the anomaly detection plugin creates this index when you create the detector and start your real-time or historical analysis.
- If the custom index you specify doesn’t already exist, the Anomaly Detection plugin creates this index when you create the detector and start your real-time or historical analysis.
- If the custom index already exists, the plugin checks if the index mapping of the custom index matches the anomaly result file. You need to make sure the custom index has valid mapping as shown here: [anomaly-results.json](https://github.com/opensearch-project/anomaly-detection/blob/main/src/main/resources/mappings/anomaly-results.json).
- To use the custom result index option, you need the following permissions:
- `indices:admin/create` - If the custom index already exists, you don't need this.
- `indices:data/write/index` - You need the `write` permission for the anomaly detection plugin to write results into the custom index for a single-entity detector.
- `indices:data/write/index` - You need the `write` permission for the Anomaly Detection plugin to write results into the custom index for a single-entity detector.
- `indices:data/read/search` - You need the `search` permission because the Anomaly Detection plugin needs to search custom result indexes to show results on the anomaly detection UI.
- `indices:data/write/delete` - Because the detector might generate a large number of anomaly results, you need the `delete` permission to delete old data and save disk space.
- `indices:data/write/bulk*` - You need the `bulk*` permission because the anomaly detection plugin uses the bulk API to write results into the custom index.
- `indices:data/write/bulk*` - You need the `bulk*` permission because the Anomaly Detection plugin uses the bulk API to write results into the custom index.
- Managing the custom result index:
- The anomaly detection dashboard queries all detectors’ results from all custom result indexes. Having too many custom result indexes might impact the performance of the Anomaly Detection plugin.
- You can use [Index State Management]({{site.url}}{{site.baseurl}}/im-plugin/ism/index/) to rollover old result indexes. You can also manually delete or archive any old result indexes. We recommend reusing a custom result index for multiple detectors.
Expand Down Expand Up @@ -123,7 +123,7 @@ The anomaly detector expects the shingle size to be in the range of 1 and 60. Th
#### Preview sample anomalies

Preview sample anomalies and adjust the feature settings if needed.
For sample previews, the anomaly detection plugin selects a small number of data samples---for example, one data point every 30 minutes---and uses interpolation to estimate the remaining data points to approximate the actual feature data. It loads this sample dataset into the detector. The detector uses this sample dataset to generate a sample preview of anomaly results.
For sample previews, the Anomaly Detection plugin selects a small number of data samples---for example, one data point every 30 minutes---and uses interpolation to estimate the remaining data points to approximate the actual feature data. It loads this sample dataset into the detector. The detector uses this sample dataset to generate a sample preview of anomaly results.

Examine the sample preview and use it to fine-tune your feature configurations (for example, enable or disable features) to get more accurate results.

Expand All @@ -137,7 +137,7 @@ To start a real-time detector to find anomalies in your data in near real-time,

Alternatively, if you want to perform historical analysis and find patterns in long historical data windows (weeks or months), check **Run historical analysis detection** and select a date range (at least 128 detection intervals).

Analyzing historical data helps you get familiar with the anomaly detection plugin. You can also evaluate the performance of a detector with historical data to further fine-tune it.
Analyzing historical data helps you get familiar with the Anomaly Detection plugin. You can also evaluate the performance of a detector with historical data to further fine-tune it.

We recommend experimenting with historical analysis with different feature sets and checking the precision before moving on to real-time detectors.

Expand Down Expand Up @@ -189,11 +189,11 @@ If you set the category field, you see an additional **Heat map** chart. The hea

If you have set multiple category fields, you can select a subset of fields to filter and sort the fields by. Selecting a subset of fields lets you see the top values of one field that share a common value with another field.

For example, if you have a detector with the category fields `ip` and `endpoint`, you can select `endpoint` in the **View by** dropdown menu. Then, select a specific cell to overlay the top 20 values of `ip` on the charts. The anomaly detection plugin selects the top `ip` by default. You can see a maximum of 5 individual time-series values at the same time.
For example, if you have a detector with the category fields `ip` and `endpoint`, you can select `endpoint` in the **View by** dropdown menu. Then select a specific cell to overlay the top 20 values of `ip` on the charts. The Anomaly Detection plugin selects the top `ip` by default. You can see a maximum of 5 individual time-series values at the same time.

## Step 6: Set up alerts

Under **Real-time results**, choose **Set up alerts** and configure a monitor to notify you when anomalies are detected. For steps to create a monitor and set up notifications based on your anomaly detector, see [Monitors]({{site.url}}{{site.baseurl}}/monitoring-plugins/alerting/monitors/).
Under **Real-time results**, choose **Set up alerts** and configure a monitor to notify you when anomalies are detected. For steps to create a monitor and set up notifications based on your anomaly detector, see [Monitors]({{site.url}}{{site.baseurl}}/observing-your-data/alerting/monitors/).

If you stop or delete a detector, make sure to delete any monitors associated with it.

Expand Down
2 changes: 1 addition & 1 deletion _observing-your-data/alerting/actions.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
layout: default
title: Actions
nav_order: 15
nav_order: 50
grand_parent: Alerting
parent: Monitors
---
Expand Down
21 changes: 9 additions & 12 deletions _observing-your-data/alerting/composite-monitors.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
---
layout: default
title: Composite monitors
nav_order: 3
parent: Alerting
nav_order: 25
parent: Monitors
grand_parent: Alerting
has_children: false
redirect_from:
- /observing-your-data/alerting/composite-monitors/
---

# Composite monitors
Expand Down Expand Up @@ -36,18 +38,17 @@ Composite monitors remove the limitations of basic monitors in the following way

## Key terms

The key terms in the following table describe the basic concepts of composite monitors. For additional terms common to all types of monitors, see [Key terms]({{site.url}}{{site.baseurl}}/observing-your-data/alerting/monitors/#key-terms) for basic monitors.
The key terms in the following table describe the basic concepts of composite monitors. For additional terms common to all types of monitors, see [Key terms]({{site.url}}{{site.baseurl}}/observing-your-data/alerting/index/#key-terms) in the Alerting section.

| Term | Definition |
| :--- | :--- |
| Composite monitor | A composite monitor is a type of monitor that supports the execution of multiple monitors in a sequential workflow. It supports configuring triggers to create chained alerts. |
| Delegate monitor | Delegate monitors are executed sequentially according to their order in a composite monitor's definition. When a delegate monitor's trigger conditions are met, it generates an audit alert. This audit alert then becomes a condition for the composite monitor's trigger. The composite monitor supports per query, per bucket, and per document monitors as delegate monitors. |
| workflow ID | The workflow ID provides an identifier for the entire workflow of all delegate monitors. It is synonymous with a composite monitor's monitor ID. |
| Chained alert | Chained alerts are generated from composite monitor triggers when delegate monitors generate audit alerts. The chained alert trigger condition supports the use of the logical operators AND, OR, and NOT so you can combine multiple functions into a single expression. |
| Chained alert | Chained alerts are generated from composite monitor triggers when delegate monitors generate audit alerts. The chained alert trigger condition supports the use of the logical operators `AND`, `OR`, and `NOT` so you can combine multiple functions into a single expression. |
| Audit alert | Delegate monitors generate alerts in an **audit** state. Users are not notified about each individual audit alert and don't need to acknowledge them. Audit alerts are used to evaluate chained alert trigger conditions in composite monitors. |
| Execution | A single run of all delegate monitors in the sequence defined in the composite monitor's configuration. |


## Basic workflow

You create composite monitors by combining individual monitors in a workflow that executes each monitor in a defined sequence. When individual audit alerts from the delegate monitors meet the trigger conditions for a composite monitor, the composite monitor generates its own chained alert. Consider the following sequence of events to understand how a simple composite monitor configured with two delegate monitors executes its workflow. In this example, the trigger condition for the composite monitor is met when the first monitor and the second monitor both generate an alert.
Expand All @@ -64,8 +65,7 @@ In this simple example, the first monitor could be a per document monitor config

You can manage composite monitors using the REST API or OpenSearch Dashboards. This section covers API functionality for composite monitors.


### Create Composite Monitor
### Create composite monitor

This API allows you to create a composite monitor.

Expand Down Expand Up @@ -384,7 +384,7 @@ POST /_plugins/_alerting/workflows/<workflow_id>/_execute
```


### Get Chained Alerts
### Get chained alerts

This API returns an array of chained alerts generated in composite monitor workflows:

Expand Down Expand Up @@ -534,7 +534,7 @@ GET /_plugins/_alerting/workflows/alerts?workflowIds=<workflow_ids>&getAssociate
| `associatedAlerts` | Array | A list of audit alerts generated by the delegate monitors. |


### Acknowledge Chained Alerts
### Acknowledge chained alerts

[After getting your alerts](#get-chained-alerts), you can acknowledge multiple active alerts in one call. If the alert is already in an ERROR, COMPLETED, or ACKNOWLEDGED state, it appears in the failed array.

Expand Down Expand Up @@ -563,7 +563,6 @@ POST _plugins/_alerting/workflows/<workflow_id>/_acknowledge/alerts
}
```


## Creating composite monitors in OpenSearch Dashboards

Begin by navigating to the **Create monitor** page in OpenSearch Dashboards: **Alerting > Monitors** and select **Create monitor**. Give the monitor a name and then select **Composite monitor** as the monitor type. Steps for creating a composite monitor workflow and trigger conditions vary depending on whether you use the **Visual editor** or the **Extraction query editor**. The first provides basic UI selectors for defining the composite monitor, while the second allows you to build the workflow and trigger conditions using a script. After deciding which method to use, refer to the corresponding section.
Expand Down Expand Up @@ -647,7 +646,6 @@ The extraction query editor follows the same general steps as the visual editor,
(monitor[id=8d36S4kB0DWOHH7wpkET] || monitor[id=4t36S4kB0DWOHH7wL0Hk])
```


### Viewing monitor details

After a composite monitor is created, it appears in the list of monitors on the **Monitors** tab. The **Type** column indicates the type of monitor, including the composite monitor type. The **Associations with composite monitors** column provides a count of how many composite monitors a basic monitor is used in as a delegate monitor. Select a monitor in the **Monitor name** column to open its details window.
Expand All @@ -659,4 +657,3 @@ For composite monitors, The **Alerts** section of the details window includes th
Select this icon to open the **Alert details** window. This window shows you all of the audit alerts that were part of the execution that generated the chained alert and includes the delegate monitor that generated the audit alert. Select the **X** in the upper-right corner of the window to close **Alert details**.

After returning to the **Alerts** section of the monitor's details window, you can select the check box to the left of the **Alert start time** to highlight the alert. After the alert is highlighted, you can select **Acknowledge** in the upper-right portion of this section. The alert is acknowledged and the status in the **State** column changes from Active to Acknowledged.

Loading