Web Hook
  • 08 Jun 2021
  • 3 Minutes To Read
  • Contributors
  • Dark mode
    Light
  • PDF

Web Hook

  • Dark mode
    Light
  • PDF

Article summary

What is Webhook channel?

The webhook notification is a simple way to send information about a violation over HTTP to a custom endpoint.

Business use case

Consider a need to create a ticket in the ticket management system if the number of dead letter messages breaches the set threshold level in a Service Bus Queue of a Composite Application.
Serverless360 provides Webhook Notification Channel for a better integration between Serverless360 and your ticket management system. When configured, a webhook is used to send out any monitor notification to your custom cloud application which in turn can invoke the Ticket Management API with necessary information collected from the Serverless360 alert.

How to configure Webhook?

Configuring a Webhook notification channel would involve choosing appropriate values for the parameters below:

  1. HTTP Request method to be used to call the WebHook: POST or PUT
  2. Message content type that you wish to send to the webhook: application/JSON or application/XML
  3. Webhook URL where the message will be sent to
  4. Authorization credentials if the endpoint is protected

Once configured, Serverless360 will PUT/POST the notifications as a JSON/XML to the webhook URL. Follow the below image to set up a webhook channel in Serverless360.

Webhook-notification-channel.gif

Notification Message Structure

The sample payload by data format is represented below, passed on to the Webhook endpoint configured as notification channel in Serverless360. The custom application should accept this payload to perform the follow up action. Data is available in JSON and XML format.

JSON

[
{
"ServiceName": "<NamespaceName>",
"ResourceName": "<ResourceName>",
"ResourceType": "Queues",
"Errors": 2,
"Warnings": 0,
"Issues": [
{
"Type": "Error",
"IsComposite": false,
"CompositeKey": null,
"CompositeKeyType": null,
"Information": "Status: Active not equal to expected state Disabled"
},
{
"Type": "Error",
"IsComposite": false,
"CompositeKey": null,
"CompositeKeyType": null,
"Information": "Active Message Count: 0 <= expected value 10000"
},
{
"Type": "Healthy",
"IsComposite": false,
"CompositeKey": null,
"CompositeKeyType": null,
"Information": "DeadLetter Message Count: 0 is Healthy"
}
],
"State": 0,
"AlarmName": "<Alarm Name>",
"AlarmDescription": "<AlarmDescription>"
}
]

XML

<?xml version="1.0" encoding="UTF-8"?>
<root>
   <element>
      <AlarmDescription>**AlarmDescription**</AlarmDescription>
      <AlarmName>**Alarm Name**</AlarmName>
      <Errors>2</Errors>
      <Issues>
         <element>
            <CompositeKey null="true" />
            <CompositeKeyType null="true" />
            <Information>Status: Active not equal to expected state Disabled</Information>
            <IsComposite>false</IsComposite>
            <Type>Error</Type>
         </element>
         <element>
            <CompositeKey null="true" />
            <CompositeKeyType null="true" />
            <Information>Active Message Count: 0 &lt;= expected value 10000</Information>
            <IsComposite>false</IsComposite>
            <Type>Error</Type>
         </element>
         <element>
            <CompositeKey null="true" />
            <CompositeKeyType null="true" />
            <Information>DeadLetter Message Count: 0 is Healthy</Information>
            <IsComposite>false</IsComposite>
            <Type>Healthy</Type>
         </element>
      </Issues>
      <ResourceName>**ResourceName**</ResourceName>
      <ResourceType>Queues</ResourceType>
      <ServiceName>**NamespaceName**</ServiceName>
      <State>0</State>
      <Warnings>0</Warnings>
   </element>
</root>

Integrate a Custom Cloud Application using Webhook channel

Serverless360 offers extensive capabilities to monitor Azure resources on their properties and metrics. The following articles can throw light on various monitoring options

  • Property based Monitoring
  • Data Monitoring
  • API Monitoring

Monitors would trigger alerts based on their configuration and notifications to the team can be made possible using the notification channels supported by Serverless360.
Real time business scenario would demand to perform a follow up custom action, whenever an alert is triggered. Serverelss360 facilitates this custom cloud action integration using a Webhook.

Steps to integrate

  1. Add an API (POST / PUT) endpoint from a Custom cloud application as a notification channel.
  2. Create and configure an alarm.
  3. Alarm configuration would involve,
    a. Defining alarm frequency
    b. Associating resource and configuring threshold values
    c. Configuring the notification channels through which alert should be sent. Turn on the Webhook notification channel.

With the above configurations the custom cloud application endpoint will be triggered whenever an alert gets generated.

For the sample payload passed on to the Webhook endpoint, refer the Notification Message Structure. The custom application should accept this payload to perform the follow up action.

Try this capability at SaaS version of Serverles360, this feature is also available in Private Hosting version of Serverless360.


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.