fix(kopiur): use upstream PrometheusRules - #4177
Merged
Merged
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
🔗 Linked repositories identifiedCodeRabbit considers these linked repositories for cross-repo context during reviews:
💤 Files with no reviewable changes (2)
📝 WalkthroughWalkthroughKopiur monitoring switches PrometheusRule generation on in the HelmRelease and removes the separately maintained PrometheusRule manifest from the kustomization resources. ChangesPrometheusRule ownership update
Estimated code review effort: 2 (Simple) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
@@ spec.values.monitoring.prometheusRule.enabled @@
# helm.toolkit.fluxcd.io/v2/HelmRelease/kopiur-system/kopiur
! ± value change
- false
+ true
@@ (root level) @@
# monitoring.coreos.com/v1/PrometheusRule/kopiur-system/kopiur-controller
! - one document removed:
- apiVersion: monitoring.coreos.com/v1
- kind: PrometheusRule
- metadata:
- name: kopiur-controller
- namespace: kopiur-system
- labels:
- kustomize.toolkit.fluxcd.io/name: kopiur
- kustomize.toolkit.fluxcd.io/namespace: kopiur-system
- spec:
- groups:
- - name: kopiur.rules
- rules:
- - alert: KopiurBackupConsecutiveFailures
- annotations:
- description: "{{ $value }} consecutive backup failures (>=3) for SnapshotPolicy {{ $labels.namespace }}/{{ $labels.name }}."
- summary: "Backups for {{ $labels.namespace }}/{{ $labels.name }} are failing"
- expr: "kopiur_snapshot_consecutive_failures >= 3"
- for: 15m
- labels:
- severity: warning
- - alert: KopiurBackupStale
- annotations:
- description: "Either the last successful backup was over 24h ago, or SnapshotPolicy {{ $labels.namespace }}/{{ $labels.policy }} has never succeeded (or its Succeeded Snapshot CRs were all deleted) and is currently failing."
- summary: "No recent successful backup for {{ $labels.namespace }}/{{ $labels.policy }}"
- expr: |
- (
-
- time() - kopiur_policy_last_backup_success_timestamp_seconds > 86400
- ) or (
-
- label_replace(kopiur_snapshot_consecutive_failures, "policy", "$1", "name", "(.*)") > 0
- unless on (namespace, policy) kopiur_policy_last_backup_success_timestamp_seconds
- )
- for: 30m
- labels:
- severity: warning
- - alert: KopiurRepositoryNotReady
- annotations:
- description: "A kopiur repository has been Degraded/Failed for 15m; backups to it will not run."
- summary: "Repository {{ $labels.namespace }}/{{ $labels.name }} is {{ $labels.phase }}"
- expr: "max by (namespace, name) (kopiur_resource_phase{kind=~\"Repository|ClusterRepository\", phase=~\"Degraded|Failed\"}) == 1"
- for: 15m
- labels:
- severity: critical
- - alert: KopiurSnapshotFailed
- annotations:
- description: "SnapshotPolicy {{ $labels.exported_namespace }}/{{ $labels.policy }} has a Snapshot CR in phase=Failed for 10m."
- summary: "Snapshots for {{ $labels.exported_namespace }}/{{ $labels.policy }} are failing"
- expr: "max by (exported_namespace, policy) (kopiur_resource_phase{kind=\"Snapshot\", phase=\"Failed\"}) == 1"
- for: 10m
- labels:
- severity: warning
- - alert: KopiurRestoreFailed
- annotations:
- description: "A Restore CR has been in phase=Failed for 10m."
- summary: "Restore {{ $labels.namespace }}/{{ $labels.name }} failed"
- expr: "max by (namespace, name) (kopiur_resource_phase{kind=\"Restore\", phase=\"Failed\"}) == 1"
- for: 10m
- labels:
- severity: warning
- - alert: KopiurReconcileErrorsHigh
- annotations:
- description: "kopiur controller is erroring on {{ $labels.kind }} reconciles (>0.2/s over 10m)."
- summary: "High reconcile error rate for {{ $labels.kind }}"
- expr: "sum by (kind) (rate(kopiur_controller_reconcile_errors_total[10m])) > 0.2"
- for: 15m
- labels:
- severity: warning
|
@@ (root level) @@
# monitoring.coreos.com/v1/PrometheusRule/kopiur-system/kopiur-controller
! + one document added:
+ apiVersion: monitoring.coreos.com/v1
+ kind: PrometheusRule
+ metadata:
+ name: kopiur-controller
+ namespace: kopiur-system
+ labels:
+ app.kubernetes.io/component: controller
+ app.kubernetes.io/instance: kopiur
+ app.kubernetes.io/managed-by: Helm
+ app.kubernetes.io/name: kopiur
+ app.kubernetes.io/part-of: kopiur
+ helm.toolkit.fluxcd.io/name: kopiur
+ helm.toolkit.fluxcd.io/namespace: kopiur-system
+ spec:
+ groups:
+ - name: kopiur.rules
+ rules:
+ - alert: KopiurBackupConsecutiveFailures
+ annotations:
+ description: "{{ $value }} consecutive backup failures (>=3) for SnapshotPolicy {{ $labels.namespace }}/{{ $labels.name }}."
+ summary: "Backups for {{ $labels.namespace }}/{{ $labels.name }} are failing"
+ expr: "kopiur_snapshot_consecutive_failures >= 3"
+ for: 15m
+ labels:
+ severity: warning
+ - alert: KopiurBackupStale
+ annotations:
+ description: "Either the last successful backup was over 48h ago, or SnapshotPolicy {{ $labels.namespace }}/{{ $labels.policy }} has never succeeded (or its Succeeded Snapshot CRs were all deleted) and is currently failing."
+ summary: "No recent successful backup for {{ $labels.namespace }}/{{ $labels.policy }}"
+ expr: |
+ (
+ time() - kopiur_policy_last_backup_success_timestamp_seconds > 172800
+ ) or (
+ label_replace(kopiur_snapshot_consecutive_failures, "policy", "$1", "name", "(.*)") > 0
+ unless on (namespace, policy) kopiur_policy_last_backup_success_timestamp_seconds
+ )
+ for: 30m
+ labels:
+ severity: warning
+ - alert: KopiurLastBackupFailed
+ annotations:
+ description: "The most recent completed backup for SnapshotPolicy {{ $labels.namespace }}/{{ $labels.policy }} failed. Resolves automatically once a newer backup succeeds."
+ summary: "Latest backup for {{ $labels.namespace }}/{{ $labels.policy }} failed"
+ expr: "min by (namespace, policy) (kopiur_snapshotpolicy_last_backup_success) == 0"
+ for: 10m
+ labels:
+ severity: warning
+ - alert: KopiurRepositoryNotReady
+ annotations:
+ description: "A kopiur repository has been Degraded/Failed for 15m; backups to it will not run."
+ summary: "Repository {{ $labels.namespace }}/{{ $labels.name }} is {{ $labels.phase }}"
+ expr: "max by (namespace, name) (kopiur_resource_phase{kind=~\"Repository|ClusterRepository\", phase=~\"Degraded|Failed\"}) == 1"
+ for: 15m
+ labels:
+ severity: critical
+ - alert: KopiurSnapshotFailed
+ annotations:
+ description: "Snapshot {{ $labels.namespace }}/{{ $labels.name }} is Failed and its policy has not completed a newer successful backup."
+ summary: "Snapshot {{ $labels.namespace }}/{{ $labels.name }} failed"
+ expr: "max by (namespace, name, policy) (kopiur_resource_phase{kind=\"Snapshot\", phase=\"Failed\"}) == 1 unless on (namespace, policy) (min by (namespace, policy) (kopiur_snapshotpolicy_last_backup_success) == 1)"
+ for: 10m
+ labels:
+ severity: warning
+ - alert: KopiurRestoreFailed
+ annotations:
+ description: "A Restore CR has been in phase=Failed for 10m."
+ summary: "Restore {{ $labels.namespace }}/{{ $labels.name }} failed"
+ expr: "max by (namespace, name) (kopiur_resource_phase{kind=\"Restore\", phase=\"Failed\"}) == 1"
+ for: 10m
+ labels:
+ severity: warning
+ - alert: KopiurReconcileErrorsHigh
+ annotations:
+ description: "kopiur controller is erroring on {{ $labels.kind }} reconciles (>0.2/s over 10m)."
+ summary: "High reconcile error rate for {{ $labels.kind }}"
+ expr: "sum by (kind) (rate(kopiur_controller_reconcile_errors_total[10m])) > 0.2"
+ for: 15m
+ labels:
+ severity: warning
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This lets the upgraded Kopiur chart provide its recovery-aware snapshot alert behavior.
Summary by CodeRabbit
New Features
Bug Fixes