Mercurial > prosody-modules
comparison mod_pubsub_alertmanager/mod_pubsub_alertmanager.lua @ 4626:285efde5e8a5
mod_pubsub_alertmanager: Exclude "ends at" timestamp for unresolved alerts
Wow, does the problem end in year 1? Let me get my time machine!
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sun, 18 Jul 2021 00:19:50 +0200 |
parents | f7e26c43a9bc |
children | adda872fa9e1 |
comparison
equal
deleted
inserted
replaced
4625:f7e26c43a9bc | 4626:285efde5e8a5 |
---|---|
45 end | 45 end |
46 for k, v in pairs(alert.labels) do | 46 for k, v in pairs(alert.labels) do |
47 item:text_tag("label", v, { name=k }); | 47 item:text_tag("label", v, { name=k }); |
48 end | 48 end |
49 item:tag("starts", { at = alert.startsAt}):up(); | 49 item:tag("starts", { at = alert.startsAt}):up(); |
50 if alert.endsAt then | 50 if alert.endsAt and alert.status == "resolved" then |
51 item:tag("ends", { at = alert.endsAt }):up(); | 51 item:tag("ends", { at = alert.endsAt }):up(); |
52 end | 52 end |
53 if alert.generatorURL then | 53 if alert.generatorURL then |
54 item:tag("link", { href=alert.generatorURL }):up(); | 54 item:tag("link", { href=alert.generatorURL }):up(); |
55 end | 55 end |