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] Add new cluster metrics monitor supported APIs #4525

Merged
merged 78 commits into from
Jul 19, 2023
Merged
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
78 commits
Select commit Hold shift + click to select a range
494133b
Add new functionalities for 2.9
vagimeli Jul 7, 2023
f1bf2c7
Update monitors.md
vagimeli Jul 10, 2023
422d18a
Update monitors.md
vagimeli Jul 10, 2023
0791faa
Add new monitors and update content overall
vagimeli Jul 10, 2023
2e78e66
Update cluster metrics monitor section
vagimeli Jul 10, 2023
387d50b
Restructure TOC for better readability
vagimeli Jul 11, 2023
f0f005d
Restructure TOC for better readability
vagimeli Jul 11, 2023
7be51c5
Restructure TOC for better readability
vagimeli Jul 11, 2023
bf29cb5
Restructure TOC for better readability
vagimeli Jul 11, 2023
c205cc2
Update create-monitors.md
vagimeli Jul 11, 2023
e0612f1
Update cluster metrics monitor content
vagimeli Jul 12, 2023
36a0edb
Add new zip for example SAML configuration files that reflect latest …
cwillum Jul 6, 2023
9c966d9
Add compound query types documentation (#4390)
kolchfa-aws Jul 7, 2023
9e8f124
Fix geo words and nav order (#4529)
kolchfa-aws Jul 7, 2023
19bcf29
Add geo terms (#4532)
natebower Jul 7, 2023
8ab8c8c
Add geohash grid aggregation parameters (#4530)
kolchfa-aws Jul 7, 2023
9be6477
Add substitution rules for geo words (#4535)
kolchfa-aws Jul 7, 2023
4563649
replaced stack management (#4541)
hdhalter Jul 11, 2023
c8ea1a0
Restructure monitors section for readanility
vagimeli Jul 12, 2023
f843339
Revert "replaced stack management (#4541)"
vagimeli Jul 12, 2023
d1f84b8
Revert "Add substitution rules for geo words (#4535)"
vagimeli Jul 12, 2023
dc50f98
Revert "Add geohash grid aggregation parameters (#4530)"
vagimeli Jul 12, 2023
019c582
Revert "Add geo terms (#4532)"
vagimeli Jul 12, 2023
007e4a2
Revert "Fix geo words and nav order (#4529)"
vagimeli Jul 12, 2023
d530f11
Revert "Add compound query types documentation (#4390)"
vagimeli Jul 12, 2023
22b5b91
Revert "Add new zip for example SAML configuration files that reflect…
vagimeli Jul 12, 2023
06a2c6b
Update index.md
vagimeli Jul 12, 2023
041cff0
Add UI image
vagimeli Jul 12, 2023
b3faabb
Update monitors.md
vagimeli Jul 12, 2023
f919ec6
Update monitors.md
vagimeli Jul 12, 2023
135272c
Updates
vagimeli Jul 12, 2023
49c0715
Updates
vagimeli Jul 12, 2023
14d349a
Update monitors.md
vagimeli Jul 12, 2023
33c233d
Address tech reviewer feedback
vagimeli Jul 17, 2023
697bde7
Address tech review feedback
vagimeli Jul 17, 2023
0da1972
Merge branch 'main' into alert-enhance-4437
kolchfa-aws Jul 17, 2023
edb91ba
Update _observing-your-data/alerting/actions.md
vagimeli Jul 17, 2023
214498b
Update _observing-your-data/alerting/index.md
vagimeli Jul 17, 2023
dfcd479
Update _observing-your-data/alerting/index.md
vagimeli Jul 17, 2023
76c1d3b
Update _observing-your-data/alerting/index.md
vagimeli Jul 17, 2023
d4e5866
Update _observing-your-data/alerting/index.md
vagimeli Jul 17, 2023
4cf85e5
Update _observing-your-data/alerting/index.md
vagimeli Jul 17, 2023
df15d42
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 17, 2023
163a975
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 17, 2023
516fd30
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 17, 2023
3ed8247
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 17, 2023
b2087ed
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 17, 2023
b8050b6
Update index.md
vagimeli Jul 17, 2023
d010d17
Update index.md
vagimeli Jul 17, 2023
06c0101
Update index.md
vagimeli Jul 18, 2023
3605b7a
Update triggers.md
vagimeli Jul 18, 2023
852f777
Update index.md
vagimeli Jul 18, 2023
421fd8c
Update _observing-your-data/alerting/index.md
vagimeli Jul 18, 2023
bceccd8
Update _observing-your-data/alerting/index.md
vagimeli Jul 18, 2023
4d7c99b
Update _observing-your-data/alerting/index.md
vagimeli Jul 18, 2023
461187d
Update _observing-your-data/alerting/index.md
vagimeli Jul 18, 2023
96b1fc0
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 18, 2023
f843205
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 18, 2023
5fe16eb
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 18, 2023
51af859
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 18, 2023
e6f7b95
Update _observing-your-data/alerting/triggers.md
vagimeli Jul 18, 2023
eb9b035
Update triggers.md
vagimeli Jul 18, 2023
f3a1ae7
Update triggers.md
vagimeli Jul 18, 2023
d7223d9
Update triggers.md
vagimeli Jul 18, 2023
83a126f
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
bcc865d
Address editorial feedback
vagimeli Jul 18, 2023
650a5ad
Address editorial feedback
vagimeli Jul 18, 2023
fc0ead0
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
704eaaa
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
c7f0943
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
94db20b
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
30a819c
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
439e1c5
Update _observing-your-data/alerting/monitors.md
vagimeli Jul 18, 2023
bf02d32
Address editorial feedback
vagimeli Jul 18, 2023
fd27d0b
Update actions.md
vagimeli Jul 19, 2023
c6a2235
Fix broken links
vagimeli Jul 19, 2023
3b49ed8
Fix broken links
vagimeli Jul 19, 2023
fad6068
Fix broken links
vagimeli Jul 19, 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
64 changes: 64 additions & 0 deletions _observing-your-data/alerting/actions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
---
layout: default
title: Actions
nav_order: 15
grand_parent: Alerting
parent: Monitors
redirect_from:
- /monitoring-plugins/alerting/monitors/
---

# Actions

Actions send notifications when trigger conditions are met. See [Notifications]({{site.url}}{{site.baseurl}}/notifications-plugin/index/) to learn about creating notifications. If you don't want to receive notifications, don't add actions to your triggers.

## Creating actions

To create an action:

1. In the **Triggers** panel, select **Add action**.
1. Enter the action details, including action name, notification channel, and notification message body, in the **Notification** section.

You can add variables to your messages using [Mustache templates](https://mustache.github.io/mustache.5.html/). You have access to `ctx.action.name`, the name of the current action, and all [trigger variables](#available-variables).

If your notification channel is a custom webhook that expects a particular data format, include JSON (or XML) directly in the message body:

```json
{% raw %}{ "text": "Monitor {{ctx.monitor.name}} just entered alert status. Please investigate the issue. - Trigger: {{ctx.trigger.name}} - Severity: {{ctx.trigger.severity}} - Period start: {{ctx.periodStart}} - Period end: {{ctx.periodEnd}}" }{% endraw %}
```

In the preceding example, the message content must conform to the `Content-Type` header in the [custom webhook]({{site.url}}{{site.baseurl}}/notifications-plugin/index/).

1. If you're using a bucket-level monitor, choose whether the monitor should perform an action for each execution or for each alert.
1. (Optional) Use action throttling to limit the number of notifications you receive within a given time frame.

For example, if a monitor checks a trigger condition every minute, you could receive one notification per minute. If you set action throttling to 60 minutes, you receive no more than one notification per hour, even if the trigger condition is met dozens of times in that hour.

1. Choose **Create**.

After an action sends a message, the content of that message has left the purview of the [Security]({{site.url}}{{site.baseurl}}/security-analytics/index/) plugin. Securing access to the message (for example, access to the Slack channel) is your responsibility.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved

#### Example message

```mustache
{% raw %}Monitor {{ctx.monitor.name}} just entered an alert state. Please investigate the issue.
- Trigger: {{ctx.trigger.name}}
- Severity: {{ctx.trigger.severity}}
- Period start: {{ctx.periodStart}}
- Period end: {{ctx.periodEnd}}{% endraw %}
```

To use the `ctx.results` variable in a message, use `{% raw %}{{ctx.results.0}}{% endraw %}` rather than `{% raw %}{{ctx.results[0]}}{% endraw %}`. This difference is due to how Mustache handles bracket notation.
{: .note }

#### Action variables

Variable | Data type | Description
:--- | :--- | : ---
`ctx.trigger.actions.id` | String | The action ID.
`ctx.trigger.actions.name` | String | The action name.
`ctx.trigger.actions.message_template.source` | String | The message to send in the alert.
`ctx.trigger.actions.message_template.lang` | String | The scripting language used to define the message. Must be Mustache.
`ctx.trigger.actions.throttle_enabled` | Boolean | Whether throttling is enabled for this trigger. See [adding actions](#add-actions) for more information about throttling.
`ctx.trigger.actions.subject_template.source` | String | The message's subject in the alert.
`ctx.trigger.actions.subject_template.lang` | String | The scripting language used to define the subject. Must be Mustache.
37 changes: 29 additions & 8 deletions _observing-your-data/alerting/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,38 @@ redirect_from:
---

# Alerting
OpenSearch Dashboards
{: .label .label-yellow :}

You can use the Alerting plugin in OpenSearch Dashboards to monitor your data and create alert notifications that trigger when conditions occur in one or more indexes.
To create an alert, you configure a _monitor_, which is a job that runs on a defined schedule and queries OpenSearch indexes; configure one or more _triggers_, which define the conditions that generate events; and configure _actions_, which is what happens after an alert is triggered.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved

You create a monitor with trigger conditions that generate various alert notifications through the message channel you select as a destination. Notifications can be sent to email, Slack, or Amazon Chime.
To get started with creating alerts:

The monitor you create notifies you when data from one or more OpenSearch indexes meets certain conditions. For example, you might want to notify a [Slack](https://slack.com/) channel if your application logs more than five HTTP 503 errors in one hour, or you might want to page a developer if no new documents have been indexed in the past 20 minutes.
1. Choose **Alerting** from the OpenSearch Plugins main menu, then **Create monitor**. If alerts exist, you'll see a list of those alerts and the Create monitor won't appear. In this case, select the **Monitors** tab, then **Create monitor**.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
2. Create a per query, per bucket, per cluster metrics, or per document monitor. For instructions, see [Monitors]({{site.url}}{{site.baseurl}}/observing-your-data/notifications/index/).
3. For Triggers, create one or more triggers. For instructions, see [Triggers[({{site.url}}{{site.baseurl}}/observing-your-data/alerting/triggers/)].
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
4. For Actions, set up a notification channel for the alert. For instructions, see [Actions]({{site.url}}{{site.baseurl}}/observing-your-data/alerting-actions).
vagimeli marked this conversation as resolved.
Show resolved Hide resolved

To get started, choose **Alerting** in OpenSearch Dashboards.
## Alerting terminology

![OpenSearch Dashboards side bar with link]({{site.url}}{{site.baseurl}}/images/dashboards-nav.png)
The following table lists alerting terminology commonly used in OpenSearch.

***Figure 1: Alerting plugin in OpenSearch Dashboards***
Term | Definition
:--- | :---
Monitor | A job that runs on a defined schedule and queries OpenSearch indexes. The results of these queries are then used as input for one or more *triggers*.
Trigger | Conditions that, if met, generate *alerts*.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Tag | A label that can be applied to multiple queries to combine them with the logical `OR` operation in a per document monitor. You cannot use tags with other monitor types.
Alert | An event associated with a trigger. When an alert is created, the trigger performs *actions*, which can include sending a notification.
Action | The information that you want the monitor to send out after being triggered. Actions have a *channel*, a message subject, and a message body.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Channel | A notification channel to use in an action. Supported channels are Amazon Chime, Slack, Amazon Simple Notification Service (Amazon SNS), email, or custom webhook. See [notifications]({{site.url}}{{site.baseurl}}/notifications-plugin/index/) for more information.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Finding | An entry for an individual document found by a per document monitor query that contains the document ID, index name, and timestamp. Findings are stored in the Findings index `.opensearch-alerting-finding*`.

## Alert states

The following table lists the alert states.

State | Description
:--- | :---
Active | The alert is ongoing and unacknowledged. Alerts remain in this state until you acknowledge them, delete the trigger associated with the alert, or delete the monitor entirely. Alerts also can be moved out of the active state if the trigger condition is no longer met. For example, if an index has 3,000 documents and a trigger condition is `numOfDocs > 5000`, an active alert is generated when 3,000 documents are added to the index. If the deletes 3,000 documents are deleted from the index, the alert changes to the completed state, as the condition is no longer triggered.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Acknowledged | Alert is acknowledged the alert, but the root cause is not fixed.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Completed | The alert is no longer ongoing. Alerts enter this state after the corresponding trigger evaluates to false.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Error | An error occurred while executing the trigger---usually the result of a bad trigger or destination.
Deleted | Someone deleted the monitor or trigger associated with this alert while the alert was ongoing.
vagimeli marked this conversation as resolved.
Show resolved Hide resolved
Loading