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
- In the Flashduty console, go to Channels and open a channel
- Go to Settings → Integrations → Dedicated integrations and click Add integration
- Select InfluxData and click Save
- 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
- In the Flashduty console, go to Integration Center → Alert Events
- Select InfluxData and enter an integration name
- Configure the default route and select a channel. You can add more rules under Routing after creation
- 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
- URL in the TICKscript
- Endpoint in kapacitor.conf
- Topic handler
Where: TICKscript file › After editing the script, redefine the task with
alert() node › .post()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:- Confirm Flashduty receives an alert and the integration shows a Latest event time
- Once the condition returns to
OK, confirm the original alert recovers (Kapacitor sends an event withlevelOK, and Flashduty closes the alert with the sameid) - If no alert arrives, add
.captureResponse()to.post()to see Flashduty’s response
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 withlevelOK, and Flashduty closes the alert with the sameid. Do not use.noRecoveries()onalert(), or Kapacitor sends no recovery events. - The default
idis{{ .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: truefor a topic handler); the response is logged when the status is not 2xx.
Troubleshooting
- Flashduty returns
Invalid parameters: the push URL is incomplete,integration_keyis missing, or the integration type is not InfluxData level ... is not supported: thelevelin the body is notCRITICAL,WARNING,INFOorOK; 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
idas the trigger and that the task emits anOKevent - No alerts arrive: confirm the Kapacitor host can reach
api.flashcat.cloud