Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,83 @@ resource arohcpAccessClusterSaturationAlerts 'Microsoft.AlertsManagement/prometh
}
}

resource rpUserJourneyClusterUpgradeMonitorRules 'Microsoft.AlertsManagement/prometheusRuleGroups@2023-03-01' = {
name: 'rp-user-journey-cluster-upgrade-monitor-rules'
location: location
properties: {
interval: 'PT1M'
rules: [
{
actions: [
for g in actionGroups: {
actionGroupId: g
actionProperties: {
'IcM.Title': '#$.labels.cluster#: #$.annotations.title#'
'IcM.CorrelationId': '#$.annotations.correlationId#'
}
}
]
alert: 'userJourneyClusterUpgradeStuckInDesired'
enabled: true
labels: {
severity: 'info'
slo: 'cluster-upgrade-reach-partial'
}
annotations: {
correlationId: 'userJourneyClusterUpgradeStuckInDesired/{{ $labels.resource_id }}/{{ $labels.version }}'
description: '''Cluster upgrade target version {{ $labels.version }} has been in desired for over 20 minutes without reaching partial. Partial is when the target version becomes active (recognized as active) on the HCP cluster; the upgrade is in progress but not yet complete. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
'''
info: '''Cluster upgrade target version {{ $labels.version }} has been in desired for over 20 minutes without reaching partial. Partial is when the target version becomes active (recognized as active) on the HCP cluster; the upgrade is in progress but not yet complete. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
'''
runbook_url: 'https://aka.ms/arohcp-runbook-cluster-upgrade'
summary: '[HCPUpgradeStuckInDesired] {{ $labels.resource_id }}'
title: '[HCPUpgradeStuckInDesired] {{ $labels.resource_id }} version:{{ $labels.version }} cluster:{{ $labels.cluster }}'
}
expression: 'hosted_control_plane_upgrade:duration_in_desired:seconds > 1200'
for: 'PT5M'
severity: severityCeiling > 0 ? max(4, severityCeiling) : 4
}
{
actions: [
for g in actionGroups: {
actionGroupId: g
actionProperties: {
'IcM.Title': '#$.labels.cluster#: #$.annotations.title#'
'IcM.CorrelationId': '#$.annotations.correlationId#'
}
}
]
alert: 'userJourneyClusterUpgradeStuckInProgress'
enabled: true
labels: {
severity: 'info'
slo: 'cluster-upgrade-complete'
}
annotations: {
correlationId: 'userJourneyClusterUpgradeStuckInProgress/{{ $labels.resource_id }}/{{ $labels.version }}'
description: '''Cluster upgrade target version {{ $labels.version }} has been in progress for over 30 minutes without reaching completed. Completed is when the target version upgrade has finished and is reported as complete on the HCP cluster. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
'''
info: '''Cluster upgrade target version {{ $labels.version }} has been in progress for over 30 minutes without reaching completed. Completed is when the target version upgrade has finished and is reported as complete on the HCP cluster. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
'''
runbook_url: 'https://aka.ms/arohcp-runbook-cluster-upgrade'
summary: '[HCPUpgradeStuckInProgress] {{ $labels.resource_id }}'
title: '[HCPUpgradeStuckInProgress] {{ $labels.resource_id }} version:{{ $labels.version }} cluster:{{ $labels.cluster }}'
}
expression: 'hosted_control_plane_upgrade:duration_in_progress:seconds > 1800'
for: 'PT5M'
severity: severityCeiling > 0 ? max(4, severityCeiling) : 4
}
]
scopes: [
azureMonitoring
]
}
}

resource arohcpNodepoolSloErrorAlerts 'Microsoft.AlertsManagement/prometheusRuleGroups@2023-03-01' = {
name: 'arohcp_nodepool_slo_error_alerts'
location: location
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,37 @@ resource arohcpAccessClusterSloRecordingRules 'Microsoft.AlertsManagement/promet
]
}
}

