From dd9679dce71d1ae4daecb8c086e76c9802d97369 Mon Sep 17 00:00:00 2001 From: aaa5kameric Date: Fri, 9 Aug 2024 13:57:00 +0200 Subject: [PATCH] Certificate Expiring Critical + Warning-updated --- resources/prometheus/prometheus-rules.yaml | 4 ++-- .../unit_tests/RHACSFleetschardCertificateExpiring.yaml | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/resources/prometheus/prometheus-rules.yaml b/resources/prometheus/prometheus-rules.yaml index 7a4e199..38c380a 100644 --- a/resources/prometheus/prometheus-rules.yaml +++ b/resources/prometheus/prometheus-rules.yaml @@ -134,8 +134,8 @@ spec: labels: severity: critical annotations: - summary: "Certificate Expiring very soon in namespace `{{ $labels.namespace }}` for secret '{{ $labels.secret}}'." - description: "Certificate '{{ $labels.data_key }}` in namespace `{{ $labels.namespace }}` expires in '{{ $value | time.Unix | time.Since | humanizeDuration }}'." + summary: "Certificate expiring very soon: '{{ $labels.namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}`." + description: "Certificate '{{ $labels.namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}` expires on '{{ ($value | toTime).UTC().Format \"2006-02-01\" }}'." - alert: RHACSFleetshardCertificateExpiringSoon expr: | ((acs_fleetshard_certificate_expiration_timestamp-time())/60/60/24)<7 diff --git a/resources/prometheus/unit_tests/RHACSFleetschardCertificateExpiring.yaml b/resources/prometheus/unit_tests/RHACSFleetschardCertificateExpiring.yaml index e7bb1b5..761a822 100644 --- a/resources/prometheus/unit_tests/RHACSFleetschardCertificateExpiring.yaml +++ b/resources/prometheus/unit_tests/RHACSFleetschardCertificateExpiring.yaml @@ -35,8 +35,8 @@ tests: data_key: key severity: critical exp_annotations: - summary: "Certificate Expiring very soon in namespace `rhacs` for secret 'secret'." - description: "Certificate 'key` in namespace `rhacs` expires in '{{ $value | time.Unix | time.Since | humanizeDuration }}'." + summary: "Certificate expiring very soon: 'rhacs/secret/key`." + description: "Certificate 'rhacs/secret/key` expires on '1970-01-07'." - eval_time: 10d alertname: RHACSFleetshardCertificateExpiringCritical exp_alerts: @@ -47,6 +47,6 @@ tests: data_key: key severity: critical exp_annotations: - summary: "Certificate Expiring very soon in namespace `rhacs` for secret 'secret'." - description: "Certificate 'key` in namespace `rhacs` expires in '{{ $value | time.Unix | time.Since | humanizeDuration }}'." + summary: "Certificate expiring very soon: 'rhacs/secret/key`." + description: "Certificate 'rhacs/secret/key` expires on '1970-01-11'."