Setting a webhook alert

Webhook alerts enables you to integrate WebGazer into your existing stack. You can build all kind of interesting stuff like creating a ticket on the incident management tool of your choice or getting notifications on custom platforms you use.

Add a webhook alert

You can add a webhook alert under the Alerts section.

  1. Go to the Alerts section

  2. Click on Add Alert

  3. Choose the gazer/pulse you want to add an alert

  4. Choose Webhook under Via

  5. Set the URL you want the request to hit.

  6. Choose your alert schedule

    When an incident starts or ends if you want to get two notifications, one at the start and one at the end of an incident

    When an incident starts if you want to get a notification only at the start of an incident

    When an incident ends if you want to get a notification only at the end of an incident

Choose alert schedule
Choose alert schedule

  1. Choose when you want to get an alert

    Immediately, if you want to get an alert when an incident is registered

    If it lasts, if you want to get an alert if the incident continues for more than a certain time duration

Choose when to notify
Choose when to notify

  1. Click Add Alert

Now, an HTTP POST request is fired consistent with your alert preferences when an incident occurs.

Another alert can also be added for a gazer/pulse even if there exists a webhook alert assigned to that gazer/pulse.

💡 Learn more about alerts on e-mail alerts, Slack alerts, SMS/phone call alerts.

Example request

An HTTP POST request with JSON payload will hit the URL set, when an incident starts (or X minutes later, if you set so) and end.

incident.started_at and incident.ended_at are combined date and times in ISO 8601 format.

The request will have these headers set:

Content-Type: application/json
User-Agent: WebGazer/1.0 (+https://www.webgazer.io)

Here is an example request body for a started incident notification:

{
  "source": "gazers",
  "kind": "start",
  "gazer": {
      "id": 42,
      "name": "Aperture Science",
      "url": "http://www.aperturescience.tld"
  },
  "incident": {
      "started_at": "2018-10-21T06:44:29.614354+00:00",
      "ended_at": null,
      "cause": "502 Bad Gateway"
  },
  "description": "Heads up: Aperture Science is down!",
  "long_description": "Gazer Aperture Science is not responding properly."
}

And this example is for an ended incident notification:

{
  "source": "gazers",
  "kind": "end",
  "gazer": {
    "id": 42,
    "name": "Aperture Science",
    "url": "http://www.aperturescience.tld"
  },
  "incident": {
    "started_at": "2018-10-21T06:44:29.614354+00:00",
    "ended_at": "2018-10-21T06:45:28.781799+00:00",
    "cause": "502 Bad Gateway"
  },
  "description": "Phew: Aperture Science has recovered.",
  "long_description": "Gazer Aperture Science has recovered after being down for 2 minutes."
}

Parameters

source

The source of the incident.

Possible values: gazers, pulses

kind

The state of the incident.

Possible values: start, end

gazer

Exists only if it is a gazer incident notification. Includes the id, name and url of the gazer.

pulse

Exists only if it is a pulse incident notification. Includes the id and name of the pulse.

incident

Summary of the incident. Includes started_at, ended_at and cause.

description

A short, human-readable message for the notification.

long_description

A longer version of description. If the notification is for an ended incident, long_description includes the incident's duration.