For the complete documentation index, see llms.txt. This page is also available as Markdown.

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: true
receivers:
  - 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 alerts

Reload 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:

  1. Navigate to Alerts in Harness AI SRE

  2. Check that the test alert appears

  3. Verify field mapping is correct


Available AlertManager fields

Field
Description
Example

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

Prometheus AlertManager webhook is not sending alerts to Harness AI SRE

Check the AlertManager logs, verify the configuration syntax with amtool check-config, and test the webhook URL manually with curl.

Prometheus AlertManager alerts are not appearing in Harness AI SRE

Check the Harness webhook logs for errors, verify the CEL filter logic by removing the filter temporarily, and inspect the raw payload in the AlertManager webhook logs.

Prometheus AlertManager is creating multiple duplicate alerts in Harness AI SRE

Adjust the AlertManager group_by and group_interval settings, and use Harness alert routing rules to deduplicate by fingerprint.

Resolved Prometheus AlertManager alerts are not clearing in Harness AI SRE

Set send_resolved: true in the AlertManager webhook config, and handle the resolved status in the Harness CEL severity mapping.


Example: complete integration

AlertManager configuration

Map fields in the Harness webhook


Next steps


Prometheus official documentation

Last updated

Was this helpful?