This configuration will send an alert once a minute, and if alertmanager stops working, OnCall will detect it and notify you about that.

  1. Add the alert generating script to prometheus.yaml file. Within Prometheus it is trivial to create an expression that we can use as a heartbeat for OnCall, like vector(1). That expression will always return true.

    Here is an alert that leverages the previous expression to create a heartbeat alert:

    
                groups:
                - name: meta
                  rules:
                  - alert: heartbeat
                    expr: vector(1)
                    labels:
                      severity: none
                    annotations:
                      description: This is a heartbeat alert for Grafana OnCall
                      summary: Heartbeat for Grafana OnCall
            
  2. Add receiver configuration to prometheus.yaml with the unique url from OnCall global:

    
                ...
                route:
                ...
                    routes:
                    - match:
                        alertname: heartbeat
                      receiver: 'grafana-oncall-heartbeat'
                      group_wait: 0s
                      group_interval: 1m
                      repeat_interval: 50s
                receivers:
                - name: 'grafana-oncall-heartbeat'
                webhook_configs:
                - url: {{ heartbeat_url }}
                    send_resolved: false