mirror of
https://github.com/grafana/grafana.git
synced 2025-08-03 00:42:03 +08:00
alerting>tutorials:simple alert creation flow (#95134)
* alerting>tutorials:simple alert creation flow * change step instruction * added ref * added ref2 * refs3 * all pretty no pity * Update docs/sources/tutorials/alerting-get-started/index.md Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com> * updated instructions in all the tutorials * small changes * link * link2 * removed will offenders * minor update * typo * removed ref --------- Co-authored-by: brendamuir <100768211+brendamuir@users.noreply.github.com>
This commit is contained in:
@ -384,7 +384,7 @@ The most basic alert rule consists of two parts:
|
||||
|
||||
1. An _Alert rule_ - An Alert rule defines one or more _conditions_ that Grafana regularly evaluates. When these evaluations meet the rule's criteria, the alert rule is triggered.
|
||||
|
||||
To begin, let's set up a webhook contact point. Once we have a usable endpoint, we'll write an alert rule and trigger a notification.
|
||||
To begin, let's set up a webhook contact point. Once we have a usable endpoint, we write an alert rule and trigger a notification.
|
||||
|
||||
<!-- INTERACTIVE page step8.md END -->
|
||||
|
||||
@ -392,7 +392,7 @@ To begin, let's set up a webhook contact point. Once we have a usable endpoint,
|
||||
|
||||
### Create a contact point for Grafana-managed alert rules
|
||||
|
||||
In this step, we'll set up a new contact point. This contact point will use the _webhooks_ channel. In order to make this work, we also need an endpoint for our webhook channel to receive the alert notification. We will use [requestbin.com](https://requestbin.com) to quickly set up that test endpoint. This way we can make sure that our alert manager is actually sending a notification somewhere.
|
||||
In this step, we set up a new contact point. This contact point will use the _webhooks_ channel. In order to make this work, we also need an endpoint for our webhook channel to receive the alert notification. We will use [requestbin.com](https://requestbin.com) to quickly set up that test endpoint. This way we can make sure that our alert manager is actually sending a notification somewhere.
|
||||
|
||||
1. Browse to [requestbin.com](https://requestbin.com).
|
||||
1. Under the **Create Request Bin** button, click the link to create a **public bin** instead.
|
||||
@ -423,18 +423,20 @@ We have now created a dummy webhook endpoint and created a new Alerting Contact
|
||||
Now that Grafana knows how to notify us, it's time to set up an alert rule:
|
||||
|
||||
1. In Grafana's sidebar, hover over the **Alerting** (bell) icon and then click **Alert rules**.
|
||||
|
||||
In this tutorial, we use the default options for Grafana-managed alert rule creation. The default options let us define the query, a expression (used to manipulate the data -- the `WHEN` field in the UI), and the condition that must be met for the alert to be triggered (in default mode is the threshold).
|
||||
|
||||
1. Click **+ New alert rule**.
|
||||
1. For **Section 1**, name the rule `fundamentals-test`.
|
||||
1. For **Section 2**, Find the **query A** box. Choose your Prometheus data source. Note that the rule type should automatically switch to Grafana-managed alert rule.
|
||||
1. Switch to code mode by checking the Builder/Code toggle.
|
||||
1. For **Section 2**, Find the **query A** box, and choose your Prometheus data source.
|
||||
1. Enter the same Prometheus query that we used in our earlier panel:
|
||||
|
||||
```
|
||||
sum(rate(tns_request_duration_seconds_count[5m])) by(route)
|
||||
```
|
||||
|
||||
1. Scroll down to bottom of section #2 and click the **Preview** button. You should see some data returned.
|
||||
1. Keep expressions “B” and "C" as they are. These expressions (Reduce and Threshold, respectively) are included by default when creating a new rule. Expression "B", selects the last value of our query “A”, while the Threshold expression "C" will check if the last value from expression "B" is above a specific value. In addition, the Threshold expression is the alert rule condition by default. Enter `0.2` as threshold value. [You can read more about queries and conditions here](/docs/grafana/latest/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries).
|
||||
1. Scroll down to bottom of section #2 and click the **Preview alert rule condition** button. You should see some data returned.
|
||||
1. Keep `Last` as the value for the reducer function (`WHEN`), and `0.2` as the threshold value. This is the value above which the alert rule should trigger. [You can read more about queries and conditions here](/docs/grafana/latest/alerting/fundamentals/alert-rules/queries-conditions/#expression-queries).
|
||||
1. In **Section 3**, in Folder, create a new folder, by clicking `New folder` and typing a name for the folder. This folder will contain our alert rules. For example: `fundamentals`. Then, click `create`.
|
||||
1. In the Evaluation group, repeat the above step to create a new one. We will name it `fundamentals` too.
|
||||
1. Choose an Evaluation interval (how often the alert rule will be evaluated). For example, every `10s` (10 seconds).
|
||||
|
Reference in New Issue
Block a user