22 lines
725 B
YAML
22 lines
725 B
YAML
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.
|