-
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
ROX-21530: certificate-alerting
- Loading branch information
Showing
2 changed files
with
67 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
51 changes: 51 additions & 0 deletions
51
resources/prometheus/unit_tests/RHACSFleetschardCertificateExpiring.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,51 @@ | ||
rule_files: | ||
- /tmp/prometheus-rules-test.yaml | ||
|
||
evaluation_interval: 1m | ||
|
||
tests: | ||
- interval: 1d | ||
input_series: | ||
- series: acs_fleetshard_certificate_expiration_timestamp{exported_namespace="rhacs-00000000000000000000", secret="secret", data_key="key"} | ||
values: "691200+0x15" # equals to 8 days | ||
|
||
alert_rule_test: | ||
- eval_time: 0 | ||
alertname: RHACSFleetshardCertificateExpiryWarning | ||
exp_alerts: [ ] | ||
- eval_time: 3d | ||
alertname: RHACSFleetshardCertificateExpiryWarning | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSFleetshardCertificateExpiryWarning | ||
exported_namespace: rhacs-00000000000000000000 | ||
secret: secret | ||
data_key: key | ||
severity: warning | ||
exp_annotations: | ||
summary: "Certificate expiring soon: `rhacs-00000000000000000000/secret/key`." | ||
description: "Certificate `rhacs-00000000000000000000/secret/key` expires on 1970-01-09 00:00:00 +0000 UTC." | ||
- eval_time: 7d | ||
alertname: RHACSFleetshardCertificateExpiryCritical | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSFleetshardCertificateExpiryCritical | ||
exported_namespace: rhacs-00000000000000000000 | ||
secret: secret | ||
data_key: key | ||
severity: critical | ||
exp_annotations: | ||
summary: "Certificate expiring very soon: `rhacs-00000000000000000000/secret/key`." | ||
description: "Certificate `rhacs-00000000000000000000/secret/key` expires on 1970-01-09 00:00:00 +0000 UTC." | ||
- eval_time: 10d | ||
alertname: RHACSFleetshardCertificateExpiryCritical | ||
exp_alerts: | ||
- exp_labels: | ||
alertname: RHACSFleetshardCertificateExpiryCritical | ||
exported_namespace: rhacs-00000000000000000000 | ||
secret: secret | ||
data_key: key | ||
severity: critical | ||
exp_annotations: | ||
summary: "Certificate expiring very soon: `rhacs-00000000000000000000/secret/key`." | ||
description: "Certificate `rhacs-00000000000000000000/secret/key` expires on 1970-01-09 00:00:00 +0000 UTC." |