Send Data from Edge Delta to a Webhook

Send data to a Webhook.

Overview

The Webhook node sends triggered alerts to a webhook based on an incoming signal. These signals can be generated by a threshold node on the edge. Alternatively, you can create a webhook integration, which can be triggered by a monitor in the backend, and which does not need to be deployed in a particular pipeline.

To create a webhook node:

  1. Click Add Destination.
  2. Expand Trigger and select Webhook Destination.
  1. Specify the webhook endpoint.

Example 1

This example uses a webhook node. It follows on from configure a threshold node. This example requires a Teams channel endpoint.

  1. Enter a suppression window of 20m. This prevents the notification channel from being flooded for 20 minutes after receiving the first alert.
  2. Expand Advanced Settings and enter the following Payload:
{"text": "More than 1% of NGINX traffic is a 5xx error in the past minute."}  
  1. Click Save Changes.
  2. Connect the Threshold node’s output to the Webhook node.
  1. Click Review Changes.
  2. Click Save Changes.

If the threshold is met a notification is sent to the application consuming the webhook:

Example 2

In this example, a rich payload is sent to a webhook node with dynamic content pulled from the alert fields. This example requires a Teams channel endpoint.

- name: richtemplate
  type: webhook_output
  endpoint: https://myco.webhook.office.com/webhookb2/88264c11-0bb8-44fc-/IncomingWebhook/1a2b3c4d5e6f/abcdef123456
  suppression_window: 1m0s
  payload: "      {\n       \"type\":\"message\",\n       \"attachments\":[\n          {\n
    \           \"contentType\":\"application/vnd.microsoft.card.adaptive\",\n            \"contentUrl\":null,\n
    \           \"content\":{\n              \"$schema\":\"http://adaptivecards.io/schemas/adaptive-card.json\",\n
    \             \"type\":\"AdaptiveCard\",\n              \"version\":\"1.2\",\n
    \             \"body\":[\n                {\n                  \"type\": \"TextBlock\",\n
    \                 \"text\": \"**{{ index .item.signal \"title\" }}**\"\n                },\n
    \               {\n                  \"type\": \"TextBlock\",\n                  \"text\":
    \"**Tag**: {{ index .item.resource \"ed.tag\" }}\\n\\r**Host**: {{ index .item.resource
    \"host.name\" }}\\n\\r**Description**: {{ js .item.signal.description }}\\n\\r**Signal
    ID**: {{ index .item.signal \"signal_id\" }}\\n\\r**Metric name**: {{ index .item.signal
    \"name\" }}\\n\\r**Value**: {{ index .item.signal \"value\" }}\"\n                }\n
    \             ]\n            }\n          }\n        ]\n      }    "

The payload is rendered in the receiving application, in this instance Microsoft Teams: