-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* Add emailsender alerts * Add rate to throttled metric
- Loading branch information
Showing
6 changed files
with
193 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
27 changes: 27 additions & 0 deletions
27
resources/prometheus/unit_tests/RHACSEmailsenderContainerDown.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,27 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: kube_pod_container_status_ready{namespace="rhacs", pod="emailsender-123", container="emailsender"} | ||
values: "1+0x10 0+0x50" | ||
alert_rule_test: | ||
- eval_time: 15m | ||
alertname: RHACSEmailsenderContainerDown | ||
exp_alerts: [] | ||
- eval_time: 40m | ||
alertname: RHACSEmailsenderContainerDown | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSEmailsenderContainerDown | ||
container: emailsender | ||
namespace: rhacs | ||
pod: emailsender-123 | ||
severity: warning | ||
exp_annotations: | ||
summary: "Email Sender container `emailsender-123/emailsender` in namespace `rhacs` is down or in a CrashLoopBackOff status." | ||
description: "Email Sender container `emailsender-123/emailsender` in namespace `rhacs` has been down or in a CrashLoopBackOff status for at least 10 minutes." | ||
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-managed-service-runbooks/blob/master/sops/dp-046-emailsender-unavailable.md" |
27 changes: 27 additions & 0 deletions
27
resources/prometheus/unit_tests/RHACSEmailsenderContainerFrequentlyRestarting.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,27 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: kube_pod_container_status_restarts_total{namespace="rhacs", pod="emailsender-123", container="emailsender"} | ||
values: "0+0x30 1+1x10 4+1x20" | ||
alert_rule_test: | ||
- eval_time: 30m | ||
alertname: RHACSEmailsenderContainerFrequentlyRestarting | ||
exp_alerts: [] | ||
- eval_time: 60m | ||
alertname: RHACSEmailsenderContainerFrequentlyRestarting | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSEmailsenderContainerFrequentlyRestarting | ||
container: emailsender | ||
namespace: rhacs | ||
pod: emailsender-123 | ||
severity: warning | ||
exp_annotations: | ||
summary: "Email Sender container `emailsender-123/emailsender` in namespace `rhacs` restarted more than 3 times." | ||
description: "Email Sender container `emailsender-123/emailsender` in namespace `rhacs` has restarted more than 3 times during the last 30 minutes." | ||
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-managed-service-runbooks/blob/master/sops/dp-046-emailsender-unavailable.md" |
29 changes: 29 additions & 0 deletions
29
resources/prometheus/unit_tests/RHACSEmailsenderScrapeFailed.yaml.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,29 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: up{namespace="rhacs", pod="emailsender-123", instance="1.2.3.4:9090"} | ||
values: "0+0x20 1+0x20" | ||
- series: kube_pod_container_status_ready{namespace="rhacs", pod="emailsender-123"} | ||
values: "1+0x40" | ||
alert_rule_test: | ||
- eval_time: 10m | ||
alertname: RHACSEmailsenderScrapeFailed | ||
exp_alerts: [] | ||
- eval_time: 25m | ||
alertname: RHACSEmailsenderScrapeFailed | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSEmailsenderScrapeFailed | ||
instance: 1.2.3.4:9090 | ||
namespace: rhacs | ||
pod: emailsender-123 | ||
severity: warning | ||
exp_annotations: | ||
summary: "Prometheus unable to scrape metrics from target `emailsender-123` in namespace `rhacs`." | ||
description: "During the last 10 minutes, only `45.45%` of scrapes of target `emailsender-123` in namespace `rhacs` were successful. This alert is raised when less than 50% of scrapes are successful." | ||
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-managed-service-runbooks/blob/master/sops/dp-046-emailsender-unavailable.md" |
29 changes: 29 additions & 0 deletions
29
resources/prometheus/unit_tests/RHACSEmailsenderSendErrors.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,29 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: acs_emailsender_failed_send_email_total{namespace="rhacs", pod="emailsender-123", container="emailsender"} | ||
values: "0+0x10 1+1x50" | ||
- series: acs_emailsender_send_email_total{namespace="rhacs", pod="emailsender-123", container="emailsender"} | ||
values: "1+1x10 1+2x50" | ||
alert_rule_test: | ||
- eval_time: 15m | ||
alertname: RHACSEmailsenderSendErrors | ||
exp_alerts: [] | ||
- eval_time: 40m | ||
alertname: RHACSEmailsenderSendErrors | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSEmailsenderSendErrors | ||
container: emailsender | ||
namespace: rhacs | ||
pod: emailsender-123 | ||
severity: warning | ||
exp_annotations: | ||
summary: "Email Sender container failing sending emails" | ||
description: "Email Sender has a send email error rate of 50% over the last 10 minutes." | ||
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-managed-service-runbooks/blob/master/sops/dp-047-emailsender-ses-send-error.md" |
28 changes: 28 additions & 0 deletions
28
resources/prometheus/unit_tests/RHACSEmailsenderThrottledSend.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,28 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1m | ||
input_series: | ||
- series: acs_emailsender_throttled_send_email_total{namespace="rhacs", pod="emailsender-123", container="emailsender", tenant_id="centralid"} | ||
values: "0+0x10 2+1x60" | ||
alert_rule_test: | ||
- eval_time: 15m | ||
alertname: RHACSEmailsenderThrottledSend | ||
exp_alerts: [] | ||
- eval_time: 40m | ||
alertname: RHACSEmailsenderThrottledSend | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSEmailsenderThrottledSend | ||
container: emailsender | ||
namespace: rhacs | ||
pod: emailsender-123 | ||
tenant_id: centralid | ||
severity: warning | ||
exp_annotations: | ||
summary: "Email Sender throttled sending for `centralid` Central instance" | ||
description: "Email Sender throttled `centralid` Central 1 time(s) per minute over the last 10 minutes." | ||
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-managed-service-runbooks/blob/master/sops/dp-048-emailsender-ses-send-throttled.md" |