Generic alerts integration

GitLab can accept alerts from any source via a generic webhook receiver. When you set up the generic alerts integration, a unique endpoint will be created which can receive a payload in JSON format, and will in turn create an issue with the payload in the body of the issue. You can always customize the payload to your liking.

The entire payload will be posted in the issue discussion as a comment authored by the GitLab Alert Bot.

Setting up generic alerts

To set up the generic alerts integration:

  1. Navigate to Settings > Integrations in a project.
  2. Click on Alerts endpoint.
  3. Toggle the Active alert setting. The URL and Authorization Key for the webhook configuration can be found there.

Customizing the payload

You can customize the payload by sending the following parameters. All fields are optional:

PropertyTypeDescription
titleStringThe title of the incident. If none is provided, then New: Incident #N will be used, where #N is the number of incident
descriptionStringA high-level summary of the problem.
start_timeDateTimeThe time of the incident. If none is provided, a timestamp of the issue will be used.
serviceStringThe affected service.
monitoring_toolStringThe name of the associated monitoring tool.
hostsString or ArrayOne or more hosts, as to where this incident occurred.

Example request:

curl --request POST \
  --data '{"title": "Incident title"}' \
  --header "Authorization: Bearer <authorization_key>" \
  --header "Content-Type: application/json" \
  <url>

The <authorization_key> and <url> values can be found when setting up generic alerts.

Example payload:

{
  "title": "Incident title",
  "description": "Short description of the incident",
  "start_time": "2019-09-12T06:00:55Z",
  "service": "service affected",
  "monitoring_tool": "value",
  "hosts": "value",
}