resource arohcpUserJourneyClusterUpgradeRecordingRules 'Microsoft.AlertsManagement/prometheusRuleGroups@2023-03-01' = {
name: 'arohcp_user_journey_cluster_upgrade_recording_rules'
location: location
properties: {
scopes: [
azureMonitoring
]
enabled: true
interval: 'PT1M'
rules: [
{
record: 'hosted_control_plane_upgrade:upgrade_eligible:info'
expression: '((count by (cluster, resource_id, subscription_id, cluster_uuid) (count by (cluster, resource_id, subscription_id, cluster_uuid, version) (backend_cluster_version_info == 1)) >= 2) and on (cluster, resource_id) (count by (cluster, resource_id) (backend_cluster_version_info{state="completed"} == 1) >= 1)) * 0 + 1'
}
{
record: 'hosted_control_plane_upgrade:version_state_first_seen:timestamp'
expression: 'min without (prometheus_replica) (min by (cluster, resource_id, subscription_id, cluster_uuid, version, state) ((hosted_control_plane_upgrade:version_state_first_seen:timestamp or (timestamp(backend_cluster_version_info{state=~"desired|partial"} == 1) and on (cluster, resource_id) (hosted_control_plane_upgrade:upgrade_eligible:info == 1))) unless on (cluster, resource_id, subscription_id, cluster_uuid, version) (backend_cluster_version_info{state="completed"} == 1)))'
}
{
record: 'hosted_control_plane_upgrade:in_progress:count'
expression: 'count by (cluster) (count by (cluster, resource_id) ((backend_cluster_version_info{state=~"desired|partial"} == 1 unless on (cluster, resource_id, subscription_id, cluster_uuid, version) backend_cluster_version_info{state="completed"} == 1)) >= 1 and on (cluster, resource_id) (hosted_control_plane_upgrade:upgrade_eligible:info == 1)) or 0 * count by (cluster) (backend_cluster_version_info)'
}
{
record: 'hosted_control_plane_upgrade:duration_in_desired:seconds'
expression: '(time() - hosted_control_plane_upgrade:version_state_first_seen:timestamp{state="desired"}) and on (cluster, resource_id, subscription_id, cluster_uuid, version) ((backend_cluster_version_info{state="desired"} == 1 unless on (cluster, resource_id, subscription_id, cluster_uuid, version) (backend_cluster_version_info{state="partial"} == 1 or backend_cluster_version_info{state="completed"} == 1))) and on (cluster, resource_id) (hosted_control_plane_upgrade:upgrade_eligible:info == 1)'
}
{
record: 'hosted_control_plane_upgrade:duration_in_progress:seconds'
expression: '(sum without (state) ((time() - hosted_control_plane_upgrade:version_state_first_seen:timestamp{state="desired"}) and on (cluster, resource_id) (hosted_control_plane_upgrade:upgrade_eligible:info == 1)) unless on (cluster, resource_id, subscription_id, cluster_uuid, version) (backend_cluster_version_info{state="completed"} == 1)) * on (cluster, resource_id, subscription_id, cluster_uuid, version) group_left (state) (backend_cluster_version_info{state="partial"} == 1 or (backend_cluster_version_info{state="desired"} == 1 unless on (cluster, resource_id, subscription_id, cluster_uuid, version) backend_cluster_version_info{state="partial"} == 1))'
}
]
}
}
1 change: 1 addition & 0 deletions observability/alerts-rp-services.yaml

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Simon has confirmed that's a good lane

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
prometheusRules:
rulesFolders:
- alerts/access-cluster-slo-prometheusRule.yaml
- alerts/userJourneyClusterUpgradeMonitor-prometheusRule.yaml
- alerts/nodepool-slo-prometheusRule.yaml
untestedRules: []
testDependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app.kubernetes.io/name: kube-prometheus
app.kubernetes.io/part-of: kube-prometheus
prometheus: k8s
role: alert-rules
name: user-journey-cluster-upgrade-alerts
namespace: monitoring
spec:
groups:
# Per-upgrade stuck alerts for cluster upgrade SLOs. Sev 4 (info).
# At current upgrade volumes, alert directly on duration instead of fleet burn-rate.
#
# In absence of https://issues.redhat.com/browse/ARO-22686 (reporting of control plane
# version history for versions lower than 4.22), cluster upgrade completeness is directly
# impacted by data plane state — e.g. no worker nodes means the upgrade will not reach
# completed; missing console component in external auth prevents CVO from marking the
# upgrade complete. The complete alert may therefore fire due to missing data plane
# configuration rather than control plane failure. The runbook accommodates this.
- name: rp-user-journey-cluster-upgrade-monitor-rules
rules:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alerts should probably define a for, even if it's brief, all others do.

