Contact Points
Contact points contain the configuration for sending alert notifications. You can assign a contact point either in the alert rule or notification policy options. For a complete explanation on notification policies, refer to the upstream Grafana documentation.
The following snippet shows an example contact point which notifies a specific email address and a webhook endpoint. It also highlights how secrets and config maps can utilized to externalize some of the configuration. This is especially useful for contact points which contain sensitive information.
To view the entire configuration that you can do within Contact-Points, look at our API documentation.
apiVersion: v1
kind: Secret
metadata:
name: contacts
stringData:
alert-mails: "foo@example.com"
alert-hook: "webhook.example.invalid"
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaContactPoint
metadata:
name: grafanacontactpoint-sample
spec:
name: Optional Name
instanceSelector:
matchLabels:
instance: my-grafana-stack
# Editing ContactPoints in the UI is disabled by default
editable: true # editable is immutable and can only be set at creation
receivers:
- type: email
settings:
subject: Grafana Alert
valuesFrom:
- targetPath: addresses
valueFrom:
secretKeyRef:
name: contacts
key: alert-mails
- type: webhook
settings:
title: Grafana Alert
valuesFrom:
- targetPath: url
valueFrom:
secretKeyRef:
name: contacts
key: alert-hook
Deprecated Single receiver format
GrafanaContactPoint did not support multiple receivers prior to v5.21.0.
The previous format is now deprecated, but is still supported.
The fields .spec.type, .spec.settings, and .spec.valuesFrom are entirely ignored when .spec.recievers[...] is configured, but the below configuration is still valid for the duration of v1beta1.
This means full backwards compatibility during transitions to the receivers field.
---
apiVersion: grafana.integreatly.org/v1beta1
kind: GrafanaContactPoint
metadata:
name: previous-format
spec:
name: required
instanceSelector:
matchLabels:
instance: my-grafana-stack
type: "email"
settings:
subject: 'Grafana Alert'
valuesFrom:
- targetPath: addresses
valueFrom:
secretKeyRef:
name: contacts
key: alert-mails