Opsgenie Integration

Configure alerts to go to Opsgenie for incident management services.

Opsgenie is an incident management platform available from Atlassian.

What Does ChaosSearch Offer Opsgenie Users?

ChaosSearch has a one-directional integration with Opsgenie. It is easy to configure alerts to go right into your Opsgenie account to start notifying the right engineers about possible incidents in their environment.

Add a Custom Webhook Integration in ChaosSearch, and start taking advantage of Opsgenie's alert and incident management platform with the ChaosSearch alert notification system.

Functionality of the Integration

When an alert is triggered in ChaosSearch, an alert is created in Opsgenie automatically through the integration.

Configuring the Integration

The Opsgenie integration has three main steps:

  1. Configure the Opsgenie integration support for ChaosSearch.
  2. Add Opsgenie as a destination in ChaosSearch for alerts.
  3. Create a monitor and trigger to define the alerts that are sent to Opsgenie.

Configure the Opsgenie Integration for ChaosSearch

Make sure that you complete the following prerequisites:

  1. Verify (or create) your Opsgenie account.
  2. If you are using the Free or Essentials Opsgenie Plan, create a team using Create teams in Opsgenie.
  3. Create a default API integration in your Opsgenie Teams settings using Create an API integration in Opsgenie
  4. When you have generated an API Key for the integration, copy the API Key for use in your API requests.

Add Opsgenie as a Destination in ChaosSearch

To add a destination for the Opsgenie integration:

  1. Log in to the ChaosSearch console as a user with Analytics access.
  2. On the Analytics tab, click Alerting in the left menu area. The Alerts page opens.
  3. Click Destinations.
  1. Click Add destination.
  1. In the Add destination window, type a name for your integration such as Opsgenie.
  2. In the Type field, select Custom Webhook. Some additional fields are added to the page.
  3. Select the Define endpoint by custom attributes URL option, and specify the following:
  • In the Type field, select HTTPS.
  • In the Host field, type api.opsgenie.com (or api.eu.opsgenie.com if you are in the EU region).
  • In the Port field, type 443 for the HTTPS protocol.
  • In the Path section, type /v2/alerts.
  • Click Remove parameter to remove the empty Key/Value pair field.
  • In the Method field, select POST.
  • In the Header information field, click Add header to add a new empty pair of Key/Value fields.
  • In the Key field, type authorization and in the Value field, type GenieKey $API_KEY (where $API_KEY is the API Key from your Opsgenie API Integration).
  • Click Create.

Create Monitor

To create a monitor in ChaosSearch, use these instructions.

After you create the monitor, you must define the trigger as described in the same instructions.

📘

Configure Actions Section

In the final step of creating a trigger, the Message payload should be configured as follows:

{ "message": "{{{ctx.trigger.name}}} just entered alert status. Please investigate the issue.", "description" : "Monitor {{{ctx.monitor.name}}} \n - Trigger: {{{ctx.trigger.name}}} \n - Severity: {{ctx.trigger.severity}} \n - Period start: {{ctx.periodStart}} \n  - Period end: {{ctx.periodEnd}}", "priority": "P{{ctx.trigger.severity}}"}

Verify the Creation of Opsgenie Alert from Opsgenie UI

In your Opsgenie UI, navigate to Alerts and verify that you can see the new Opsgenie alert that came from the ChaosSearch UI’s monitoring alert’s trigger message:

Click on the newly created Opsgenie alert and verify the detailed contents of the alert.


Did this page help you?