Skip to main content
Flashduty implements alert creation and closing from the Opsgenie Alert API, with the same request and response formats as Opsgenie. Tools that already send alerts to Opsgenie (such as Prometheus Alertmanager and Grafana Alerting) push alerts to Flashduty On-call once you replace the Opsgenie API URL with the Flashduty push URL.

In Flashduty On-call


You can get the push URL in either of two ways.

Dedicated integration

  1. In the Flashduty console, select Channels and open a channel
  2. Select Settings → Integrations → Dedicated Integrations, then click Add an Integration
  3. Select Opsgenie Compatible and click Save
  4. Open the generated integration card and copy the Push URL

Shared integration

  1. In the Flashduty console, select Integration Center → Alert Events
  2. Select Opsgenie Compatible and enter an integration name
  3. Configure the default route and pick a channel; you can add more rules under Routes after creating it
  4. Click Save and copy the generated Push URL

Push URL


The push URL has this format, with integration_key as part of the path:
Opsgenie clients append paths such as v2/alerts and v2/alerts/<alias>/close to the API URL, which can drop an integration_key query parameter or put it in the wrong place, so Flashduty reads integration_key from the path. The Authorization: GenieKey <key> header is not used for authentication; if the client requires it, enter any non-empty value. Supported endpoints: A successful request returns HTTP 202 and {"result": "Request will be processed", "took": 0, "requestId": "..."}, the same as Opsgenie.

Configure in Prometheus Alertmanager


Add opsgenie_configs to a receiver in alertmanager.yml and set api_url to the push URL:
api_url must end with /. Alertmanager appends v2/alerts directly to the URL, so without the trailing / the path is wrong and the request returns 404.
  • Only with send_resolved: true does Alertmanager send a Close request when the alert resolves
  • Alertmanager puts the common labels of the group in details by default, and Flashduty keeps them as alert labels
  • Without priority, Opsgenie’s default P3 applies, which is Warning
  • The Update Message and Update Description requests sent with update_alerts: true are accepted and ignored; the title and description update with the next Create request

Configure in Grafana


1

Create an OpsGenie contact point

  1. Go to Alerting → Contact points and click + Add contact point
  2. Set Integration to OpsGenie
  3. Enter any non-empty value in API Key
  4. Set Alert API URL to the push URL followed by v2/alerts:
  5. Select Auto close incidents; otherwise Grafana sends no Close request when the alert resolves
  6. Keep Send notification tags as at the default Tags, or choose Tags & Extra Properties
2

Route alerts to it

In Notification policies, route the alerts you want to push to this contact point.
3

Verify the lifecycle

Let an alert rule go to Firing and confirm Flashduty receives the alert; then let the rule return to Normal and confirm the same alert recovers.
Grafana sends alert labels in tags as key:value, and Flashduty turns them back into labels of the same name. Grafana sends no priority by default, so P3 (Warning) applies. To set the severity per rule, turn on Override priority in the contact point and add the label og_priority with a value from P1 to P5 to the alert rule. The contact point’s Test button uses a new alias on every press, so each press opens a separate Warning alert in Flashduty that never recovers on its own. Close it by hand.

Other tools


Any tool that lets you change the Opsgenie API URL and closes alerts by alias works with this integration: replace the API URL with the push URL (with or without v2/alerts, depending on how the tool appends paths), and send Close requests with identifierType=alias. Not supported:
  • Closing by id or tiny id: Flashduty does not issue Opsgenie alert IDs, so identifierType set to id, tiny or left empty returns 422
  • Read endpoints: GET requests (such as v2/alerts/requests/<requestId>) are not supported. Zabbix’s built-in Opsgenie media type polls that endpoint; use the Zabbix integration instead
  • Aliases that contain /: the alias is part of the URL path, so such requests match no endpoint

Alert Key


The request’s alias is the Alert Key. Opsgenie defines alias as the “client-defined identifier of the alert, that is also the key element of Alert De-Duplication” (Alert API). Create requests with the same alias merge into one alert, and a Close request recovers that alert by alias. Alertmanager and Grafana both use a hash of the alert group as the alias, which stays the same from trigger to recovery. Without alias, every Create request opens a new alert that no Close request can recover.

Field mapping


responders, visibleTo, actions, user and note are ignored; assignment and notifications follow the Flashduty channel’s settings.

Severity


Any other value returns 422. Recovery comes from the Close request, not from priority.

Troubleshooting


  • 404: the Alertmanager api_url is missing the trailing /, or the Grafana Alert API URL is missing /v2/alerts
  • 401: the integration_key in the push URL is wrong, or the integration is disabled
  • 422: message is empty, priority is not between P1 and P5, or the Close request does not use identifierType=alias; it is also returned when the integration_key in the push URL belongs to an integration of another type
  • The alert does not recover: make sure Alertmanager has send_resolved: true and Grafana has Auto close incidents selected