lab6_files

This commit is contained in:
caramelteawithmint
2026-12-04 19:16:26 +03:00
parent 20afc2c790
commit 4f21a985f7
38 changed files with 2115 additions and 0 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!"
@@ -0,0 +1,13 @@
apiVersion: 1
providers:
- name: "default"
orgId: 1
folder: "MTUSI Lab6"
type: file
disableDeletion: false
updateIntervalSeconds: 10
allowUiUpdates: true
options:
path: /var/lib/grafana/dashboards
foldersFromFilesStructure: false
@@ -0,0 +1,38 @@
apiVersion: 1
datasources:
- name: Prometheus
type: prometheus
access: proxy
url: http://prometheus:9090
isDefault: true
uid: prometheus
editable: false
- name: Loki
type: loki
access: proxy
url: http://loki:3100
editable: false
jsonData:
derivedFields:
- datasourceUid: tempo
matcherRegex: '"trace_id":"([a-f0-9]+)"'
name: TraceID
url: "$${__value.raw}"
- name: Tempo
type: tempo
access: proxy
url: http://tempo:3200
editable: false
jsonData:
tracesToLogs:
datasourceUid: loki
tags: ["service.name"]
mappedTags: [{ key: "service.name", value: "service_name" }]
mapTagNamesEnabled: true
spanStartTimeShift: "-5m"
spanEndTimeShift: "5m"
filterByTraceID: true
filterBySpanID: false