Diff

mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua @ 4627:adda872fa9e1

mod_pubsub_alertmanager: Include status booleans in template input For easier conditionals, e.g. {firing&oh no} or {resolved&okay then}
author Kim Alvefur <zash@zash.se>
date Sun, 18 Jul 2021 00:21:35 +0200
parent 4626:285efde5e8a5
child 5485:67190744b1eb
line wrap: on
line diff
--- a/mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua	Sun Jul 18 00:19:50 2021 +0200
+++ b/mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua	Sun Jul 18 00:21:35 2021 +0200
@@ -79,6 +79,8 @@
 
 	local data = {
 		status = payload.attr.status,
+		firing = "firing" == payload.attr.status,
+		resolved = "resolved" == payload.attr.status,
 		annotations = {},
 		labels = {},
 		endsAt = payload:find("ends/@at"),