diff --git a/alert_rules_template.json b/alert_rules_template.json index dd5a676..e369c7d 100644 --- a/alert_rules_template.json +++ b/alert_rules_template.json @@ -12,7 +12,7 @@ "rps_alert": { "relative_time_range_from": 1800, "keep_firing_for": "", - "annotation_summary": "Превышен порог в {rps_limit} RPS в {client_title}", + "annotation_summary": "🔴 {client_title} инфраструктурный RPS > {rps_limit} RPS.", "queries": { "data_query": { "refId": "A", @@ -141,7 +141,7 @@ } ], "annotations": { - "summary": "🖥 {{ $labels.instance }}: диск / заполнен на {{ $values.\"Занято в /\".Value | printf \"%.1f\" }}% (порог 75%)" + "summary": "🟡 {{ $labels.instance }}: диск / заполнен на {{ $values.\"Занято в /\".Value | printf \"%.1f\" }}% (порог 75%)" } }, { @@ -219,161 +219,7 @@ } ], "annotations": { - "summary": "🖥 {{ $labels.instance }}: диск /var/log заполнен на {{ $values.\"Занято в /var/log\".Value | printf \"%.1f\" }}% (порог 75%)" - } - }, - { - "uid": "ef4spdg2qcge8c", - "title": "[SYS] CPU Busy 75%", - "condition": "C", - "for": "3m", - "no_data_state": "NoData", - "exec_err_state": "Error", - "data": [ - { - "refId": "Занято CPU", - "relativeTimeRange": { - "from": 600, - "to": 0 - }, - "datasourceUid": "deibaq3pwytxce", - "model": { - "datasource": { - "type": "prometheus", - "uid": "deibaq3pwytxce" - }, - "editorMode": "code", - "expr": "100 - (\n avg by(instance) (\n rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"PTAF-TB-.*\"}[5m])\n ) * 100\n)", - "instant": true, - "intervalMs": 1000, - "legendFormat": "__auto", - "maxDataPoints": 43200, - "range": false, - "refId": "Занято CPU" - } - }, - { - "refId": "C", - "relativeTimeRange": { - "from": 0, - "to": 0 - }, - "datasourceUid": "__expr__", - "model": { - "conditions": [ - { - "evaluator": { - "params": [ - 75 - ], - "type": "gt" - }, - "operator": { - "type": "and" - }, - "query": { - "params": [ - "C" - ] - }, - "reducer": { - "params": [], - "type": "last" - }, - "type": "query" - } - ], - "datasource": { - "type": "__expr__", - "uid": "__expr__" - }, - "expression": "Занято CPU", - "intervalMs": 1000, - "maxDataPoints": 43200, - "refId": "C", - "type": "threshold" - } - } - ], - "annotations": { - "summary": "🔥 {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 75%)" - } - }, - { - "uid": "ef4spmgmowe80e", - "title": "[SYS] RAM Busy 75%", - "condition": "Превышение потребления RAM", - "for": "3m", - "no_data_state": "NoData", - "exec_err_state": "Error", - "data": [ - { - "refId": "Занято RAM", - "relativeTimeRange": { - "from": 600, - "to": 0 - }, - "datasourceUid": "deibaq3pwytxce", - "model": { - "datasource": { - "type": "prometheus", - "uid": "deibaq3pwytxce" - }, - "editorMode": "code", - "expr": "100 - (\n (node_memory_MemAvailable_bytes{instance=~\"PTAF-TB-.*\"} / \n node_memory_MemTotal_bytes{instance=~\"PTAF-TB-.*\"}) * 100\n)", - "instant": true, - "intervalMs": 1000, - "legendFormat": "__auto", - "maxDataPoints": 43200, - "range": false, - "refId": "Занято RAM" - } - }, - { - "refId": "Превышение потребления RAM", - "relativeTimeRange": { - "from": 0, - "to": 0 - }, - "datasourceUid": "__expr__", - "model": { - "conditions": [ - { - "evaluator": { - "params": [ - 75 - ], - "type": "gt" - }, - "operator": { - "type": "and" - }, - "query": { - "params": [ - "C" - ] - }, - "reducer": { - "params": [], - "type": "last" - }, - "type": "query" - } - ], - "datasource": { - "type": "__expr__", - "uid": "__expr__" - }, - "expression": "Занято RAM", - "intervalMs": 1000, - "maxDataPoints": 43200, - "refId": "Превышение потребления RAM", - "type": "threshold" - } - } - ], - "annotations": { - "summary": "💾 {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 75%)" + "summary": "🟡 {{ $labels.instance }}: диск /var/log заполнен на {{ $values.\"Занято в /var/log\".Value | printf \"%.1f\" }}% (порог 75%)" } }, { @@ -451,7 +297,7 @@ } ], "annotations": { - "summary": "🚨 {{ $labels.instance }}: диск / заполнен на {{ $values.\"Занято в /\".Value | printf \"%.1f\" }}% (порог 90%)" + "summary": "🔴 {{ $labels.instance }}: диск / заполнен на {{ $values.\"Занято в /\".Value | printf \"%.1f\" }}% (порог 90%)" } }, { @@ -529,7 +375,469 @@ } ], "annotations": { - "summary": "🚨 {{ $labels.instance }}: диск /var/log заполнен на {{ $values.\"Занято в /var/log\".Value | printf \"%.1f\" }}% (порог 90%)" + "summary": "🔴 {{ $labels.instance }}: диск /var/log заполнен на {{ $values.\"Занято в /var/log\".Value | printf \"%.1f\" }}% (порог 90%)" + } + }, + { + "uid": "ef4spdg2qcge35", + "title": "[SYS] CPU Busy 35%", + "condition": "C", + "for": "5m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято CPU", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n avg by(instance) (\n rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"PTAF-TB-.*\"}[5m])\n ) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято CPU" + } + }, + { + "refId": "C", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 35 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято CPU", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "C", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "⚪ {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 35%)" + } + }, + { + "uid": "ef4spdg2qcge45", + "title": "[SYS] CPU Busy 45%", + "condition": "C", + "for": "5m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято CPU", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n avg by(instance) (\n rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"PTAF-TB-.*\"}[5m])\n ) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято CPU" + } + }, + { + "refId": "C", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 45 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято CPU", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "C", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "🟡 {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 45%)" + } + }, + { + "uid": "ef4spdg2qcge8c", + "title": "[SYS] CPU Busy 75%", + "condition": "C", + "for": "3m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято CPU", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n avg by(instance) (\n rate(node_cpu_seconds_total{mode=\"idle\", instance=~\"PTAF-TB-.*\"}[5m])\n ) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято CPU" + } + }, + { + "refId": "C", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 75 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято CPU", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "C", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "🔴 {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 75%)" + } + }, + { + "uid": "ef4spmgmowe35", + "title": "[SYS] RAM Busy 35%", + "condition": "Превышение потребления RAM", + "for": "5m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято RAM", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n (node_memory_MemAvailable_bytes{instance=~\"PTAF-TB-.*\"} / \n node_memory_MemTotal_bytes{instance=~\"PTAF-TB-.*\"}) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято RAM" + } + }, + { + "refId": "Превышение потребления RAM", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 35 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято RAM", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение потребления RAM", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "⚪ {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 35%)" + } + }, + { + "uid": "ef4spmgmowe45", + "title": "[SYS] RAM Busy 45%", + "condition": "Превышение потребления RAM", + "for": "5m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято RAM", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n (node_memory_MemAvailable_bytes{instance=~\"PTAF-TB-.*\"} / \n node_memory_MemTotal_bytes{instance=~\"PTAF-TB-.*\"}) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято RAM" + } + }, + { + "refId": "Превышение потребления RAM", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 45 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято RAM", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение потребления RAM", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "🟡 {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 45%)" + } + }, + { + "uid": "ef4spmgmowe80e", + "title": "[SYS] RAM Busy 75%", + "condition": "Превышение потребления RAM", + "for": "3m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "data": [ + { + "refId": "Занято RAM", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "100 - (\n (node_memory_MemAvailable_bytes{instance=~\"PTAF-TB-.*\"} / \n node_memory_MemTotal_bytes{instance=~\"PTAF-TB-.*\"}) * 100\n)", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Занято RAM" + } + }, + { + "refId": "Превышение потребления RAM", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 75 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "C" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Занято RAM", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение потребления RAM", + "type": "threshold" + } + } + ], + "annotations": { + "summary": "🔴 {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 75%)" } }, { @@ -606,7 +914,7 @@ } ], "annotations": { - "summary": "🚨 {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 90%)" + "summary": "🔴 {{ $labels.instance }}: CPU загружен на {{ $values.\"Занято CPU\".Value | printf \"%.1f\" }}% (порог 90%)" } }, { @@ -683,9 +991,249 @@ } ], "annotations": { - "summary": "🚨 {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 90%)" + "summary": "🔴 {{ $labels.instance }}: RAM занята на {{ $values.\"Занято RAM\".Value | printf \"%.1f\" }}% (порог 90%)" } }, + { + "uid": "net_total_35_bond0", + "title": "[SYS] Network bond0 35%", + "condition": "Превышение", + "for": "5m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "isPaused": false, + "folderUID": "", + "ruleGroup": "", + "annotations": { + "summary": "⚪ {{ $labels.instance }}: нагрузка на bond0 {{ $values.\"Total\".Value | printf \"%.2f\" }} Гбит/с (порог 35% от 25 Гбит/с)" + }, + "data": [ + { + "refId": "Total", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "(rate(node_network_receive_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m]) + rate(node_network_transmit_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m])) * 8 / 1000000000", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Total" + } + }, + { + "refId": "Превышение", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 8.75 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "Превышение" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Total", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение", + "type": "threshold" + } + } + ] + }, + { + "uid": "net_total_45_bond0", + "title": "[SYS] Network bond0 45%", + "condition": "Превышение", + "for": "3m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "isPaused": false, + "folderUID": "", + "ruleGroup": "", + "annotations": { + "summary": "🟡 {{ $labels.instance }}: нагрузка на bond0 {{ $values.\"Total\".Value | printf \"%.2f\" }} Гбит/с (порог 45% от 25 Гбит/с)" + }, + "data": [ + { + "refId": "Total", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "(rate(node_network_receive_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m]) + rate(node_network_transmit_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m])) * 8 / 1000000000", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Total" + } + }, + { + "refId": "Превышение", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 11.25 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "Превышение" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Total", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение", + "type": "threshold" + } + } + ] + }, + { + "uid": "net_total_75_bond0", + "title": "[SYS] Network bond0 75%", + "condition": "Превышение", + "for": "1m", + "no_data_state": "NoData", + "exec_err_state": "Error", + "isPaused": false, + "folderUID": "", + "ruleGroup": "", + "annotations": { + "summary": "🔴 {{ $labels.instance }}: нагрузка на bond0 {{ $values.\"Total\".Value | printf \"%.2f\" }} Гбит/с (порог 75% от 25 Гбит/с)" + }, + "data": [ + { + "refId": "Total", + "relativeTimeRange": { + "from": 600, + "to": 0 + }, + "datasourceUid": "deibaq3pwytxce", + "model": { + "datasource": { + "type": "prometheus", + "uid": "deibaq3pwytxce" + }, + "editorMode": "code", + "expr": "(rate(node_network_receive_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m]) + rate(node_network_transmit_bytes_total{instance=~\"PTAF-TB-.*\", device=\"bond0\"}[5m])) * 8 / 1000000000", + "instant": true, + "intervalMs": 1000, + "legendFormat": "__auto", + "maxDataPoints": 43200, + "range": false, + "refId": "Total" + } + }, + { + "refId": "Превышение", + "relativeTimeRange": { + "from": 0, + "to": 0 + }, + "datasourceUid": "__expr__", + "model": { + "conditions": [ + { + "evaluator": { + "params": [ + 18.75 + ], + "type": "gt" + }, + "operator": { + "type": "and" + }, + "query": { + "params": [ + "Превышение" + ] + }, + "reducer": { + "params": [], + "type": "last" + }, + "type": "query" + } + ], + "datasource": { + "type": "__expr__", + "uid": "__expr__" + }, + "expression": "Total", + "intervalMs": 1000, + "maxDataPoints": 43200, + "refId": "Превышение", + "type": "threshold" + } + } + ] + }, { "uid": "cfc4iwprdvn5se", "title": "[SYS] Состояние контейнеров", @@ -694,7 +1242,7 @@ "no_data_state": "NoData", "exec_err_state": "Error", "annotations": { - "summary": "🐳 Контейнер {{ index $labels `name` }} на хосте {{ index $labels `instance` }} упал. Текущее значение: {{ $values.A.Value }}" + "summary": "🔴 Контейнер {{ index $labels `name` }} на хосте {{ index $labels `instance` }} упал. Текущее значение: {{ $values.A.Value }}" }, "data": [ { @@ -844,6 +1392,6 @@ ], "contact_point": { "receiver_name": "tg+mail+mattermost PTAF Grafana", - "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 }}" + "message_template": "{{ range .Alerts }}{{ if eq .Status \"firing\" }}🔴 Firing{{ else }}✅ Resolved{{ end }}\n{{ if .Annotations.client_domain }}{{ if eq .Annotations.severity \"warning\" }}🟡 {{ .Annotations.client_domain }}{{ if index .Values \"_Reduce\" }} — на WAF {{ index .Values \"_Reduce\" | printf \"%.0f\" }} {{ if .Annotations.value_unit }}{{ .Annotations.value_unit }}{{ end }}{{ end }} {{ if .Annotations.code_field }}{{ .Annotations.code_field }}{{ end }} кодов ответа {{ if .Annotations.field_info }}{{ .Annotations.field_info }}{{ end }}\n{{ if .Annotations.threshold_count }}Пороговое значение {{ .Annotations.threshold_count }}\n{{ end }}{{ else }}{{ if eq .Status \"firing\" }}🔴 {{ .Annotations.client_domain }} — {{ .Annotations.code_field }} ошибок > {{ .Annotations.threshold_value }}% держится > {{ .Annotations.for_duration }}.\nТекущее значение: {{ if index .Values \"Значение\" }}{{ index .Values \"Значение\" | printf \"%.2f\" }}%{{ end }}{{ if index .Values \"_Reduce\" }}{{ index .Values \"_Reduce\" | printf \"%.2f\" }}%{{ end }} {{ if .Annotations.field_info }}{{ .Annotations.field_info }}{{ end }}\n{{ else }}🔴 {{ .Annotations.client_domain }} — {{ .Annotations.code_field }} ошибок < {{ .Annotations.threshold_value }}%.\nТекущее значение: {{ if index .Values \"Значение\" }}{{ index .Values \"Значение\" | printf \"%.2f\" }}%{{ end }}{{ if index .Values \"_Reduce\" }}{{ index .Values \"_Reduce\" | printf \"%.2f\" }}%{{ end }} {{ if .Annotations.field_info }}{{ .Annotations.field_info }}{{ end }}\n{{ end }}{{ end }}{{ else }}{{ if .Annotations.summary }}{{ .Annotations.summary }}\n{{ end }}{{ end }}{{ if eq .Status \"firing\" }}Время сработки алерта: {{ .StartsAt.Format \"2006-01-02 15:04:05 UTC\" }}{{ else }}Время разрешения алерта: {{ .EndsAt.Format \"2006-01-02 15:04:05 UTC\" }}{{ end }}\n{{ if .Annotations.runbook }}\nНеобходимо {{ .Annotations.runbook }}\n{{ end }}{{ end }}" } } \ No newline at end of file