Files
grafana-terraform/environments/dev/adibrov/alerts/postgres/postgres_long_transactions.yaml
Alexandr 5af763ebb1
Some checks failed
terraform-dev / validate (push) Successful in 6s
terraform-dev / plan (push) Failing after 11s
terraform-dev / apply (push) Has been skipped
feat: add postgres/gitea/blackbox alerts and more node alerts
2026-04-03 11:34:08 +03:00

22 lines
725 B
YAML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: "DEV ADIBROV - PostgreSQL Long Running Transactions"
expression: |
max by(instance) (
pg_stat_activity_max_tx_duration{job="postgres", state="active"}
)
threshold: 300
for: "5m"
condition_type: "gt"
need_reduce: true
reducer_type: "max"
no_data_state: "OK"
exec_err_state: "Error"
labels:
service: "postgres"
severity: "warning"
team: "infra"
summary: |
Долгая транзакция в PostgreSQL на {{ $labels.instance }}: {{ printf "%.0f" $values.B.Value }}с
description: |
На {{ $labels.instance }} есть транзакция, выполняющаяся более 5 минут.
Долгие транзакции блокируют vacuum и могут накапливать bloat.