Run Workflow
Create a custom alert using a Workflow with APIs defined in APImetrics
If the built-in alerting options do not suit your needs, you can use the "Run Workflow" option to call any public API you'd like - by setting up API(s) in a Workflow just like for monitoring.
The high level steps are:
- Create a Workflow for your webhook
- Add API calls to that Workflow
- Go to Alerting > Alerts & Webhooks
- Add Action (bottom section)
- Select the Run Workflow type, and select your Workflow
There are additional runtime variables set in the workflow that identify the API and workflow that caused the issue. You can use these to build URLs or call the APImetrics API to capture more information.
ALERT_CALL_ID
: the ID of the APImetrics Call setupALERT_CALL_NAME
: the name of the APImetrics Call setupALERT_PROJECT_ID
: the ID of the APImetrics ProjectALERT_PROJECT_NAME
: the name of the APImetrics ProjectALERT_LOCATION_ID
: the ID of the agent that make the requestALERT_RESPONSE_SIZE
: the size in bytes of the responseALERT_RESPONSE_TIME
: the total time in milliseconds for the requestALERT_RESPONSE_HTTP_CODE
: the HTTP code of the result, e.g. 502ALERT_RESULT
: The specific error code (HTTP_SERVER_ERROR for a 500, etc)ALERT_RESULT_CLASS
: The class of error (FAIL, WARNING, SLOW or PASS)ALERT_RESULT_ID
: the ID of the API resultALERT_WORKFLOW_ID
: the ID of the workflow the API call was running in (if applicable)ALERT_WORKFLOW_RESULT_ID
: the ID of the workflow result that was running (if applicable)
Note you can use these in your API call as either __ALERT_CALL_ID__
or %%ALERT_CALL_ID%%
Updated almost 2 years ago