add exported_instance

This commit is contained in:
Astro 2022-12-18 03:44:01 +01:00
parent 0ae1024cc7
commit bf80240238
2 changed files with 3 additions and 0 deletions

View File

@ -31,6 +31,7 @@ struct AlertLabels {
alertname: Option<String>,
host: Option<String>,
instance: Option<String>,
exported_instance: Option<String>,
}
#[derive(Debug, Clone, Deserialize)]

View File

@ -2,6 +2,8 @@
{% if labels.alertname.as_ref().is_some() %}*{{ labels.alertname.as_ref().unwrap() }}*{% endif -%}
{% if labels.host.as_ref().is_some() -%}
at {{ labels.host.as_ref().unwrap() -}}
{% else if labels.exported_instance.as_ref().is_some() -%}
at {{ labels.exported_instance.as_ref().unwrap() }}
{% else if labels.instance.as_ref().is_some() -%}
at {{ labels.instance.as_ref().unwrap() }}{% endif -%}
{% if annotations.message.as_ref().is_some() %}