Grafana Integration Guide
Send unified alerting through webhooks.
Configure Grafana Unified Alerting to send webhook notifications to Harness AI SRE when alerts fire.
Before you begin
Harness webhook endpoint: Create a Grafana webhook in Harness AI SRE using the Grafana webhook template.
Grafana access: Admin permissions to configure contact points and notification policies.
Webhook URL: Copy the webhook URL from your Harness webhook configuration.
Grafana version: This guide covers Grafana 8.0+ with Unified Alerting. For legacy alerting, go to the Grafana documentation.
Unified Alerting documentation: Go to Grafana Unified Alerting to understand contact points and notification policies.
Webhook configuration reference: Go to Manage Contact Points for webhook setup details.
Create webhook contact point
Navigate to alerting configuration
Open the contact points configuration in Grafana:
In Grafana, go to Alerting, then select Contact points
Click New contact point
Configure webhook contact point
Name:
Harness AI SREIntegration: Select Webhook
URL: Your Harness webhook URL
https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>HTTP Method:
POST
Name:
Harness AI SREIntegration: Select Webhook
URL: Your Harness webhook URL
HTTP Method:
POSTAuthorization: Add custom header
Header:
X-Webhook-SecretValue:
your-secret-key
Name:
Harness AI SREIntegration: Select Webhook
URL: Your Harness webhook URL
HTTP Method:
POSTMax alerts: Leave blank to send all alerts
Disable resolved message: Uncheck to send resolved notifications
HTTP settings:
Authorization: Custom header if needed
User: Leave blank
Password: Leave blank
Test contact point
Click Test to send a test notification and verify the webhook is reachable.
Save contact point
Click Save contact point to create the webhook integration.
Configure notification policy
Edit default notification policy
Route alerts to the Harness contact point:
Go to Alerting, then select Notification policies
Edit the Default policy or create a new nested policy
Select Harness AI SRE as the contact point
Create specific routing policy
For selective alert routing:
Click New nested policy
Configure matching labels:
Label:
severityOperator:
=Value:
critical
Select Harness AI SRE contact point
Click Save policy
Configure field mapping in Harness
In your Harness webhook configuration, map Grafana payload fields to alert properties.
Grafana webhook payload structure
Map basic fields
Use Mustache templates:
Advanced field mapping with CEL
Test the integration
Create test alert rule
Create a rule that fires immediately to confirm delivery:
Go to Alerting, then select Alert rules
Click New alert rule
Configure a simple test rule:
Alert rule name:
Test Harness IntegrationQuery: Use a test query that always fires
Condition: Set threshold that will trigger
Evaluate every:
1mFor:
0m
Add labels:
severity:warningtest:true
Add annotations:
summary:Test alert for Harness integration
Select notification policy or contact point
Click Save rule and exit
Verify in Grafana
Confirm the rule fired and the notification was sent:
Go to Alerting, then select Alert rules
Wait for the rule to evaluate and fire
Check Contact points, then Harness AI SRE, for recent notifications
Verify in Harness
Confirm the alert arrived and mapped correctly:
Navigate to Alerts in Harness AI SRE
Check that the test alert appears
Verify field mapping is correct
Available Grafana fields
receiver
Contact point name
Harness AI SRE
status
Alert status
firing, resolved
alerts
Array of firing alerts
See payload structure
alerts[].labels
Alert labels
{"alertname": "...", "severity": "critical"}
alerts[].annotations
Alert annotations
{"summary": "...", "description": "..."}
alerts[].startsAt
Alert start time
2025-07-01T10:30:00.000Z
alerts[].endsAt
Alert end time
0001-01-01T00:00:00Z (if not resolved)
alerts[].generatorURL
Link to alert rule
https://grafana.../alerting/.../view
alerts[].dashboardURL
Link to dashboard
https://grafana.../d/dashboard-id
alerts[].panelURL
Link to specific panel
https://grafana.../d/dashboard-id?viewPanel=1
alerts[].fingerprint
Unique alert ID
a1b2c3d4e5f6
alerts[].values
Query result values, keyed by refID
{"B": 95.2}
title
Pre-formatted alert title
[FIRING:1] High CPU Usage
message
Pre-formatted alert message
Multi-line formatted message
groupLabels
Labels used for grouping
{"alertname": "..."}
commonLabels
Labels common to all alerts
{"severity": "critical"}
commonAnnotations
Annotations common to all
{"summary": "..."}
externalURL
Grafana instance URL
https://grafana.example.com
Advanced configuration
Route by folder
Send alerts from specific Grafana folders to different Harness webhooks:
Grafana notification policy:
Create nested policy with label matcher:
Label:
grafana_folderOperator:
=Value:
Production
Select appropriate contact point
Route by data source
Label alerts by data source and route accordingly:
Alert rule labels:
Notification policy matcher:
Label:
datasourceOperator:
=Value:
prometheus
Silence alerts
Use Grafana's silence URL in Harness:
Multi-dimensional alerts
Grafana supports multi-dimensional alerting. Access all dimensions:
Troubleshooting
Example: complete integration
Grafana contact point configuration
Configure the contact point with these settings:
Name:
Harness AI SREIntegration: Webhook
URL:
https://app.harness.io/gateway/ai-sre/api/webhooks/wh_abc123HTTP Method: POST
Disable resolved message: Unchecked
Grafana notification policy
Map fields in the Harness webhook
Next steps
Route alerts: Route and deduplicate Grafana alerts.
Use CEL in webhooks: Add custom filtering logic.
AI agent: Enable automated alert investigation.
Grafana template: Use the pre-configured template.
Related documentation
Grafana official documentation
Unified Alerting: Complete guide to Grafana Unified Alerting, contact points, and notification policies.
Manage contact points: Webhook contact point setup and configuration options.
Template notifications: Webhook payload structure and available fields.
Webhook notifier: Complete payload structure reference (alerts array, labels, annotations, URLs).
Last updated
Was this helpful?