diff --git a/chaos_genius/alerts/email_templates/common.html b/chaos_genius/alerts/email_templates/common.html index bb8bbf7b..1eb0e403 100644 --- a/chaos_genius/alerts/email_templates/common.html +++ b/chaos_genius/alerts/email_templates/common.html @@ -54,169 +54,38 @@ {% macro anomaly_point_formatting(point, kpi_link_prefix=none) -%} {% set include_kpi_name = kpi_link_prefix is not none %} - {% if point.previous_value is none or point.y == point.previous_value -%} - - ∿ Anomalous behavior - + {% if point.percent_change is string %} + Anomaly detected + {% elif point.percent_change >= 0 %} + ↑ {{ point.percent_change_formatted }} higher than expected + {% else %} + ↓ {{ point.percent_change_formatted }} lower than expected + {% endif %} - {% if include_kpi_name -%} - + - - in + {% if include_kpi_name -%} + {{ kpi_name_link(kpi_link_prefix, point) }} + {% endif %} - + {% if point.is_subdim %} + {{ subdim_name_link(point) }} + {% endif %} - {{ kpi_name_link(kpi_link_prefix, point) }} + + changed to + - {% if point.is_subdim %} - {{ subdim_name_link(point) }} - {% endif %} - {% else -%} - - - detected - - - - {% if point.is_subdim -%} - - - in - - - - {{ subdim_name_link(point) }} - {%- endif %} - {%- endif %} - - - - - {% if point.previous_value is none -%} - - - changed to - - - {{point.y_readable}} - - {% if point.is_hourly -%} - - at - - {{ point.anomaly_time_only }} - {%- endif %} - {% else -%} - {% if point.is_hourly %} - - with constant value - - - {{point.y_readable}} - - - from - - {{ point.previous_point_time_only }} - - - to - - {{ point.anomaly_time_only }} - {% else %} - - with same value - - - {{point.y_readable}} - - - as previous day - - {% endif %} - {%- endif %} - - {% else -%} - {% if point.y > point.previous_value %} - - ↑ {{ point.percent_change_formatted }} - Spike - - {% elif point.y < point.previous_value %} - - ↓ {{ point.percent_change_formatted }} - Drop - - {% endif %} - - {% if include_kpi_name %} - - - in - - - - {{ kpi_name_link(kpi_link_prefix, point) }} - - {% if point.is_subdim %} - {{ subdim_name_link(point) }} - {% endif %} - {% else %} - - - detected - - - - {% if point.is_subdim %} - - - in - - - - {{ subdim_name_link(point) }} - {% endif %} - {% endif %} + {{point.y_readable}} + {% if point.is_hourly -%} - - - - - changed - + at + {{ point.anomaly_time_only }} + {%- endif %} - - to - - - {{point.y_readable}} - - {% if point.previous_value_readable is not none -%} - - - from - - {{point.previous_value_readable}} - - {%- endif %} - - {% if point.is_hourly -%} - - from - - {{ point.previous_point_time_only }} - - - to - - {{ point.anomaly_time_only }} - {%- endif %} - {%- endif %}{% if point.relevant_subdims -%} + {% if point.relevant_subdims -%}