forked from metalmatze/digitalocean_exporter
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample.rules.yml
42 lines (42 loc) · 1.67 KB
/
example.rules.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
groups:
- name: digitalocean.rules
rules:
- record: digitalocean_droplets_price_monthly
expr: sum(digitalocean_droplet_price_monthly)
- record: digitalocean_snapshots_price_monthly
expr: sum(digitalocean_snapshot_size_bytes) / 1024 / 1024 / 1024 / 20
- record: digitalocean_volumes_price_monthly
expr: sum(digitalocean_volume_size_bytes) / 1024 / 1024 / 1024 / 10
- record: digitalocean_price_monthly
expr: digitalocean_droplets_price_monthly + digitalocean_volumes_price_monthly + digitalocean_snapshots_price_monthly
- alert: droplet_down
expr: digitalocean_droplet_up == 0
for: 5m
annotations:
description: Droplet {{ $labels.name }} in region {{ $labels.region }} is down.
summary: Droplet is down.
- alert: high_monthly_price
expr: digitalocean_price_monthly > 100
for: 6h
annotations:
description: Overall we're spending too much money. Please try to minimize cost.
summary: Paying too much at DigitalOcean.
- alert: floating_ip_unused
expr: digitalocean_floating_ipv4_active == 0
for: 1h
annotations:
description: Paying ~5$/month for {{ $labels.ipv4 }}, an unused Floating IP.
summary: Paying for an unsed FloatingIP.
- alert: too_many_packer_snapshots
expr: count(digitalocean_snapshot_size_bytes{name=~"packer-.*",type="droplet"})
> 10
for: 6h
annotations:
description: Please delete old packer snapshots. We don't need {{$value}}.
summary: More than 10 Packer Snapshots.
- alert: too_few_ssh_keys
expr: count(digitalocean_key) < 1
for: 1h
annotations:
description: We can't find SSH keys, please add at least one.
summary: No SSH Keys.