Skip to main content
Kapacitor’s post event handler sends every alert event as JSON by HTTP POST to a URL. The body is Kapacitor’s alert data (id, message, details, time, duration, level, data, previousLevel, recoverable), and the Flashduty InfluxData integration parses this format, so no separate Kapacitor integration is needed: create an InfluxData integration in Flashduty and paste its push URL into Kapacitor.

In Flashduty On-call

Get an integration push URL in either of the two ways below. Choose the InfluxData integration type in both.

Use a dedicated integration

  1. In the Flashduty console, go to Channels and open a channel
  2. Go to Settings → Integrations → Dedicated integrations and click Add integration
  3. Select InfluxData and click Save
  4. Open the generated integration card and copy the Push URL, in the form https://api.flashcat.cloud/event/push/alert/influxdata?integration_key=<integration key>

Use a shared integration

  1. In the Flashduty console, go to Integration Center → Alert Events
  2. Select InfluxData and enter an integration name
  3. Configure the default route and select a channel. You can add more rules under Routing after creation
  4. Click Save and copy the generated Push URL

Configure in Kapacitor

Use any one of the three ways below. Always enter the full push URL, including ?integration_key=....
1

Add a post event handler in Kapacitor

Where: TICKscript file › alert() node › .post()
After editing the script, redefine the task with kapacitor define.
2

Fire a real alert from Kapacitor and confirm

Where: a terminal on the Kapacitor hostMake the task’s alert condition actually match once (for example, temporarily raise the .crit() threshold), then let it return to normal:
  1. Confirm Flashduty receives an alert and the integration shows a Latest event time
  2. Once the condition returns to OK, confirm the original alert recovers (Kapacitor sends an event with level OK, and Flashduty closes the alert with the same id)
  3. If no alert arrives, add .captureResponse() to .post() to see Flashduty’s response
Adding a post handler in the Chronograf 1.x Alert Rule Builder uses this same Kapacitor handler; see the InfluxData integration for those steps.

Field mapping

For any other level, Flashduty rejects the event with level ... is not supported.

Recovery and deduplication

  • When the level returns to OK, Kapacitor sends an event with level OK, and Flashduty closes the alert with the same id. Do not use .noRecoveries() on alert(), or Kapacitor sends no recovery events.
  • The default id is {{ .Name }}:{{ .Group }} (measurement name and group). If you set a custom .id(), make sure the trigger and the recovery of one object use the same value.
  • To see Flashduty’s error in the Kapacitor log, add .captureResponse() to .post() (capture-response: true for a topic handler); the response is logged when the status is not 2xx.

Troubleshooting

  • Flashduty returns Invalid parameters: the push URL is incomplete, integration_key is missing, or the integration type is not InfluxData
  • level ... is not supported: the level in the body is not CRITICAL, WARNING, INFO or OK; make sure the original Kapacitor alert data is sent, not a forwarded or rewritten body
  • An alert does not recover: confirm the recovery event has the same id as the trigger and that the task emits an OK event
  • No alerts arrive: confirm the Kapacitor host can reach api.flashcat.cloud