Alertmanager
Checks Prometheus AlertManager for any firing alerts.
The following example transforms the list of alerts so that each alert becomes a single check result. Without the transform the health check will fail if any alerts are firing.
alert-manager-check.yaml
apiVersion: canaries.flanksource.com/v1
kind: Canary
metadata:
  name: alertmanager-check
spec:
  schedule: "*/5 * * * *"
  alertmanager:
    - host: alertmanager.example.com
      alerts:
        - .*
      ignore:
        - KubeScheduler.*
        - Watchdog
      transform:
        javascript: |
          var out = _.map(results, function(r) {
            return {
              name: r.name,
              labels: r.labels,
              icon: 'alert',
              message: r.message,
              description: r.message,
            }
          })
          JSON.stringify(out);
| Field | Description | Scheme | Required | 
|---|---|---|---|
alerts | 
A list of alert prefix names to include | []string | 
|
ignore | 
A list of alert prefix names to exclude | []string | 
|
filters | 
A map of label to value prefixes to find alerts on | map[string]string | 
|
* | 
All other commons field | Common | |
| Connection | |||
connection | 
Path of existing connection e.g. connection://alertmanager/instance/ Mutually exclusive with username, password, host | 
Connection | |
host | 
Host endpoint mutually exclusive with connection | 
string | 
|
username | 
Mutually exclusive with connection | 
EnvVar | |
password | 
Mutually exclusive with connection | 
EnvVar |