From 41f7c23c65a986a900608a33d46b8e99437ad3eb Mon Sep 17 00:00:00 2001
From: Oleg Zaytsev This configuration will send an alert once in a minute and if alertmanager stops working amixr will detect that it
- doesn't work and notify you about that. This configuration will send an alert once a minute, and if alertmanager stops working, OnCall will detect
+ it and notify you about that. That expression will always return true. Here is an alert that leverages the previous expression to create a
- heartbeat alert Add the alert generating script to Here is an alert that leverages the previous expression to create a heartbeat alert: Add receiver configuration to ` tags and reworded some sentences.
Also removed the anchor tag from the webhook link: we don't want people
to follow that in their browser, we want them to copy it
## Result screenshot

## Which issue(s) this PR fixes
## Checklist
- [ ] Unit, integration, and e2e (if applicable) tests updated
- [ ] Documentation added (or `pr:no public docs` PR label added if not
required)
- [ ] `CHANGELOG.md` updated (or `pr:no changelog` PR label added if not
required)
---------
Signed-off-by: Oleg Zaytsev
-
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.
groups:
- name: meta
- rules:
- - alert: heartbeat
- expr: vector(1)
- labels:
- severity: none
- annotations:
- description: This is heartbeat alert
- summary: Alerting Amixr
+ rules:
+ - alert: heartbeat
+ expr: vector(1)
+ labels:
+ severity: none
+ annotations:
+ description: This is a heartbeat alert for Grafana OnCall
+ summary: Heartbeat for Grafana OnCall
prometheus.yaml with the unique url from OnCall global:
...
route:
@@ -27,12 +27,12 @@
routes:
- match:
alertname: heartbeat
- receiver: 'amixr-heartbeat'
+ receiver: 'grafana-oncall-heartbeat'
group_wait: 0s
group_interval: 1m
repeat_interval: 50s
receivers:
- - name: 'amixr-heartbeat'
+ - name: 'grafana-oncall-heartbeat'
webhook_configs:
- url: {{ heartbeat_url }}
send_resolved: false
diff --git a/grafana-plugin/src/containers/HeartbeatModal/HeartbeatForm.tsx b/grafana-plugin/src/containers/HeartbeatModal/HeartbeatForm.tsx
index cd48a4ad..9fa5b5e1 100644
--- a/grafana-plugin/src/containers/HeartbeatModal/HeartbeatForm.tsx
+++ b/grafana-plugin/src/containers/HeartbeatModal/HeartbeatForm.tsx
@@ -105,12 +105,10 @@ const HeartbeatForm = observer(({ alertReceveChannelId, onUpdate }: HeartBeatMod
-
+ {heartbeat?.link}
+
)}
{heartbeat && (