Skip to content

Commit

Permalink
apply suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
tonypowa committed Dec 18, 2024
1 parent 096ecbd commit f7b3c40
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 61 deletions.
2 changes: 1 addition & 1 deletion grafana/alerting-get-started-pt3/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Grouping is configured by using labels in the notification policy that reference

In this tutorial, you will:

- Understand how alert rule grouping works.
- Learn how alert rule grouping works.

- Create a notification policy to handle grouping.

Expand Down
21 changes: 13 additions & 8 deletions grafana/alerting-get-started-pt3/preprocessed.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ Grouping is configured by using labels in the notification policy that reference

In this tutorial, you will:

- Understand how alert rule grouping works.
- Learn how alert rule grouping works.
- Create a notification policy to handle grouping.
- Define an alert rule for a real-world scenario.
- Receive and review grouped alert notifications.
Expand Down Expand Up @@ -267,10 +267,15 @@ To follow the above example, we will create notification policies that route ale

These nested policies should route alert instances where the region label is either us-west or us-east.

**Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry will be saved, and the previous one will be discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
For identical label keys use regex matchers (e.g., _region=~"us-west|us-east"_).
> **Note:**
> **Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry will be saved, and the previous one will be discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
> For identical label keys use regex matchers (e.g., _region=~"us-west|us-east"_).
<!-- INTERACTIVE ignore END -->

> **Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry will be saved, and the previous one will be discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
> For identical label keys use regex matchers (e.g., _region=~"us-west|us-east"_).
<!-- INTERACTIVE ignore END -->


1. Visit [http://localhost:3000](http://localhost:3000), where Grafana should be running
Expand Down Expand Up @@ -312,7 +317,7 @@ To follow the above example, we will create notification policies that route ale

- Repeat for `region = us-east` with a different webhook or a different contact point.

**Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry will be saved, and the previous one will be discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
**Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry is saved, and the previous one is discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
For identical label keys use regex matchers (e.g., _region=~"us-west|us-east"_).


Expand All @@ -323,20 +328,20 @@ To follow the above example, we will create notification policies that route ale

In this section we configure an alert rule based on our application monitoring example.

1. Go to **Alerting > Alert rules**.
1. Navigate to **Alerting > Alert rules**.
2. Click **New alert rule**.

### Enter an alert rule name

Make it short and descriptive as this will appear in your alert notification. For instance, `High CPU usage - Multi-region`.
Make it short and descriptive as this appears in your alert notification. For instance, `High CPU usage - Multi-region`.

### Define query and alert condition

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).

Grafana includes a [test data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) that creates simulated time series data. This data source is included in the demo environment for this tutorial. If you're working in Grafana Cloud or your own local Grafana instance, you can add the data source through the **Connections** menu.

1. Select **TestData** data source from the drop-down menu.
1. From the drop-down menu, select **TestData** data source.
1. From **Scenario** select **CSV Content**.
1. Copy in the following CSV data:

Expand Down
49 changes: 0 additions & 49 deletions grafana/alerting-get-started-pt3/step4.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,52 +5,3 @@
[Notification policies](ref:notification-policies) group alert instances and route notifications to specific contact points.

To follow the above example, we will create notification policies that route alert instances based on the `region`{{copy}} label to specific contact points. This setup ensures that alerts for a given region are consolidated into a single notification. Additionally, we will fine-tune the **timing settings** for each region by overriding the default parent policy, allowing more granular control over when notifications are sent.

1. Visit [http://localhost:3000]({{TRAFFIC_HOST1_3000}}), where Grafana should be running

1. Navigate to **Alerts & IRM > Alerting > Notification policies**.

1. In the Default policy, click **+ New child policy**.

- In the Default policy, click **+ New child policy**.

- **Label**: `region`{{copy}}

- **Operator**: `=`{{copy}}

- **Value**: `us-west`{{copy}}

This label matches alert rules where the region label is us-west

1. Choose a **Contact point**:

- Select **Webhook**.

If you don’t have any contact points, add a Contact point.

1. Enable Continue matching:

- Turn on **Continue matching subsequent sibling nodes** so the evaluation continues even after one or more labels (i.e. region label) match.

1. Override grouping settings:

- Toggle **Override grouping**.

- **Group by**: `region`{{copy}}.

**Group by** consolidates alerts that share the same grouping label into a single notification. For example, all alerts with `region=us-west`{{copy}} will be combined into one notification, making it easier to manage and reducing alert fatigue.

1. Set custom timing:

- Toggle **Override general timings**.

- **Group interval**: `2m`{{copy}}. This ensures follow-up notifications for the same alert group will be sent at intervals of 2 minutes.

**Timing options** control how often notifications are sent and can help balance timely alerting with minimizing noise.

1. Save and repeat:

- Repeat for `region = us-east`{{copy}} with a different webhook or a different contact point.

**Note**: In Grafana, each label within a notification policy must have a unique key. If you attempt to add the same label key (e.g., region) with different values (us-west and us-east), only the last entry will be saved, and the previous one will be discarded. This is because labels are stored as associative arrays (maps), where each key must be unique.
For identical label keys use regex matchers (e.g., _region=~“us-west|us-east”_).
6 changes: 3 additions & 3 deletions grafana/alerting-get-started-pt3/step5.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@

In this section we configure an alert rule based on our application monitoring example.

1. Go to **Alerting > Alert rules**.
1. Navigate to **Alerting > Alert rules**.

1. Click **New alert rule**.

## Enter an alert rule name

Make it short and descriptive as this will appear in your alert notification. For instance, `High CPU usage - Multi-region`{{copy}}.
Make it short and descriptive as this appears in your alert notification. For instance, `High CPU usage - Multi-region`{{copy}}.

## Define query and alert condition

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`{{copy}} field in the UI), and the condition that must be met for the alert to be triggered (in default mode is the threshold).

Grafana includes a [test data source](https://grafana.com/docs/grafana/latest/datasources/testdata/) that creates simulated time series data. This data source is included in the demo environment for this tutorial. If you’re working in Grafana Cloud or your own local Grafana instance, you can add the data source through the **Connections** menu.

1. Select **TestData** data source from the drop-down menu.
1. From the drop-down menu, select **TestData** data source.

1. From **Scenario** select **CSV Content**.

Expand Down

0 comments on commit f7b3c40

Please sign in to comment.