Skip to content

Using Privacera Notification Templates in Grafana

This guide explains how to use the pre-configured Privacera notification templates with your contact points in Grafana.


Overview

Privacera provides a pre-configured notification template in Grafana that helps standardize alert notifications across your organization. The template is designed to deliver well-formatted, Kubernetes-aware alerts with actionable information and direct links to relevant resources.


Template Structure

The Privacera notification template (privacera.alert.message.template) includes the following structure:

Text Only
Summary: [Alert Summary from Annotations]

📊 Container: [Container Name]
📦 Pod: [Pod Name]
📁 Namespace: [Namespace]

🧩 Resolution Strategy:  
[Resolution steps from Annotations]

🌐 Source: [Direct link to Grafana dashboard]
🔕 Silence: [Link to create silence rule]

🧩 Additional Labels:  
[All other relevant labels except container, pod, and namespace]

Sample Notification Template

Below is an example of how a notification using the Privacera template appears in Slack.

Sample Notification Template


Associating Template with Contact Points

Step 1: Access Contact Points

  1. Log in to your Grafana instance.
  2. Navigate to Alerts & IRMAlertingContact points.

Step 2: Create or Edit a Contact Point

  1. Either click on an existing contact point or select + Add contact point.
  2. Enter a descriptive name (e.g., Privacera Slack Alerts).
  3. Select your preferred notification channel (Slack is recommended).
  4. Fill in the required configuration fields (e.g., Slack Webhook URL, channel).

Step 3: Apply the Template

  1. Scroll down and expand the Optional settings section.
  2. Click Edit next to the Message, Text Body, or integration-specific message field.
  3. In the dialog box, choose Select notification template.
  4. Select the privacera.alert.message.template from the list.
  5. Alternatively, select Enter custom message and paste the following:

    Jinja Template Snippet

    Django/Jinja
    {{ template "privacera.alert.message.template" . }}
    

  6. Click Save to apply the template.


Step 4: Save Configuration

  1. Click Save contact point to save the changes.
  2. Your contact point is now using the Privacera notification template.

Testing the Configuration

  1. In the contact point list, find your configured contact point.
  2. Click the Test button.
  3. Verify that the test notification is received with the Privacera template format.

Troubleshooting

If you encounter any issues:

  1. Template not applied correctly - Ensure privacera.alert.message.template is selected or pasted correctly.

  2. Slack or other channel misconfigured - Double-check channel credentials (webhook URL, tokens, etc.). - Validate message formatting with test alerts.

  3. Kubernetes context missing - Make sure your alert rules include namespace, pod, and container labels.

  4. Missing permissions - Ensure the user or token has permissions to view dashboards and create silence rules.


Comments