Skip to content

Commit 0133222

Browse files
author
Anandkumar Patel
committed
better prom for kube
1 parent 1d4da23 commit 0133222

5 files changed

Lines changed: 26 additions & 19 deletions

File tree

ansible/delta-hosts/variables

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ pheidi_runnabot_tokens=d22a5ec75f66a0f472f3d856eb01df2321115e0b,33d8accaa7afeace
140140

141141
[prometheus:vars]
142142
pager_duty_key=ky6EFGL7Zh-xH8x1qEJV
143+
volume_id=vol-0dc9ca42481538a30
143144

144145
[sauron:vars]
145146
sauron_rollbar_key=83157ae2d50d4b6398e404c0b9978d26

ansible/group_vars/alpha-prometheus.yml

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,20 @@ hosted_ports: ["{{ prometheus_port }}"]
66

77
memory_hard_limit: 15G
88

9+
storage_size_gb: 100
10+
911
volume_mounts:
10-
- name: "{{ name }}-conf"
11-
path: /prometheus
12-
kind: configMap
12+
- name: "{{ name }}-conf"
13+
path: /prometheus
14+
kind: configMap
15+
- name: "{{ name }}-db-claim"
16+
path: /data
17+
kind: persistent
1318

1419
container_run_args: >
1520
-alertmanager.url "{{ prometheus_alert_url }}"
1621
-config.file=/prometheus/prometheus.yml
17-
-storage.local.path "data"
22+
-storage.local.path "/data"
1823
-storage.local.retention 168h0m0s
1924
-web.external-url http://localhost
2025
-web.listen-address ":{{ prometheus_port }}"

ansible/prometheus.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77

88
- role: prometheus
99

10+
- role: database
1011
- role: k8-deployment
1112
- role: k8-service

ansible/roles/database/tasks/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010

1111
- name: create volume yaml
1212
template:
13-
dest: "{{ volumes_path }}/{{ name }}"
13+
dest: "{{ volumes_path }}/{{ name }}.yml"
1414
src: volume.yml
1515

1616
- name: create volume claim yaml
1717
template:
18-
dest: "{{ volumes_path }}/{{ name }}-claim"
18+
dest: "{{ volumes_path }}/{{ name }}-claim.yml"
1919
src: volume-claim.yml

ansible/roles/prometheus/files/alerts.conf

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ ALERT HookDockUnresponsive
66
type = "unresponsive"
77
}
88
ANNOTATIONS {
9-
summary = "({{ $labels.env }}) Dock unresponsive host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
10-
description = "(hook) Dock unresponsive host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}"
9+
summary = "({{ $labels.env }}) Dock unresponsive host={{ $labels.hostIp }} labels={{ $labels }}",
10+
description = "(hook) Dock unresponsive host={{ $labels.hostIp }} labels={{ $labels }}"
1111
}
1212

1313
ALERT DockUnresponsive
@@ -17,8 +17,8 @@ ALERT DockUnresponsive
1717
reportTo = "pagerduty"
1818
}
1919
ANNOTATIONS {
20-
summary = "({{ $labels.env }}) Dock unresponsive host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
21-
description = "Dock unresponsive host={{ $labels.hostIp }} org={{ $labels.githubOrgId }"
20+
summary = "({{ $labels.env }}) Dock unresponsive host={{ $labels.hostIp }} labels={{ $labels }}",
21+
description = "Dock unresponsive host={{ $labels.hostIp }} labels={{ $labels }"
2222
}
2323

2424
ALERT HookDockDockerDiskFull
@@ -29,8 +29,8 @@ ALERT HookDockDockerDiskFull
2929
type = "disk_filled"
3030
}
3131
ANNOTATIONS {
32-
summary = "({{ $labels.env }}) Dock /docker disk 70% host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
33-
description = "(hook) Dock /docker disk 70% host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}"
32+
summary = "({{ $labels.env }}) Dock /docker disk 70% host={{ $labels.hostIp }} labels={{ $labels }}",
33+
description = "(hook) Dock /docker disk 70% host={{ $labels.hostIp }} labels={{ $labels }}"
3434
}
3535

3636
ALERT DockDockerDiskFull
@@ -40,7 +40,7 @@ ALERT DockDockerDiskFull
4040
reportTo = "pagerduty"
4141
}
4242
ANNOTATIONS {
43-
summary = "({{ $labels.env }}) Dock /docker disk 90% host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
43+
summary = "({{ $labels.env }}) Dock /docker disk 90% host={{ $labels.hostIp }} labels={{ $labels }}",
4444
description = "Playbook here: https://github.com/CodeNow/devops-scripts/wiki/server-out-of-disk"
4545
}
4646

@@ -51,7 +51,7 @@ ALERT DockRootDiskFull
5151
reportTo = "pagerduty"
5252
}
5353
ANNOTATIONS {
54-
summary = "({{ $labels.env }}) Dock root disk 90% host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
54+
summary = "({{ $labels.env }}) Dock root disk 90% host={{ $labels.hostIp }} labels={{ $labels }}",
5555
description = "Playbook here: https://github.com/CodeNow/devops-scripts/wiki/server-out-of-disk"
5656
}
5757

@@ -63,8 +63,8 @@ ALERT HookDockOutOfRam
6363
type = "memory_exhausted"
6464
}
6565
ANNOTATIONS {
66-
summary = "({{ $labels.env }}) Dock out of ram host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
67-
description = "(hook) Dock out of ram host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}"
66+
summary = "({{ $labels.env }}) Dock out of ram host={{ $labels.hostIp }} labels={{ $labels }}",
67+
description = "(hook) Dock out of ram host={{ $labels.hostIp }} labels={{ $labels }}"
6868
}
6969

7070
ALERT DockOutOfRam
@@ -74,8 +74,8 @@ ALERT DockOutOfRam
7474
reportTo = "pagerduty"
7575
}
7676
ANNOTATIONS {
77-
summary = "({{ $labels.env }}) Dock out of ram host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
78-
description = "unhealthy dock {{ $labels.hostIp } using dock-cli and message slack #customer channel with org={{ $labels.githubOrgId }}"
77+
summary = "({{ $labels.env }}) Dock out of ram host={{ $labels.hostIp }} labels={{ $labels }}",
78+
description = "unhealthy dock {{ $labels.hostIp } using dock-cli and message slack #customer channel with labels={{ $labels }}"
7979
}
8080

8181
ALERT DockHighLoad
@@ -85,6 +85,6 @@ ALERT DockHighLoad
8585
reportTo = "pagerduty"
8686
}
8787
ANNOTATIONS {
88-
summary = "({{ $labels.env }}) Dock is experiencing high load host={{ $labels.hostIp }} org={{ $labels.githubOrgId }}",
88+
summary = "({{ $labels.env }}) Dock is experiencing high load host={{ $labels.hostIp }} labels={{ $labels }}",
8989
description = "ssh {{ $labels.hostIp }} into dock make sure it is responsive, if it is not, unhealthy. `docks unhealthy -e delta {{ $labels.hostIp }}`"
9090
}

0 commit comments

Comments
 (0)