Solr-as-a-Service Webhooks - SearchStax
SearchStax® can POST Heartbeat and Threshold Alerts to the webhook endpoints of external Alerting and Incident Management systems.
The webhook messages are invoked by Heartbeat and Threshold Alerts, and can carry a payload of data about the alert and the system that triggered it.
Contents of this page:
What is a Webhook?
Webhooks are user-defined HTTP callbacks. They are usually triggered by some event, such as an alert changing status in SearchStax. When the event occurs, the source site (SearchStax) makes an HTTP request to the URL configured for the webhook. Events on one site can invoke behavior on another.
A common use is to notify bug-tracking systems and alerting systems, although the SearchStax webhook mechanism can reach out to any web application that has a webhook endpoint.
Defining a Webhook
A webhook must be defined in the SearchStax Dashboard before it can be referenced in an alert. Look for the Webhooks entry in the navigation pane on the left margin of the page.
Click the Create Webhook button to open the webhook editor.
|Name||The name of the webhook. It will appear in a droplist of webhooks in the alerts editor.|
|URL||The URL of the webhook endpoint of the target application.|
|Ignore SSL Validation||Sometimes the target of your webhook post is using SSL with a self-signed certificate. This setting overrides the certificate check.|
|Paused||Deactivate this webhook without having to delete it.|
|Payload||The payload of the webhook is a JSON document consisting of field keys and values. The fields are the labels expected by the target application. The values are predefined SearchStax variables.|
|Update||The Update button saves the webhook and closes the editor.|
Adding Webhooks to an Alert
The alert editor offers droplists that let you associate your webhooks with specific alerts.
Note that you can send one webhook when the alert is triggered, and then send a different webhook when the alert is closed.
SearchStax email alerts report various internal values to the user. These values are available as predefined variables to put into the payload of the webhook.
|$ALERT_CURRENT_VALUE||The current value of the metric.||"0.01"|
|$ALERT_ID||The internal ID number of the alert.||"6012"|
|$ALERT_METRIC||The name of the alert metric.||"os.SystemCpuLoad"|
|$ALERT_STATUS||Open or closed.||"OPEN"|
|$ALERT_THRESHOLD_OPERATOR||The relation between the current value and the threshold.||">"|
|$ALERT_TITLE||The name of the alert.||"Server 5 below 10% CPU"|
|$ALERT_TYPE||Heartbeat or Threshold.||"Threshold"|
|$DATE||The time in UTC.||"2019-12-20T18:18:39+00:00"|
|$DEPLOYMENT_NAME||The name of the deployment.||"Films"|
|$DEPLOYMENT_UID||The ID number of the SearchStax deployment.||"ss380502"|
|$HOSTNAME||The name of the server that issued the alert.||"ss380502-5"|
Don't hesitate to reach out to the SearchStax Support Desk. We are happy to answer your questions.