|
|
@@ -14,10 +14,10 @@ spec:
|
|
|
|
- name: cloudnative-pg/{{ include "cluster.name" . }}
|
|
|
|
- name: cloudnative-pg/{{ include "cluster.name" . }}
|
|
|
|
rules:
|
|
|
|
rules:
|
|
|
|
{{- $dict := dict "excludeRules" .Values.cluster.monitoring.prometheusRule.excludeRules -}}
|
|
|
|
{{- $dict := dict "excludeRules" .Values.cluster.monitoring.prometheusRule.excludeRules -}}
|
|
|
|
{{- $_ := set $dict "value" "{{ $value }}" -}}
|
|
|
|
{{- $_ := set $dict "value" "{{`{{`}} $value {{`}}`}}" -}}
|
|
|
|
{{- $_ := set $dict "namespace" .Release.Namespace -}}
|
|
|
|
{{- $_ := set $dict "namespace" .Release.Namespace -}}
|
|
|
|
{{- $_ := set $dict "cluster" (printf "%s-cluster" (include "cluster.name" .) ) -}}
|
|
|
|
{{- $_ := set $dict "cluster" (printf "%s-cluster" (include "cluster.name" .) ) -}}
|
|
|
|
{{- $_ := set $dict "labels" (dict "job" "{{ $labels.job }}" "node" "{{ $labels.node }}" "pod" "{{ $labels.pod }}") -}}
|
|
|
|
{{- $_ := set $dict "labels" (dict "job" "{{`{{`}} $labels.job {{`}}`}}" "node" "{{`{{`}} $labels.node {{`}}`}}" "pod" "{{`{{`}} $labels.pod {{`}}`}}") -}}
|
|
|
|
{{- $_ := set $dict "podSelector" (printf "%s-cluster-([1-9][0-9]*)$" (include "cluster.name" .) ) -}}
|
|
|
|
{{- $_ := set $dict "podSelector" (printf "%s-cluster-([1-9][0-9]*)$" (include "cluster.name" .) ) -}}
|
|
|
|
{{- $_ := set $dict "Values" .Values -}}
|
|
|
|
{{- $_ := set $dict "Values" .Values -}}
|
|
|
|
{{- $_ := set $dict "Template" .Template -}}
|
|
|
|
{{- $_ := set $dict "Template" .Template -}}
|
|
|
@@ -32,7 +32,7 @@ spec:
|
|
|
|
rules:
|
|
|
|
rules:
|
|
|
|
- alert: LongRunningTransaction
|
|
|
|
- alert: LongRunningTransaction
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: Pod {{ $labels.pod }} is taking more than 5 minutes (300 seconds) for a query.
|
|
|
|
description: Pod {{`{{`}} $labels.pod {{`}}`}} is taking more than 5 minutes (300 seconds) for a query.
|
|
|
|
summary: A query is taking longer than 5 minutes.
|
|
|
|
summary: A query is taking longer than 5 minutes.
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
cnpg_backends_max_tx_duration_seconds > 300
|
|
|
|
cnpg_backends_max_tx_duration_seconds > 300
|
|
|
@@ -41,7 +41,7 @@ spec:
|
|
|
|
severity: warning
|
|
|
|
severity: warning
|
|
|
|
- alert: BackendsWaiting
|
|
|
|
- alert: BackendsWaiting
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: Pod {{ $labels.pod }} has been waiting for longer than 5 minutes
|
|
|
|
description: Pod {{`{{`}} $labels.pod {{`}}`}} has been waiting for longer than 5 minutes
|
|
|
|
summary: If a backend is waiting for longer than 5 minutes
|
|
|
|
summary: If a backend is waiting for longer than 5 minutes
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
cnpg_backends_waiting_total > 300
|
|
|
|
cnpg_backends_waiting_total > 300
|
|
|
@@ -50,7 +50,7 @@ spec:
|
|
|
|
severity: warning
|
|
|
|
severity: warning
|
|
|
|
- alert: PGDatabaseXidAge
|
|
|
|
- alert: PGDatabaseXidAge
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: Over 300,000,000 transactions from frozen xid on pod {{ $labels.pod }}
|
|
|
|
description: Over 300,000,000 transactions from frozen xid on pod {{`{{`}} $labels.pod {{`}}`}}
|
|
|
|
summary: Number of transactions from the frozen XID to the current one
|
|
|
|
summary: Number of transactions from the frozen XID to the current one
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
cnpg_pg_database_xid_age > 300000000
|
|
|
|
cnpg_pg_database_xid_age > 300000000
|
|
|
@@ -68,7 +68,7 @@ spec:
|
|
|
|
severity: warning
|
|
|
|
severity: warning
|
|
|
|
- alert: LastFailedArchiveTime
|
|
|
|
- alert: LastFailedArchiveTime
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: Archiving failed for {{ $labels.pod }}
|
|
|
|
description: Archiving failed for {{`{{`}} $labels.pod {{`}}`}}
|
|
|
|
summary: Checks the last time archiving failed. Will be < 0 when it has not failed.
|
|
|
|
summary: Checks the last time archiving failed. Will be < 0 when it has not failed.
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
(cnpg_pg_stat_archiver_last_failed_time - cnpg_pg_stat_archiver_last_archived_time) > 1
|
|
|
|
(cnpg_pg_stat_archiver_last_failed_time - cnpg_pg_stat_archiver_last_archived_time) > 1
|
|
|
@@ -77,7 +77,7 @@ spec:
|
|
|
|
severity: warning
|
|
|
|
severity: warning
|
|
|
|
- alert: DatabaseDeadlockConflicts
|
|
|
|
- alert: DatabaseDeadlockConflicts
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: There are over 10 deadlock conflicts in {{ $labels.pod }}
|
|
|
|
description: There are over 10 deadlock conflicts in {{`{{`}} $labels.pod {{`}}`}}
|
|
|
|
summary: Checks the number of database conflicts
|
|
|
|
summary: Checks the number of database conflicts
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
cnpg_pg_stat_database_deadlocks > 10
|
|
|
|
cnpg_pg_stat_database_deadlocks > 10
|
|
|
@@ -86,7 +86,7 @@ spec:
|
|
|
|
severity: warning
|
|
|
|
severity: warning
|
|
|
|
- alert: ReplicaFailingReplication
|
|
|
|
- alert: ReplicaFailingReplication
|
|
|
|
annotations:
|
|
|
|
annotations:
|
|
|
|
description: Replica {{ $labels.pod }} is failing to replicate
|
|
|
|
description: Replica {{`{{`}} $labels.pod {{`}}`}} is failing to replicate
|
|
|
|
summary: Checks if the replica is failing to replicate
|
|
|
|
summary: Checks if the replica is failing to replicate
|
|
|
|
expr: |-
|
|
|
|
expr: |-
|
|
|
|
cnpg_pg_replication_in_recovery > cnpg_pg_replication_is_wal_receiver_up
|
|
|
|
cnpg_pg_replication_in_recovery > cnpg_pg_replication_is_wal_receiver_up
|
|
|
|