-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated the docker rules and fixed the test case for docker container…
… status
- Loading branch information
Deepak Tiwari
committed
Dec 18, 2024
1 parent
66d3c0a
commit 8fb9ab2
Showing
4 changed files
with
53 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
groups: | ||
- name: monitor::system::docker | ||
rules: | ||
- alert: monitor::system::docker::status | ||
expr: | | ||
( | ||
sum by (certname, name) (increase(container_last_seen{name!~"^runner.*"}[30m])) < 1200 | ||
) and on(certname) obmondo_monitoring{alert_id="monitor::system::docker::status"} > 0 | ||
for: 5m | ||
labels: | ||
alert_id: monitor::system::docker::status | ||
severity: critical | ||
annotations: | ||
summary: "Docker container {{$labels.name}} is down on host {{ $labels.certname }}" | ||
description: "Docker container **{{ $labels.name }}** is down since from 10min on server **{{ $labels.certname }}**" |
9 changes: 9 additions & 0 deletions
9
argocd-helm-charts/prometheus-linuxaid/templates/prometheusRule-docker.yaml
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,9 @@ | ||
{{- if .Values.prometheusRule.docker }} | ||
apiVersion: monitoring.coreos.com/v1 | ||
kind: PrometheusRule | ||
metadata: | ||
name: docker-rules | ||
namespace: monitoring-{{ .Values.customerid }} | ||
spec: | ||
{{- $.Files.Get "rules/docker.yaml" | nindent 4 }} | ||
{{- end }} |
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,28 @@ | ||
--- | ||
evaluation_interval: 1m | ||
|
||
rule_files: | ||
- ../rules/docker.yaml | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: obmondo_monitoring{certname="bantha.enableit", alert_id="monitor::system::docker::status"} | ||
values: 1x1800 | ||
- series: container_last_seen{certname="bantha.enableit", name="packagesign-script-1"} | ||
values: '1734500308+35x1800' | ||
- series: container_last_seen{certname="bantha.enableit", name="jenkins"} | ||
values: '1734500308+60x1800' | ||
|
||
alert_rule_test: | ||
- alertname: monitor::system::docker::status | ||
eval_time: 30m | ||
exp_alerts: | ||
- exp_labels: | ||
severity: critical | ||
certname: bantha.enableit | ||
name: packagesign-script-1 | ||
alert_id: monitor::system::docker::status | ||
exp_annotations: | ||
summary: 'Docker container packagesign-script-1 is down on host bantha.enableit' | ||
description: 'Docker container **packagesign-script-1** is down since from 10min on server **bantha.enableit**' |
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