Skip to content

Commit

Permalink
prom: Add alert examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Boissiere committed Aug 20, 2019
1 parent b21df8b commit f5471a2
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prometheus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Prometheus alerting

Alerts example
25 changes: 25 additions & 0 deletions prometheus/alerts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
groups:
- name: Backups
rules:
- alert: MongoDBBackupNotRunningIn24Hours
expr: '(time() - max(mongodb_backups_scheduler_last_successful_snapshot)) / 60 / 60 > 24'
for: 1m
labels:
severity: P3
annotations:
message: MongoDB backups on {{ $labels.instance }}, for snapshot {{ $labels.name }} has not ran in the last 24H
- alert: MongoDBBackupError
expr: 'mongodb_backups_scheduler_backup_total{status="error"} > 1'
for: 30s
labels:
severity: P3
annotations:
message: MongoDB backups on {{ $labels.instance }}, for snapshot {{ $labels.name }} has errors
- alert: MongoDBBackupRetentionError
expr: 'mongodb_backups_scheduler_retention_total{status="error"} > 1'
for: 30s
labels:
severity: P3
annotations:
message: MongoDB retention removal on {{ $labels.instance }} for {{ $labels.name }} has errors

0 comments on commit f5471a2

Please sign in to comment.