Overview

The Prometheus template opens an incident for every firing alert. These examples narrow it down: only one website, only one alert, or only critical alerts, each with its own priority.

You need
Prometheus sending to SQIBS ([setup](https://sqibs-docs.callgoose.com/integrations/prometheus/))
Where
Services > your service > Add Or Update API Integration
Result
Incidents only for what matters

The payload

Alertmanager sends this (shortened):

{
  "receiver": "callgoose-sqibs",
  "status": "firing",
  "alerts": [
    {
      "status": "firing",
      "labels": {
        "alertname": "WebsiteDown",
        "instance": "https://shop.example.com",
        "job": "blackbox",
        "severity": "critical"
      },
      "annotations": {
        "summary": "shop.example.com is down"
      }
    }
  ],
  "groupKey": "{}:{alertname=\"WebsiteDown\"}",
  "commonLabels": {
    "alertname": "WebsiteDown",
    "instance": "https://shop.example.com"
  }
}

Default: the Prometheus template

Part Payload JSON key Key value contains What it does
Trigger "status" firing Opens an incident.
Resolve "status" resolved Resolves it.
Match "groupKey" Ties the two together.

Example 1: only one website

Add a second key to the trigger so only alerts for that site match:

Part Payload JSON key Key value contains What it does
Trigger "status" firing Firing alerts...
Trigger "commonLabels"."instance" shop.example.com ...for this site only.
Resolve "status" resolved Resolves it.
Match "groupKey"

Example 2: only one alert, with its own priority

Create a separate filter for the alert and give it a higher priority. Put it before the general filter, because the first matching filter wins:

Part Payload JSON key Key value contains What it does
Trigger "commonLabels"."alertname" WebsiteDown Only this alert, high priority.
Resolve "status" resolved
Match "groupKey"

Example 3: critical alerts only

Part Payload JSON key Key value contains What it does
Trigger "alerts".[0]."labels"."severity" critical Only critical alerts.
Resolve "status" resolved
Match "groupKey"
Title from "alerts".[0]."annotations"."summary" A readable title.
Find the right key with the JSON key creator
In the API Integration window, click the round {} button at the bottom right. Paste a payload that SQIBS received (copy it from the API log). SQIBS lists every key with its value, each with a copy button. Copy the key into Payload JSON key and the value into Key value contains. No need to read the JSON by hand.