Prometheus AlertManager Integration Guide
Send Alertmanager alerts through webhooks.
Configure Prometheus AlertManager to send webhook notifications to Harness AI SRE when alerts fire.
Before you begin
Harness webhook endpoint: Create a Prometheus webhook in Harness AI SRE using the Prometheus webhook template.
AlertManager access: Permissions to modify AlertManager configuration.
Webhook URL: Copy the webhook URL from your Harness webhook configuration.
AlertManager configuration documentation: Go to Prometheus AlertManager Configuration to understand AlertManager setup and routing rules.
Webhook receiver reference: Go to Webhook Config for webhook-specific configuration options.
Configure AlertManager webhook receiver
Edit AlertManager configuration
AlertManager configuration is typically in alertmanager.yml. Add a webhook receiver configuration.
Add webhook receiver
route:
receiver: 'harness-ai-sre'
routes:
- match:
severity: critical
receiver: 'harness-ai-sre'
receivers:
- name: 'harness-ai-sre'
webhook_configs:
- url: 'https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>'
send_resolved: truereceivers:
- name: 'harness-ai-sre'
webhook_configs:
- url: 'https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>'
send_resolved: true
http_config:
authorization:
credentials: 'your-webhook-secret'route:
receiver: 'default'
group_by: ['alertname', 'cluster', 'service']
group_wait: 10s
group_interval: 10s
repeat_interval: 12h
routes:
# Critical alerts to Harness
- match:
severity: critical
receiver: 'harness-ai-sre'
continue: true
# Production alerts to Harness
- match:
environment: production
receiver: 'harness-ai-sre'
continue: true
receivers:
- name: 'harness-ai-sre'
webhook_configs:
- url: 'https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>'
send_resolved: true
max_alerts: 0 # Send all alertsReload AlertManager configuration
After updating the configuration:
Configure field mapping in Harness
In your Harness webhook configuration, map AlertManager payload fields to alert properties.
AlertManager webhook payload structure
Map basic fields
Use Mustache templates:
Advanced field mapping with CEL
Handle multiple alerts in batch
AlertManager sends alerts in batches. Handle multiple alerts:
Option 1: Process first alert only
Use the CEL above with webhook.alerts[0].
Option 2: Process all alerts separately
Configure AlertManager to send one alert per webhook:
Option 3: Create summary alert
Combine multiple alerts into one:
Test the integration
Trigger a test alert
Create a test alert in Prometheus:
Reload Prometheus rules:
Verify in AlertManager
Check AlertManager UI at http://localhost:9093 to see the alert.
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 AlertManager fields
version
Webhook payload format version
4
status
Alert batch status
firing, resolved
truncatedAlerts
Number of alerts truncated due to max_alerts
0
alerts
Array of alerts
See payload structure
alerts[].status
Individual alert status
firing, resolved
alerts[].labels
Alert labels (key-value)
{"alertname": "HighCPU", "severity": "critical"}
alerts[].annotations
Alert annotations
{"summary": "...", "description": "..."}
alerts[].startsAt
Alert start time
2025-07-01T10:30:00.000Z
alerts[].endsAt
Alert end time (for resolved)
2025-07-01T10:35:00.000Z
alerts[].generatorURL
Link to Prometheus query
http://prometheus:9090/graph?...
alerts[].fingerprint
Unique alert identifier
a1b2c3d4e5f6
groupLabels
Labels used for grouping
{"alertname": "HighCPU"}
commonLabels
Labels common to all alerts
{"severity": "critical"}
commonAnnotations
Annotations common to all
{"summary": "..."}
externalURL
AlertManager URL
http://alertmanager:9093
Advanced configuration
Route by severity
Send only critical alerts to Harness:
Filter by label
Send alerts matching specific labels:
Inhibition rules
Prevent lower-severity alerts when critical alerts are firing:
Troubleshooting
Example: complete integration
AlertManager configuration
Map fields in the Harness webhook
Next steps
Route alerts: Route and deduplicate Prometheus alerts.
Use CEL in webhooks: Add advanced filtering and batching logic.
AI agent: Enable automated alert investigation.
Prometheus template: Use the pre-configured template.
Related documentation
Prometheus official documentation
AlertManager configuration: Complete guide to AlertManager configuration, webhook receivers, and routing rules.
Webhook config: Webhook receiver configuration options (
url,send_resolved,max_alerts,http_config).Notifications: Webhook payload format, alerts array structure, labels, and annotations.
Notification examples: Example webhook payloads and field names.
Last updated
Was this helpful?