Add a contact point

A contact point defines where Grafana sends notifications when an alert fires. You can configure email, Slack, PagerDuty, webhooks, and many other integrations. For this path, you’ll create an email contact point.

To add a contact point, complete the following steps:

  1. Add the following to your alerts.tf file:

    hcl
    resource "grafana_contact_point" "email_alerts" {
      name = "Email alerts"
    
      email {
        addresses = ["<YOUR_EMAIL_ADDRESS>"]
      }
    }
  2. Replace <YOUR_EMAIL_ADDRESS> with your email address.

Alternative: Slack contact point

If you prefer Slack notifications, use the slack block instead:

hcl
resource "grafana_contact_point" "slack_alerts" {
  name = "Slack alerts"

  slack {
    url     = var.slack_webhook_url
    title   = "{{ .CommonLabels.alertname }}"
    text    = "{{ .CommonAnnotations.description }}"
  }
}

For the full list of supported integrations, refer to the grafana_contact_point resource documentation.

In the next milestone, you add a notification policy to route alerts to this contact point.


page 6 of 10