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:
antonio
2024-10-23 11:53:40 +02:00
committed by GitHub
parent 567a3803c5
commit 01b75828ba
3 changed files with 18 additions and 19 deletions

View File

@ -24,7 +24,7 @@ killercoda:
# Get Started with Grafana Alerting - Part 1
In this guide, we'll walk you through the process of setting up your first alert in just a few minutes. You'll witness your alert in action with real-time data, as well as sending alert notifications.
In this guide, we walk you through the process of setting up your first alert in just a few minutes. You'll witness your alert in action with real-time data, as well as sending alert notifications.
In this tutorial you will:
@ -154,7 +154,7 @@ To demonstrate the observation of data using the Grafana stack, download and run
Besides being an open-source observability tool, Grafana has its own built-in alerting service. This means that you can receive notifications whenever there is an event of interest in your data, and even see these events graphed in your visualizations.
In this step, we'll set up a new [contact point](https://grafana.com/docs/grafana/latest/alerting/configure-notifications/manage-contact-points/integrations/webhook-notifier/). This contact point will use the _webhooks_ integration. In order to make this work, we also need an endpoint for our webhook integration to receive the alert. We will use [Webhook.site](https://webhook.site/) to quickly set up that test endpoint. This way we can make sure that our alert is actually sending a notification somewhere.
In this step, we set up a new [contact point](https://grafana.com/docs/grafana/latest/alerting/configure-notifications/manage-contact-points/integrations/webhook-notifier/). This contact point will use the _webhooks_ integration. In order to make this work, we also need an endpoint for our webhook integration to receive the alert. We will use [Webhook.site](https://webhook.site/) to quickly set up that test endpoint. This way we can make sure that our alert is actually sending a notification somewhere.
1. In your browser, **sign in** to your Grafana Cloud account.
@ -187,7 +187,7 @@ We have created a dummy Webhook endpoint and created a new Alerting contact poin
## Create an alert
Next, we'll establish an [alert rule](http://grafana.com/docs/grafana/next/alerting/fundamentals/alert-rule-evaluation/) within Grafana Alerting to notify us whenever alert rules are triggered and resolved.
Next, we establish an [alert rule](https://grafana.com/docs/grafana/latest/alerting/alerting-rules/create-grafana-managed-rule/) within Grafana Alerting to notify us whenever alert rules are triggered and resolved.
1. In Grafana, **navigate to Alerting** > **Alert rules**. Click on **New alert rule**.
@ -195,10 +195,9 @@ Next, we'll establish an [alert rule](http://grafana.com/docs/grafana/next/alert
### Define query and alert condition
In this section, we define queries, expressions (used to manipulate the data), and the condition that must be met for the alert to be triggered.
In this section, 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. Select the **Prometheus** data source from the drop-down menu.
1. In the Query editor, switch to **Code** mode by clicking the button at the right.
1. Enter the following query:
```promql
@ -207,18 +206,15 @@ In this section, we define queries, expressions (used to manipulate the data), a
In Prometheus, `vector(1)` is a special type of PromQL query that generates a constant vector. This is useful in testing and query manipulation, where you might need a constant value for calculations or comparisons. This query will allow you to create an alert rule that will be always firing.
1. Remove the B **Reduce expression** (click the bin icon). The Reduce expression comes by default, and in this case, it is not needed since the queried data is already reduced. Note that the Threshold expression is now your **Alert condition**.
1. In the **Alert condition** section:
1. In the C **Threshold expression**:
- Keep `Last` as the value for the reducer function (`WHEN`), and `0` as the threshold value. This is the value above which the alert rule should trigger.
- Change the **Input** to **'A'** to select the data source.
- Enter `0` as the threshold value. This is the value above which the alert rule should trigger.
1. Click **Preview** to run the queries.
1. Click **Preview alert rule condition** to run the query.
It should return a single sample with the value 1 at the current timestamp. And, since `1` is above `0`, the alert condition has been met, and the alert rule state is `Firing`.
{{< figure src="/media/docs/alerting/alerting-always-firing-alert.png" max-width="1200px" caption="A preview of a firing alert" >}}
{{< figure src="/media/docs/alerting/firing-alert-preview.png" max-width="1200px" caption="A preview of a firing alert" >}}
### Set evaluation behavior