diff --git a/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/email/formatter/AbstractEmailFormatter.java b/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/email/formatter/AbstractEmailFormatter.java index c75a810..92e0543 100644 --- a/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/email/formatter/AbstractEmailFormatter.java +++ b/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/email/formatter/AbstractEmailFormatter.java @@ -58,6 +58,12 @@ private static class Parameters { private final Map params = new HashMap<>(); + private Parameters setWebuiLink(final String webuiLink) + { + params.put("webuiLink", webuiLink); + return this; + } + private Parameters setDetailsLink(final String detailsLink) { params.put("detailsLink", detailsLink); @@ -252,6 +258,9 @@ public EmailMessage format(final MessageKit messageKit) view.getAllViews().get(0).getTimestampMs(); final Parameters params = new Parameters() + .setWebuiLink( + Views.get().horizonUrl() + ) .setDetailsLink( Views.get().alertSplunkUrl(alertId, sampleAlertTimestampMs) ) diff --git a/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/view/Views.java b/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/view/Views.java index 976d667..aefc8c7 100644 --- a/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/view/Views.java +++ b/notification/src/main/java/net/opentsdb/horizon/alerting/corona/processor/emitter/view/Views.java @@ -200,6 +200,10 @@ private Views(Config config) /* ------------ Methods ------------ */ + public String horizonUrl() { + return horizonUrl; + } + public String alertEditUrl(final long alertId) { return horizonUrl + "/a/" + alertId + "/edit"; diff --git a/notification/src/main/resources/templates/email-event-alert.html b/notification/src/main/resources/templates/email-event-alert.html index b04952e..27c571e 100644 --- a/notification/src/main/resources/templates/email-event-alert.html +++ b/notification/src/main/resources/templates/email-event-alert.html @@ -118,7 +118,7 @@

{{ state | capitalize }}

diff --git a/notification/src/main/resources/templates/email-health-check-alert.html b/notification/src/main/resources/templates/email-health-check-alert.html index da86525..927c746 100644 --- a/notification/src/main/resources/templates/email-health-check-alert.html +++ b/notification/src/main/resources/templates/email-health-check-alert.html @@ -113,7 +113,7 @@

{{ state | capitalize }}

diff --git a/notification/src/main/resources/templates/email-period-over-period-alert.html b/notification/src/main/resources/templates/email-period-over-period-alert.html index beba6bf..e171b40 100644 --- a/notification/src/main/resources/templates/email-period-over-period-alert.html +++ b/notification/src/main/resources/templates/email-period-over-period-alert.html @@ -104,7 +104,7 @@

{{ state | capitalize }}

diff --git a/notification/src/main/resources/templates/email-single-metric-alert.html b/notification/src/main/resources/templates/email-single-metric-alert.html index aa0981e..2ca9e81 100644 --- a/notification/src/main/resources/templates/email-single-metric-alert.html +++ b/notification/src/main/resources/templates/email-single-metric-alert.html @@ -104,7 +104,7 @@

{{ state | capitalize }}