In Flashduty
You can obtain an integration push URL through either of these two methods:
Using Private Integration
Choose this simpler option when you don’t need to route alert events to different channels.Using Shared Integration
Choose this option when you need to route alerts to different channels based on the alert event’s payload information.In EMQX
EMQX Cloud (hosted service) and self-hosted EMQX are integrated differently. Choose the steps that match your deployment.
EMQX Cloud (Hosted Service)
EMQX Cloud provides a built-in Flashduty alert integration type:- Log in to the EMQX Cloud console, enter your deployment, and go to Alerts → Alert Integrations
- Click + New under Webhook integration and select FlashDuty as the type
- Paste the Flashduty integration push URL into the URL field
- Click Confirm to save. You can then click Test to send a sample alert and verify that Flashduty receives it
deployment_id, level, message, and region.
Self-hosted EMQX
For self-hosted EMQX, forward system alarm events to the push URL through the rule engine.The rule engine supports the
$events/sys/alarm_activated and $events/sys/alarm_deactivated system alarm events starting from EMQX 5.8.5. Make sure your EMQX version is 5.8.5 or later.Step 1: Create a rule for alarm activationUse the same request body template as Step 1, but set
- Log in to the EMQX Dashboard, go to Integration → Rules, and click Create Rule
-
Enter the following statement in the SQL editor to match system alarm activation events:
-
Add an HTTP Server action:
- Set the connector URL to the Flashduty integration push URL (with the integration_key parameter)
- Select
POSTas the request method - Fill in the request body with the following template, which converts alarm fields into the Flashduty standard alert event format:
The${name},${message}, and${node}variables in the template are replaced with the field values output by the rule SQL. - Save the rule
event_status to Ok, so the corresponding alert in Flashduty is automatically recovered when the alarm is deactivated.Severity Mapping
EMQX Cloud (hosted service): EMQX Cloud automatically maps alert levels as follows:
Self-hosted EMQX: The alert severity is determined by the
event_status field in the rule’s request body template. In the examples above, alarm activation pushes Critical and alarm deactivation pushes Ok. You can change the activation severity to Warning or Info in the template. Valid values of event_status are Critical, Warning, Info, and Ok.