4 grade_and_report

This commit is contained in:
caramelteawithmint
2026-11-27 14:03:46 +03:00
parent d8b193f62b
commit b41a645ec3
12 changed files with 280 additions and 182 deletions
@@ -0,0 +1,41 @@
apiVersion: 1
groups:
- orgId: 1
name: "worker_alerts"
folder: "Lab6 Alerts"
interval: 1m
rules:
- uid: worker-errors
title: "Worker Errors Detected"
condition: C
data:
# A: Запрос в Prometheus
- refId: A
datasourceUid: "prometheus"
model:
expr: 'worker_processed_total{result="error"}'
instant: true
# B: Берем последнее значение (Reduce)
- refId: B
datasourceUid: "__expr__"
model:
expression: "A"
reducer: "last"
# C: Порог (Threshold) — если больше 0, то Firing
- refId: C
datasourceUid: "__expr__"
model:
expression: "B"
type: "threshold"
conditions:
- evaluator:
type: "gt"
params: [0]
noDataState: "NoData"
execErrState: "Error"
for: "0m"
labels:
severity: "critical"
annotations:
summary: "Worker has encountered errors!"
@@ -6,6 +6,7 @@ datasources:
access: proxy
url: http://prometheus:9090
isDefault: true
uid: prometheus
editable: false
- name: Loki