-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #72 from technicalpickles/revisit-prometheus
Revisit prometheus
- Loading branch information
Showing
7 changed files
with
150 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
FROM prom/alertmanager | ||
|
||
ARG slack_channel | ||
ARG slack_webhook_url | ||
|
||
COPY config.yml /etc/alertmanager/config.yml | ||
|
||
RUN sed -i -e "s=%%slack_channel%%=$slack_channel=" \ | ||
-e "s=%%slack_webhook_url%%=$slack_webhook_url=" \ | ||
/etc/alertmanager/config.yml | ||
|
||
#RUN cat /etc/alertmanager/config.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
route: | ||
receiver: 'slack' | ||
|
||
receivers: | ||
- name: 'slack' | ||
slack_configs: | ||
- send_resolved: true | ||
text: "{{ .CommonAnnotations.description }}" | ||
username: 'Prometheus' | ||
channel: '#%%slack_channel%%' | ||
api_url: '%%slack_webhook_url%%' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,9 @@ | ||
FROM prom/prometheus | ||
|
||
COPY prometheus.yml /etc/prometheus/prometheus/prometheus.yml | ||
ARG bearer_token | ||
|
||
COPY prometheus.yml /etc/prometheus/prometheus.yml | ||
COPY alert.rules /etc/prometheus/alert.rules | ||
|
||
RUN sed -i -e "s/%%bearer_token%%/$bearer_token/" \ | ||
/etc/prometheus/prometheus.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
groups: | ||
- name: targets | ||
rules: | ||
- alert: monitor_service_down | ||
expr: up == 0 | ||
for: 30s | ||
labels: | ||
severity: critical | ||
annotations: | ||
summary: "Monitor service non-operational" | ||
description: "Service {{ $labels.instance }} is down." | ||
|
||
- name: host | ||
rules: | ||
- alert: high_cpu_load | ||
expr: node_load1 > 1.5 | ||
for: 30s | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: "Server under high load" | ||
description: "Docker host is under high load, the avg load 1m is at {{ $value}}. Reported by instance {{ $labels.instance }} of job {{ $labels.job }}." | ||
|
||
- alert: high_memory_load | ||
expr: (sum(node_memory_MemTotal_bytes) - sum(node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes) ) / sum(node_memory_MemTotal_bytes) * 100 > 85 | ||
for: 30s | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: "Server memory is almost full" | ||
description: "Docker host memory usage is {{ humanize $value}}%. Reported by instance {{ $labels.instance }} of job {{ $labels.job }}." | ||
|
||
- alert: high_storage_load | ||
expr: (node_filesystem_size_bytes{fstype="aufs"} - node_filesystem_free_bytes{fstype="aufs"}) / node_filesystem_size_bytes{fstype="aufs"} * 100 > 85 | ||
for: 30s | ||
labels: | ||
severity: warning | ||
annotations: | ||
summary: "Server storage is almost full" | ||
description: "Docker host storage usage is {{ humanize $value}}%. Reported by instance {{ $labels.instance }} of job {{ $labels.job }}." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters