diff --git a/alert_rules_template.json b/alert_rules_template.json index f3909bc..dd5a676 100644 --- a/alert_rules_template.json +++ b/alert_rules_template.json @@ -844,6 +844,6 @@ ], "contact_point": { "receiver_name": "tg+mail+mattermost PTAF Grafana", - "message_template": "{{ range .Alerts }}{{ if eq .Status \"firing\" }}🔴 Firing{{ else }}✅ Resolved{{ end }}\n{{ if .Annotations.summary }}{{ .Annotations.summary }}{{ end }}\n\n{{ if index .Values \"Значение\" }}Текущее значение: {{ index .Values \"Значение\" | printf \"%.2f\" }}\n{{ end }}Labels:\n{{ range .Labels.SortedPairs }} • {{ .Name }} = {{ .Value }}\n{{ end }}{{ end }}" + "message_template": "{{ range .Alerts }}PTAF alerts: \n{{ if eq .Annotations.severity \"warning\" }}🟡{{ else }}🔴{{ end }} {{ if .Annotations.client_domain }}{{ .Annotations.client_domain }}{{ end }}{{ if .Annotations.code_field }} — {{ .Annotations.code_field }} ошибок{{ end }}{{ if eq .Status \"firing\" }}{{ if index .Values \"Значение\" }} {{ index .Values \"Значение\" | printf \"%.2f\" }}{{ if .Annotations.value_unit }} {{ .Annotations.value_unit }}{{ else }}%{{ end }}{{ end }}{{ if index .Values \"_Reduce\" }} {{ index .Values \"_Reduce\" | printf \"%.0f\" }}{{ if .Annotations.value_unit }} {{ .Annotations.value_unit }}{{ else }}%{{ end }}{{ end }} за {{ .Annotations.for_duration }}.{{ else }} трафика.{{ end }}\n{{ if eq .Status \"firing\" }}{{ if .Annotations.threshold }}Порог сработки {{ .Annotations.threshold }}\n{{ end }}{{ else }}{{ if index .Values \"Значение\" }}Текущее значение {{ index .Values \"Значение\" | printf \"%.2f\" }}{{ if .Annotations.value_unit }} {{ .Annotations.value_unit }}{{ else }}%{{ end }} {{ if .Annotations.field_info }}{{ .Annotations.field_info }}{{ end }}\n{{ end }}{{ if index .Values \"_Reduce\" }}Текущее значение {{ index .Values \"_Reduce\" | printf \"%.0f\" }}{{ if .Annotations.value_unit }} {{ .Annotations.value_unit }}{{ else }}%{{ end }} {{ if .Annotations.field_info }}{{ .Annotations.field_info }}{{ end }}\n{{ end }}{{ end }}Время: {{ .StartsAt.Format \"2006-01-02 15:04:05\" }}\n{{ if .Annotations.runbook }}---\n{{ .Annotations.runbook }}\n{{ end }}{{ end }}" } } \ No newline at end of file