OpsGenie Configuration via HTTPS
This guide demonstrates how to configure connecor and message configuration for integrating OpsGenie with Coralogix using the generic HTTPS destination type.
OpsGenie requires different endpoints for creating and closing alerts. The instructions below walk you through setting up connector and message payloads to support both alert creation and resolution.
Connector configuration
The Generic HTTPS Connector allows you to integrate with any HTTPS endpoint. You can configure the request method, headers, and body to establish communication between Coralogix’s Notification Center and a third-party system like OpsGenie.
- Create a new connector and give it a clear name. Optionally, add a description.
- Fill in the common fields as shown below.
Connector configuration:
URL:
https://api.opsgenie.com/v2/alerts
Method:
POST
Additional headers:
{
"Authorization": "GenieKey eb243592-faa2-4ba2-a551q-1afdf565c889",
"Content-Type": "application/json"
}
- Leave Additional body fields empty.
Alert-specific overrides
Since the behavior for creating and resolving alerts differs, use Entity Overrides to adjust the connector configuration dynamically.
- Leave Additional Headers unchanged (they will inherit from the connector).
- Override the URL and Additional Body Fields as follows:
URL override:
{% if alert.status == 'Triggered' %}
https://api.opsgenie.com/v2/alerts
{% else %}
https://api.opsgenie.com/v2/alerts/{{alert.groupingKey}}/close?identifierType=alias
{% endif %}
Body override:
Note
The alias
field is required. It allows actions like acknowledgment, snoozing, or closing to work correctly by referencing the alert via alias.
Message configuration
Create an alert preset (OpsGenie)
This preset defines the payload structure for creating alerts, based on the OpsGenie Create Alert API.
Example:
{
"message": "[ {{alertDef.priority}} ]{{alertDef.name}} - Triggered",
"description": "{{alertDef.description}}",
"responders": [
{"name": "{{alert.entityLabels['team_name']}}", "type": "team"}
],
"visibleTo": [
{"username": "trinity@opsgenie.com", "type": "user"}
],
"details": {
"timestamp": "{{alert.timestamp | date(format = \"%Y-%M-%D %d:%m:%s\")}}"
},
"entity": "An example entity",
"priority": "{{alert.highestPriority | default(value = alertDef.priority)}}",
"source": "Coralogix"
}
Resolved alert preset (OpsGenie)
For resolved alerts, no special body is required. The URL override already contains the necessary alias to close the alert, so you can leave the body empty.
Complete conditional preset
This complete preset handles both alert creation and resolution based on the alert status.
{% if alert.status == 'Triggered' %}
{
"message": "[ {{alertDef.priority}} ]{{alertDef.name}} - Triggered",
"description": "{{alertDef.description}}",
"responders": [
{"name": "{{alert.entityLabels['team_name']}}", "type": "team"}
],
"visibleTo": [
{"username": "trinity@opsgenie.com", "type": "user"}
],
"details": {
"timestamp": "{{alert.timestamp}}"
},
"entity": "An example entity",
"priority": "{{alert.highestPriority | default(value = alertDef.priority)}}",
"source": "Coralogix"
}
{% else %}
{}
{% endif %}