diff --git a/examples/alerts/kustomization.yaml b/examples/alerts/kustomization.yaml index bbdda37bd..66b05c538 100644 --- a/examples/alerts/kustomization.yaml +++ b/examples/alerts/kustomization.yaml @@ -5,3 +5,4 @@ resources: - prometheusrules_policies_missing.yaml - slo-availability.yaml - slo-latency.yaml + - orphan_records.yaml diff --git a/examples/alerts/orphan_records.yaml b/examples/alerts/orphan_records.yaml new file mode 100644 index 000000000..119574352 --- /dev/null +++ b/examples/alerts/orphan_records.yaml @@ -0,0 +1,19 @@ +apiVersion: monitoring.coreos.com/v1 +kind: PrometheusRule +metadata: + name: dns-records-rules + namespace: monitoring +spec: + groups: + - name: dns_records + rules: + - alert: PossibleOrphanedDNSRecords + expr: | + sum(count by(rootDomain) (kuadrant_dnsrecord_status_root_domain_owners) / count by(rootDomain) (kuadrant_dnsrecord_status) - count by(rootDomain) (kuadrant_dnsrecord_status) ) > 0 + for: 5m + labels: + severity: warning + annotations: + summary: "The number of DNS Owners is greater than the number of records for root domain '{{ $labels.rootDomain }}'" + description: "This alert fires if the number of owners (controller collaborating on a record set) is greater than the number of records. This may mean a record has been left behind in the provider due to a failed delete" + \ No newline at end of file diff --git a/examples/alerts/prometheusrules_policies_missing.yaml b/examples/alerts/prometheusrules_policies_missing.yaml index 3622b7962..846c71339 100644 --- a/examples/alerts/prometheusrules_policies_missing.yaml +++ b/examples/alerts/prometheusrules_policies_missing.yaml @@ -55,3 +55,4 @@ spec: annotations: summary: "No RateLimitPolicy targeting HTTPRoute '{{ $labels.httproute_name }}'" description: "This alert fires if a HTTPRoute does not have an associated RateLimitPolicy." + \ No newline at end of file