-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WHY: It is one of the requisite alerts for monitoring HOW: By adding high cpu templates, prometheus templates, altering configmap and wiring it up
- Loading branch information
Tope Emmanuel
committed
Mar 17, 2024
1 parent
2183265
commit f2f78eb
Showing
11 changed files
with
158 additions
and
45 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
31 changes: 31 additions & 0 deletions
31
cluster/terraform_kubernetes/config/prometheus/alertmanager-config.tpl
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,31 @@ | ||
global: | ||
templates: | ||
- '/etc/alertmanager-templates/*.tmpl' | ||
|
||
route: | ||
receiver: alert-default | ||
group_by: ['alertname', 'priority'] | ||
group_wait: 1m | ||
repeat_interval: 30m | ||
routes: | ||
%{ for config in service_configs ~} | ||
- receiver: ${config.receiver_name} | ||
match: | ||
service: '${config.service}' | ||
group_wait: 1m | ||
repeat_interval: 10m | ||
%{ endfor ~} | ||
|
||
receivers: | ||
- name: alert-default | ||
%{ for config in service_configs ~} | ||
- name: ${config.receiver_name} | ||
slack_configs: | ||
- api_url: '${config.slack_secret}' | ||
channel: '${config.slack_channel}' | ||
send_resolved: true | ||
text: '{{ template "${config.text_template}" . }}' | ||
%{ if config.title_template != "" ~} | ||
title: '{{ template "${config.title_template}" . }}' | ||
%{ endif ~} | ||
%{ endfor ~} |
22 changes: 0 additions & 22 deletions
22
cluster/terraform_kubernetes/config/prometheus/alertmanager-config.yaml
This file was deleted.
Oops, something went wrong.
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
29 changes: 29 additions & 0 deletions
29
cluster/terraform_kubernetes/config/prometheus/development.prometheus-rules.tpl
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,29 @@ | ||
# | ||
# see https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/ | ||
# | ||
# Example rule below, which should be removed once real rules added | ||
# | ||
groups: | ||
- name: High Number Of DesiredPods | ||
rules: | ||
- alert: High Number Of DesiredPods | ||
expr: kubelet_active_pods > 1000 | ||
for: 30m | ||
labels: | ||
severity: slack | ||
annotations: | ||
description: High Number Of DesiredPods | ||
summary: High Number Of DesiredPods | ||
|
||
%{ for config in service_configs ~} | ||
- name: pod-cpu-usage-${config.service} | ||
rules: | ||
- alert: HighPodCpuUsage-${config.service} | ||
expr: rate(container_cpu_usage_seconds_total{container!="",pod!="",pod=~"${config.service}.*"}[5m]) > ${config.threshold} | ||
for: 2m | ||
labels: | ||
service: ${config.service} | ||
annotations: | ||
summary: High CPU usage detected in pod ({{ $labels.pod }}) | ||
description: "Pod {{ $labels.namespace }}/{{ $labels.pod }} is using high CPU: {{ $value }}" | ||
%{ endfor ~} |
16 changes: 0 additions & 16 deletions
16
cluster/terraform_kubernetes/config/prometheus/development.prometheus.rules
This file was deleted.
Oops, something went wrong.
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
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
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