Edge Delta Webhook Destination

Send data to a webhook.

Overview

The Webhook destination node sends triggered alerts to a webhook based on an incoming signal.

Example 1

In this example, the webhook is configured to send Microsoft Teams a message indicating that a metric has breached a threshold.

nodes:
- name: webhook_output_test
  type: webhook_output
  endpoint: https://myco.webhook.office.com/webhookb2/88264c11-0bb8-44fc-/IncomingWebhook/1a2b3c4d5e6f/abcdef123456
  payload: |
    {"text": "High average delivery time detected! Over 40 minutes average within the last minute."}    

links:
- from: threshold_test
  to: webhook_output_test

Input:

See the threshold example to see how the alert was triggered.

Output:

A message is delivered to the Microsoft Teams channel containing the webhook connector.

Example 2

In this example, a richer payload is sent with dynamic content pulled from the alert fields.

- 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:

Required Parameters

name

A descriptive name for the node. This is the name that will appear in Visual Pipelines and you can reference this node in the YAML using the name. It must be unique across all nodes. It is a YAML list element so it begins with a - and a space followed by the string. It is a required parameter for all nodes.

nodes:
  - name: <node name>
    type: <node type>

type: webhook_output

The type parameter specifies the type of node being configured. It is specified as a string from a closed list of node types. It is a required parameter.

nodes:
  - name: <node name>
    type: <node type>

endpoint

The endpoint parameter defines the webhook URL. It is specified as a string and is required. You may need to define egress permissions for your chosen endpoint.

nodes:
  - name: <node name>
    type: webhook_output
    endpoint: "<end point address>"
    payload: | 
      <message template>

payload

The payload parameter defines the message template. It is specified in JSON and is required.

nodes:
  - name: <node name>
    type: webhook_output
    endpoint: "<end point address>"
    payload: | 
      <message JSON>

Optional Parameters

headers

The headers parameter defines a set of key-value pairs for the request headers. For example Content-Type: "application/json".It is specified as a yaml.MapSlice and is optional.

nodes:
  - name: <node name>
    type: webhook_output
    endpoint: "<end point address>"
    headers:
      <key>: "<value>"
    payload: | 
      <message JSON>