---
title: "Configure Grafana Cloud Knowledge Graph notifications | Grafana Cloud documentation"
description: "Learn how to configure notifications for the knowledge graph"
---

# Configure Grafana Cloud Knowledge Graph notifications

This topic describes how to configure knowledge graph notifications so that you can link back to [RCA workbench](/docs/grafana-cloud/monitor-applications/asserts/troubleshoot-infra-apps/workbench/) from SLO and knowledge graph notification alerts.

If you’re new to notifications in the knowledge graph, refer to [How notifications work](/docs/grafana-cloud/knowledge-graph/reference/notifications/).

> Note
> 
> If you use the [mimirtool](/docs/mimir/latest/manage/tools/mimirtool/#grafana-mimirtool) for [syncing](/docs/mimir/latest/manage/tools/mimirtool/#sync) rule group state, this can cause unauthorized errors because the knowledge graph was enabled. Errors occur because the knowledge graph rules are stored in a protected namespace that our users can’t change.
> 
> Before you instruct mimirtool to ignore the knowledge graph namespace, [deactivate the knowledge graph](/docs/grafana-cloud/knowledge-graph/get-started/#deactivate-the-knowledge-graph). After you have set up ignoring the namespace with mimirtool, [re-activate the knowledge graph](/docs/grafana-cloud/knowledge-graph/get-started/#re-activating-the-knowledge-graph).

## Before you begin

Before you configure Grafana Cloud Knowledge Graph notifications, ensure that you have configured a [contact point](/docs/grafana-cloud/alerting-and-irm/alerting/configure-notifications/manage-contact-points/).

You route knowledge graph notifications through Grafana Alerting contact points. To connect the knowledge graph to external incident-management tools such as PagerDuty, Opsgenie, Jira, Slack, webhooks, and other supported integrations, use Grafana Alerting contact points.

> Note
> 
> Knowledge graph notifications are only supported with the Prometheus Alertmanager and not the Grafana Alertmanager.

## Configure SLO alerts

If you are managing SLOs from the knowledge graph, you must create a notification policy and configure an Alertmanager template.

### Create a notification policy

To create a notification policy, complete the following steps:

1. In the left-side menu, click **Alerts &amp; IRM &gt; Alerting &gt; Notification policies**.
2. From the **Choose Alertmanager** drop-down menu, select the Prometheus Alertmanager.
   
   By default, the Grafana Alertmanager is selected.
3. Click **+New child policy** from the default policy.
4. In the **Matching labels** section, add the following labels and values:
   
   Expand table
   
   | Label                    | Operator | Value      |
   |--------------------------|----------|------------|
   | `grafana_slo_provenance` | `=`      | `asserts`  |
   | `grafana_slo_severity`   | `=`      | `critical` |
5. In the **Contact point** drop-down menu, select the contact point to send notifications to.
6. Select the `Override grouping` toggle.
7. Select or enter the following **Group by** values:
   
   - `alertname`
   - `asserts_env`
   - `namespace`
8. Click **Save policy**.

### Configure Alertmanager template

If the knowledge graph manages your SLO, you can link back to RCA workbench by modifying an existing Alertmanager template.

#### Modify Alertmanager template

You can modify your existing Alertmanager template to include a URL that links back to [RCA workbench](/docs/grafana-cloud/monitor-applications/asserts/troubleshoot-infra-apps/workbench/).

The following code snippet shows how to modify a Slack template:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
{{- if eq .CommonLabels.grafana_slo_provenance "asserts" }}
  :fire: *<INSTANCE_URL/a/grafana-asserts-app/assertions?env[0]={{ .CommonLabels.asserts_env }}{{ with .CommonLabels.asserts_site }}&site[0]={{ . }}{{ end }}&grafana_slo_uuid={{ .CommonLabels.grafana_slo_uuid }}&start={{(index .Alerts 0).StartsAt.Unix}}000-30m&end={{(index .Alerts 0).StartsAt.Unix}}000%2B30m|Asserts RCA workbench>*
{{- end }}
```

Where `INSTANCE_URL` is the URL of the instance the knowledge graph is running, for example:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
https://acme.grafana.net
```

## Configure notification alerts

The knowledge graph also lets you to create notifications from assertions. For more information about how notification alerts work, refer to [How notifications work in Grafana Cloud Knowledge Graph](/docs/grafana-cloud/knowledge-graph/reference/notifications/).

To configure a knowledge graph notification alert, you must create a notification policy and configure an Alertmanager template.

### Create a notification policy

To create a notification policy, complete the following steps:

1. In the left-side menu, click **Alerts &amp; IRM &gt; Alerting &gt; Notification policies**.
2. From the **Choose Alertmanager** drop-down menu, select the Prometheus Alertmanager.
   
   By default, the Grafana Alertmanager is selected.
3. Click **+New child policy** from the default policy.
4. In the **Matching labels** section, add the following labels and values:
   
   Expand table
   
   | Label                    | Operator | Value                 |
   |--------------------------|----------|-----------------------|
   | `asserts_alert_category` | `=~`     | `.+`                  |
   | `alertname`              | `=`      | `NOTIFICATION_ALERTS` |
5. In the **Contact point** drop-down, select the contact point to send notifications to.
6. Select the `Override grouping` toggle.
7. Select or enter the following **Group by** values:
   
   - `alertname`
   - `asserts_env`
   - `asserts_notification_rule_name`
   - `namespace`
   - `source_alertname`
8. Click **Save policy**.

> Note
> 
> For notification alerts, the `alertname` label is always `NOTIFICATION_ALERTS`. To get the original/actual `alertname`, use `source_alertname`.

### Configure Alertmanager template

When using knowledge graph notifications, you can link back to RCA workbench by modifying an existing Alertmanager template.

#### Modify Alertmanager template

You can modify your existing Alertmanager template to include a URL that links back to [RCA workbench](/docs/grafana-cloud/monitor-applications/asserts/troubleshoot-infra-apps/workbench/).

The following code snippet shows how to modify a Slack template:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
{{- if eq .GroupLabels.alertname "NOTIFICATION_ALERTS" }}
  {{- $url := "INSTANCE_URL/a/grafana-asserts-app/alert-affected-entity?" }}
  {{- range $key, $value := (index .Alerts 0).Labels }}
    {{- $url = printf "%s%s=%s&" $url ($key | urlquery) ($value | urlquery) }}
  {{- end }}
  {{- $start := (index .Alerts 0).StartsAt.Unix}}
  {{- $url = printf "%salert_start_time=%d000-30m&alert_end_time=%d000%%2B30m" $url $start $start }}
  :fire: *<{{ $url }}|Asserts RCA Workbench>*
{{- end }}
```

Where `INSTANCE_URL` is the URL of the instance the knowledge graph is running, for example:

![Copy code to clipboard](/media/images/icons/icon-copy-small-2.svg) Copy

```none
https://acme.grafana.net
```

## Manage notification alerts using Terraform

You can also manage notification alerts configurations using Terraform for infrastructure as code workflows. This enables version control, automated deployments, and consistent configuration across environments.

For information about managing notification alerts with Terraform, refer to [Configure notification alerts using Terraform](/docs/grafana-cloud/as-code/infrastructure-as-code/terraform/terraform-knowledge-graph/notification-alerts/).

## Next steps

After configuring your notification channels, learn how to create and test them in [Create notification rules](/docs/grafana-cloud/knowledge-graph/configure/notifications/create-rules/).
