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

OpsGenie Integration Guide

Send alerts through webhooks.

Configure Opsgenie to send webhook notifications to Harness AI SRE when alerts are created, updated, or closed.

Before you begin

  • Harness webhook endpoint: Create an Opsgenie webhook in Harness AI SRE using the Opsgenie webhook template.

  • Opsgenie access: Admin permissions or integration management permissions.

  • Webhook URL: Copy the webhook URL from your Harness webhook configuration.

  • Outgoing webhook documentation: Go to Outgoing Webhook Integration for setup guidance.

  • Alert API reference: Go to Alert API to understand alert field definitions and structure.


Create webhook integration

Open the integrations configuration in Opsgenie:

  1. In Opsgenie, go to Settings, then select Integrations

  2. Click Add integration

  3. Search for Webhook or select Outgoing Webhook

Configure webhook integration

  • Name: Harness AI SRE

  • Integration type: Outgoing Webhook

  • Webhook URL: Your Harness webhook URL

    https://<your-harness-instance>/gateway/ai-sre/api/webhooks/<webhook-id>
  • Enabled: Check to activate

  • Add alert actions: Select actions to trigger webhook

    • Create

    • Update Priority

    • Acknowledge

    • Close

    • Add Note

  • Name: Harness AI SRE

  • Webhook URL: Your Harness webhook URL

  • Custom Headers: Add authentication header

    • Header: Authorization

    • Value: Bearer your-webhook-secret

    Or:

    • Header: X-Webhook-Secret

    • Value: your-secret-key

  • Add alert actions: Select trigger actions

  • Enabled: Check to activate

  • Name: Harness AI SRE Critical

  • Webhook URL: Your Harness webhook URL

  • Add alert filter: Filter which alerts trigger webhook

    • Priority: P1, P2

    • Tags: production, critical

    • Teams: Specific teams only

  • Add alert actions: Select actions

  • Enabled: Check to activate

Select alert actions

Choose which alert actions trigger the webhook:

  • Create: Alert is created

  • Acknowledge: Alert is acknowledged

  • Close: Alert is closed

  • Add Note: Note added to alert (optional)

  • Update Priority: Priority changed (optional)

  • Assign Ownership: Owner assigned (optional)

  • Add Team: Team added (optional)

  • Add Responder: Responder added (optional)

  • Escalate: Alert escalated (optional)

  • Delete: Alert deleted (optional)

Save integration

Click Save Integration to create the webhook.


Configure field mapping in Harness

In your Harness webhook configuration, map Opsgenie payload fields to alert properties.

Opsgenie webhook payload structure

Map basic fields

Use Mustache templates:

Advanced field mapping with CEL


Test the integration

Create test alert in Opsgenie

Create an alert to confirm delivery:

  1. Go to Alerts in Opsgenie

  2. Click Create Alert

  3. Fill in alert details:

    • Message: Test alert for Harness integration

    • Priority: P3

    • Tags: test, harness

  4. Click Create

Verify webhook triggered

Confirm Opsgenie delivered the webhook:

  1. Go to Settings, then select Integrations

  2. Click the Harness AI SRE integration

  3. Check the Activity or Logs tab for webhook delivery

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 Opsgenie fields

Field
Description
Example

action

Alert action

Create, Acknowledge, Close, AddNote

alert.alertId

Unique alert identifier

alert-123-abc

alert.tinyId

Short numeric ID

123

alert.message

Alert message

High CPU usage on prod-server-01

alert.status

Alert status

open, closed

alert.priority

Alert priority

P1, P2, P3, P4, P5

alert.tags

Alert tags array

["production", "cpu"]

alert.alias

Alert alias

cpu-high-prod-server-01

alert.entity

Related entity

prod-server-01

alert.owner

Alert owner

ops-team

alert.description

Alert description

Long text description

alert.details

Custom key-value pairs

{"host": "prod-01", "metric": "cpu"}

alert.createdAt

Creation timestamp (ms)

1625097600000

alert.updatedAt

Last update timestamp (ms)

1625097700000

alert.teams

Assigned teams

[{id, name}]

alert.responders

Alert responders

[{id, type, name}]

alert.report.ackTime

Time to acknowledge (ms)

30000

alert.report.closeTime

Time to close (ms)

300000

alert.report.acknowledgedBy

User who acknowledged

john.doe

alert.report.closedBy

User who closed

jane.smith


Advanced configuration

Route by priority

Create separate Harness webhooks for different priorities:

P1/P2 (Critical):

  • Opsgenie integration: Harness Critical

  • Alert filter: Priority is P1 or P2

  • Webhook URL: https://harness/webhooks/critical-webhook-id

P3/P4 (Medium):

  • Opsgenie integration: Harness Standard

  • Alert filter: Priority is P3 or P4

  • Webhook URL: https://harness/webhooks/standard-webhook-id

Route by team

Filter alerts by assigned team:

Opsgenie integration:

  • Alert filter: Team is Operations or Platform

  • Webhook URL: Your Harness webhook

Harness CEL:

Extract custom details

Access custom fields from alert.details:

Track alert lifecycle

Monitor alert lifecycle metrics:


Troubleshooting

Opsgenie webhook is not sending alerts to Harness AI SRE

Verify the integration is Enabled in Opsgenie, check the alert filters by removing them to test, review the integration Activity or Logs for errors, and ensure the webhook URL is accessible from Opsgenie.

Opsgenie alerts are not appearing in Harness AI SRE

Check the Harness webhook logs for errors, verify the payload structure in the Opsgenie integration logs, temporarily remove the CEL filter to test, and use the CEL has() function to safely access optional fields.

Opsgenie is creating duplicate alerts in Harness AI SRE

Review all Opsgenie webhook integrations, disable unnecessary alert actions in the integration settings, use Harness alert routing rules to deduplicate by alertId or tinyId, and filter by action in CEL.

Closed Opsgenie alerts are not resolving in Harness AI SRE

Enable the Close action in the Opsgenie integration, and map the Close action in the Harness CEL severity mapping.


Example: complete integration

Opsgenie webhook integration

Configure the integration with these settings:

  • Name: Harness AI SRE

  • Type: Outgoing Webhook

  • URL: https://app.harness.io/gateway/ai-sre/api/webhooks/wh_abc123

  • Alert Filter:

    • Priority: P1, P2

    • Tags: production

  • Alert Actions:

    • Create

    • Acknowledge

    • Close

  • Enabled: ✓

Map fields in the Harness webhook


Next steps


Opsgenie official documentation

Last updated

Was this helpful?