- alert: userJourneyClusterUpgradeStuckInDesired
expr: |
hosted_control_plane_upgrade:duration_in_desired:seconds > 1200
for: 5m
labels:
severity: info
slo: cluster-upgrade-reach-partial
annotations:
summary: "[HCPUpgradeStuckInDesired] {{ $labels.resource_id }}"
description: |
Cluster upgrade target version {{ $labels.version }} has been in desired for over 20 minutes without reaching partial. Partial is when the target version becomes active (recognized as active) on the HCP cluster; the upgrade is in progress but not yet complete. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
runbook_url: https://aka.ms/arohcp-runbook-cluster-upgrade
correlationId: "userJourneyClusterUpgradeStuckInDesired/{{ $labels.resource_id }}/{{ $labels.version }}"
Comment on lines +36 to +37

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The redirection is there and there is WIP PR being worked on

- alert: userJourneyClusterUpgradeStuckInProgress
Comment on lines +34 to +38
expr: |
hosted_control_plane_upgrade:duration_in_progress:seconds > 1800
for: 5m
labels:
severity: info
slo: cluster-upgrade-complete
annotations:
summary: "[HCPUpgradeStuckInProgress] {{ $labels.resource_id }}"
description: |
Cluster upgrade target version {{ $labels.version }} has been in progress for over 30 minutes without reaching completed. Completed is when the target version upgrade has finished and is reported as complete on the HCP cluster. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: {{ $labels.cluster }}
runbook_url: https://aka.ms/arohcp-runbook-cluster-upgrade
correlationId: "userJourneyClusterUpgradeStuckInProgress/{{ $labels.resource_id }}/{{ $labels.version }}"
Comment on lines +50 to +51
Comment on lines +48 to +51
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
rule_files:
- userJourneyClusterUpgrade-recordingRule.yaml
- userJourneyClusterUpgradeMonitor-prometheusRule.yaml
evaluation_interval: 1m
tests:
# ========================================
# Reach partial: successful — no alert
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.19", state="completed"}'
values: "1+0x40"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.20", state="desired"}'
values: "1x10 0x25"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.20", state="partial"}'
values: "0x10 1x25"
alert_rule_test:
- eval_time: 25m
alertname: userJourneyClusterUpgradeStuckInDesired
exp_alerts: []
- eval_time: 40m
alertname: userJourneyClusterUpgradeStuckInDesired
exp_alerts: []
# ========================================
# Reach partial: stuck in desired >20m — alert fires at SLO breach
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/2/rg/c2", subscription_id="sub-2", cluster_uuid="uuid-2", version="4.19.20", state="completed"}'
values: "1+0x50"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/2/rg/c2", subscription_id="sub-2", cluster_uuid="uuid-2", version="4.19.21", state="desired"}'
values: "1+0x50"
alert_rule_test:
- eval_time: 20m
alertname: userJourneyClusterUpgradeStuckInDesired
exp_alerts: []
- eval_time: 30m
alertname: userJourneyClusterUpgradeStuckInDesired
exp_alerts:
- exp_labels:
alertname: userJourneyClusterUpgradeStuckInDesired
cluster: "svc-1"
cluster_uuid: "uuid-2"
resource_id: "/sub/2/rg/c2"
subscription_id: "sub-2"
version: "4.19.21"
state: "desired"
severity: info
slo: cluster-upgrade-reach-partial
exp_annotations:
summary: "[HCPUpgradeStuckInDesired] /sub/2/rg/c2"
description: |
Cluster upgrade target version 4.19.21 has been in desired for over 20 minutes without reaching partial. Partial is when the target version becomes active (recognized as active) on the HCP cluster; the upgrade is in progress but not yet complete. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: svc-1
runbook_url: "https://aka.ms/arohcp-runbook-cluster-upgrade"
correlationId: "userJourneyClusterUpgradeStuckInDesired//sub/2/rg/c2/4.19.21"
# ========================================
# Reach partial: install only — not upgrade eligible, no alert
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/3/rg/c4", subscription_id="sub-3", cluster_uuid="uuid-4", version="4.19.20", state="desired"}'
values: "1+0x50"
alert_rule_test:
- eval_time: 50m
alertname: userJourneyClusterUpgradeStuckInDesired
exp_alerts: []
# ========================================
# Upgrade complete: successful — no alert
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.19", state="completed"}'
values: "1+0x40"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.20", state="desired"}'
values: "1x10 0x25"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/1/rg/c1", subscription_id="sub-1", cluster_uuid="uuid-1", version="4.19.20", state="completed"}'
values: "0x10 1x25"
alert_rule_test:
- eval_time: 40m
alertname: userJourneyClusterUpgradeStuckInProgress
exp_alerts: []
# ========================================
# Upgrade complete: stuck in progress >30m — alert fires at SLO breach
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/2/rg/c2", subscription_id="sub-2", cluster_uuid="uuid-2", version="4.19.20", state="completed"}'
values: "1+0x50"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/2/rg/c2", subscription_id="sub-2", cluster_uuid="uuid-2", version="4.19.21", state="desired"}'
values: "1x10 0x50"
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/2/rg/c2", subscription_id="sub-2", cluster_uuid="uuid-2", version="4.19.21", state="partial"}'
values: "0x10 1x50"
alert_rule_test:
- eval_time: 30m
alertname: userJourneyClusterUpgradeStuckInProgress
exp_alerts: []
- eval_time: 40m
alertname: userJourneyClusterUpgradeStuckInProgress
exp_alerts:
- exp_labels:
alertname: userJourneyClusterUpgradeStuckInProgress
cluster: "svc-1"
cluster_uuid: "uuid-2"
resource_id: "/sub/2/rg/c2"
subscription_id: "sub-2"
version: "4.19.21"
state: "partial"
severity: info
slo: cluster-upgrade-complete
exp_annotations:
summary: "[HCPUpgradeStuckInProgress] /sub/2/rg/c2"
description: |
Cluster upgrade target version 4.19.21 has been in progress for over 30 minutes without reaching completed. Completed is when the target version upgrade has finished and is reported as complete on the HCP cluster. Investigate backend_cluster_version_info on the affected cluster.
Service Cluster: svc-1
runbook_url: "https://aka.ms/arohcp-runbook-cluster-upgrade"
correlationId: "userJourneyClusterUpgradeStuckInProgress//sub/2/rg/c2/4.19.21"
# ========================================
# Upgrade complete: install only — not upgrade eligible, no alert
# ========================================
- interval: 1m
input_series:
- series: 'backend_cluster_version_info{cluster="svc-1", resource_id="/sub/3/rg/c4", subscription_id="sub-3", cluster_uuid="uuid-4", version="4.19.20", state="desired"}'
values: "1+0x50"
alert_rule_test:
- eval_time: 50m
alertname: userJourneyClusterUpgradeStuckInProgress
exp_alerts: []
Loading