Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: rule expr for db backup prom rules #1866

Merged
merged 4 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions values/prometheus-operator/rules/gitea-db-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ groups:
- name: gitea-db-backup
rules:
- alert: BackupGiteaDbFailing
expr: time() - cnpg_collector_last_failed_backup_timestamp{namespace="gitea",pod=~"gitea-db-1"} > 86400 or time() - cnpg_collector_last_failed_backup_timestamp{namespace="gitea",pod=~"gitea-db-2"} > 86400
j-zimnowoda marked this conversation as resolved.
Show resolved Hide resolved
# 86400 sec => 24H
expr: (time() - max(cnpg_collector_last_available_backup_timestamp{namespace="gitea"}) > 86400)
labels:
severity: warning
annotations:
description: 'The Gitea database backup for DB {{ $labels.pod }} failed at {{ $value | humanizeTimestamp }}'
summary: Backup of {{ $labels.pod }} failed
summary: Backup of {{ $labels.pod }} failed
3 changes: 2 additions & 1 deletion values/prometheus-operator/rules/harbor-db-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ groups:
- name: harbor-db-backup
rules:
- alert: BackupHarborDbFailing
expr: time() - cnpg_collector_last_failed_backup_timestamp{namespace="harbor",pod=~"harbor-otomi-db-1"} > 86400 or time() - cnpg_collector_last_failed_backup_timestamp{namespace="harbor",pod=~"harbor-otomi-db-2"} > 86400
# 86400 sec => 24H
expr: (time() - max(cnpg_collector_last_available_backup_timestamp{namespace="harbor"}) > 86400)
labels:
severity: warning
annotations:
Expand Down
3 changes: 2 additions & 1 deletion values/prometheus-operator/rules/keycloak-db-backup.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ groups:
- name: keycloak-db-backup
rules:
- alert: BackupKeycloakDbFailing
expr: time() - cnpg_collector_last_failed_backup_timestamp{namespace="keycloak",pod=~"keycloak-db-1"} > 86400 or time() - cnpg_collector_last_failed_backup_timestamp{namespace="keycloak",pod=~"keycloak-db-2"} > 86400
# 86400 sec => 24H
expr: (time() - max(cnpg_collector_last_available_backup_timestamp{namespace="keycloak"}) > 86400)
labels:
severity: warning
annotations:
Expand Down
Loading