Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROX-18766: Central Instance Limit Alert #278

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions resources/prometheus/prometheus-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,16 @@ spec:
annotations:
summary: "Certificate expiring very soon: `{{ $labels.exported_namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}`."
description: "Certificate `{{ $labels.exported_namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}` expires on {{ humanizeTimestamp $value}}."
- alert: CentralInstanceLimitCriticalCapacity
expr: |
acs_fleet_manager_cluster_status_capacity_max-acs_fleet_manager_cluster_status_capacity_used<=2
aaa5kameric marked this conversation as resolved.
Show resolved Hide resolved
for: 5m
labels:
severity: critical
annotations:
summary: "Cluster ID: '{{ $labels.clusterID }}' is at a critical instance limit."
description: "Cluster '{{ $labels.clusterID }}' has '{{ $value }}' instances left before reaching limit"
aaa5kameric marked this conversation as resolved.
Show resolved Hide resolved
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-cloud-service/runbooks/-/blob/master/sops/dp-031-central-instance-limit-reached.md"
- alert: RHACSFleetshardCertificateExpiryWarning
expr: |
acs_fleetshard_certificate_expiration_timestamp <= 7* 24 * 60 * 60 + time()
Expand All @@ -144,6 +154,16 @@ spec:
annotations:
summary: "Certificate expiring soon: `{{ $labels.exported_namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}`."
description: "Certificate `{{ $labels.exported_namespace }}/{{ $labels.secret }}/{{ $labels.data_key }}` expires on {{ humanizeTimestamp $value}}."
- alert: CentralInstanceLimitWarningCapacity
expr: |
acs_fleet_manager_cluster_status_capacity_max-acs_fleet_manager_cluster_status_capacity_used<=10
aaa5kameric marked this conversation as resolved.
Show resolved Hide resolved
for: 5m
labels:
severity: warning
annotations:
summary: "Cluster ID: '{{ $labels.clusterID }}' is reaching its instance limit."
description: "Cluster '{{ $labels.clusterID }}' has '{{ $value }}' instances left before reaching limit"
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-cloud-service/runbooks/-/blob/master/sops/dp-031-central-instance-limit-reached.md"
- alert: RHACSFleetshardSyncReconciliationErrors
expr: |
acs_fleetshard_central_errors_per_reconciliations:ratio_rate10m > 0.10
Expand Down
48 changes: 48 additions & 0 deletions resources/prometheus/unit_tests/CentralInstanceLimit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
rule_files:
- /tmp/prometheus-rules-test.yaml


evaluation_interval: 1m


tests:
- interval: 15s
input_series:
- series: acs_fleet_manager_cluster_status_capacity_max{clusterID="cluster1"}
values: 10 #critical
- series: acs_fleet_manager_cluster_status_capacity_used{clusterID="cluster1"}
values: 8 #critical
- series: acs_fleet_manager_cluster_status_capacity_max{clusterID="cluster-2"}
values: 15 #warning
- series: acs_fleet_manager_cluster_status_capacity_used{clusterID="cluster-2"}
values: 5 #warning
alert_rule_test:
- eval_time: 5m
alertname: CentralInstanceLimitCriticalCapacity
exp_alerts:
- exp_labels:
alertname: CentralInstanceLimitCriticalCapacity
clusterID: cluster1
severity: critical
exp_annotations:
summary: "Cluster ID: 'cluster1' is at a critical instance limit."
description: "Cluster 'cluster1' has '2' instances left before reaching limit"
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-cloud-service/runbooks/-/blob/master/sops/dp-031-central-instance-limit-reached.md"
- interval: 15s
input_series:
- series: acs_fleet_manager_cluster_status_capacity_max{clusterID="cluster-2"}
values: 15 #warning
- series: acs_fleet_manager_cluster_status_capacity_used{clusterID="cluster-2"}
values: 5 #warning
alert_rule_test:
- eval_time: 5m
alertname: CentralInstanceLimitWarningCapacity
exp_alerts:
- exp_labels:
alertname: CentralInstanceLimitWarningCapacity
clusterID: cluster-2
severity: warning
exp_annotations:
summary: "Cluster ID: 'cluster-2' is reaching its instance limit."
description: "Cluster 'cluster-2' has '10' instances left before reaching limit"
sop_url: "https://gitlab.cee.redhat.com/stackrox/acs-cloud-service/runbooks/-/blob/master/sops/dp-031-central-instance-limit-reached.md"
Loading