Change alerts

This commit is contained in:
Magnus Root 2026-04-27 17:36:18 +03:00
parent c1ba2d0570
commit 592405b07e

View file

@ -844,6 +844,6 @@
], ],
"contact_point": { "contact_point": {
"receiver_name": "tg+mail+mattermost PTAF Grafana", "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 }}"
} }
} }