Skip to content
Merged
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 @@ -375,6 +375,85 @@ resource arohcpClusterProvisionSloErrorAlerts 'Microsoft.AlertsManagement/promet
}
}

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: {
component: 'slo'
severity: '4'
slo: 'cluster-upgrade-reach-partial'
}
annotations: {
correlationId: 'userJourneyClusterUpgradeStuckInDesired/{{ $labels.cluster }}{{ $labels.resource_id }}/{{ $labels.version }}'
description: '''Cluster upgrade target version {{ $labels.version }} has been in desired for over 20 minutes without reaching partial. With the alert pending for 5 minutes, paging starts after ~25 minutes. 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. With the alert pending for 5 minutes, paging starts after ~25 minutes. 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: '{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} not progressing'
title: '{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} not progressing'
}
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: {
component: 'slo'
severity: '4'
slo: 'cluster-upgrade-complete'
}
annotations: {
correlationId: 'userJourneyClusterUpgradeStuckInProgress/{{ $labels.cluster }}{{ $labels.resource_id }}/{{ $labels.version }}'
description: '''Cluster upgrade target version {{ $labels.version }} has been in progress for over 30 minutes without reaching completed. With the alert pending for 5 minutes, paging starts after ~35 minutes. 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. With the alert pending for 5 minutes, paging starts after ~35 minutes. 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: '{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} stuck'
title: '{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} stuck'
}
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 @@ -53,3 +53,37 @@ resource arohcpClusterProvisionSloRecordingRules 'Microsoft.AlertsManagement/pro
]
}
}

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) (max by (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) ((max by (cluster, resource_id, subscription_id, cluster_uuid, version, state) (backend_cluster_version_info{state=~"desired|partial"} == 1) unless on (cluster, resource_id, subscription_id, cluster_uuid, version) max by (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) (max by (cluster, resource_id, subscription_id, cluster_uuid, version, state) (backend_cluster_version_info{state="desired"} == 1 unless on (cluster, resource_id, subscription_id, cluster_uuid, version) (max by (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: '((time() - min without (state) (hosted_control_plane_upgrade:version_state_first_seen:timestamp{state=~"desired|partial"})) and on (cluster, resource_id) (hosted_control_plane_upgrade:upgrade_eligible:info == 1) unless on (cluster, resource_id, subscription_id, cluster_uuid, version) (max by (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) (max by (cluster, resource_id, subscription_id, cluster_uuid, version, 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) max by (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
Comment thread
machi1990 marked this conversation as resolved.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ prometheusRules:
rulesFolders:
- alerts/access-cluster-slo-prometheusRule.yaml
- alerts/cluster-provision-slo-prometheusRule.yaml
- alerts/userJourneyClusterUpgradeMonitor-prometheusRule.yaml
Comment thread
machi1990 marked this conversation as resolved.
- alerts/nodepool-slo-prometheusRule.yaml
untestedRules: []
testDependencies:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
apiVersion: monitoring.coreos.com/v1
Comment thread
machi1990 marked this conversation as resolved.
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.
# At current upgrade volumes, alert directly on duration instead of fleet burn-rate.
#
# The ControlPlaneActiveVersion controller derives upgrade Partial/Completed state from
# HostedCluster version history (preferring status.controlPlaneVersion.history, else
# status.version.history), which feeds backend_cluster_version_info and these alerts.
# Control plane version history reports for versions >= 4.20, so completeness tracks the
# control plane independently of the data plane. While 4.19 is still around, those
# clusters fall back to status.version.history, where upgrade completeness depends on
# 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 for 4.19 clusters due to missing
# data plane configuration rather than control plane failure.
- name: rp-user-journey-cluster-upgrade-monitor-rules
rules:
Comment thread
machi1990 marked this conversation as resolved.
- alert: userJourneyClusterUpgradeStuckInDesired
expr: |
hosted_control_plane_upgrade:duration_in_desired:seconds > 1200
for: 5m
labels:
Comment thread
machi1990 marked this conversation as resolved.
severity: "4"
slo: cluster-upgrade-reach-partial
Comment thread
machi1990 marked this conversation as resolved.
component: slo
annotations:
summary: "{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} not progressing"
description: |
Cluster upgrade target version {{ $labels.version }} has been in desired for over 20 minutes without reaching partial. With the alert pending for 5 minutes, paging starts after ~25 minutes. 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.cluster }}{{ $labels.resource_id }}/{{ $labels.version }}"
- alert: userJourneyClusterUpgradeStuckInProgress
expr: |
hosted_control_plane_upgrade:duration_in_progress:seconds > 1800
for: 5m
labels:
Comment thread
machi1990 marked this conversation as resolved.
severity: "4"
slo: cluster-upgrade-complete
component: slo
annotations:
summary: "{{ $labels.cluster }}: Cluster upgrade on {{ $labels.resource_id }} to version {{ $labels.version }} stuck"
description: |
Cluster upgrade target version {{ $labels.version }} has been in progress for over 30 minutes without reaching completed. With the alert pending for 5 minutes, paging starts after ~35 minutes. 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.cluster }}{{ $labels.resource_id }}/{{ $labels.version }}"
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
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 pending for 5m, fires after ~25m
# ========================================
- 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: "4"
slo: cluster-upgrade-reach-partial
component: "slo"
exp_annotations:
summary: "svc-1: Cluster upgrade on /sub/2/rg/c2 to version 4.19.21 not progressing"
description: |
Cluster upgrade target version 4.19.21 has been in desired for over 20 minutes without reaching partial. With the alert pending for 5 minutes, paging starts after ~25 minutes. 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/svc-1/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 pending for 5m, fires after ~35m
# ========================================
- 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: "4"
slo: cluster-upgrade-complete
component: "slo"
exp_annotations:
summary: "svc-1: Cluster upgrade on /sub/2/rg/c2 to version 4.19.21 stuck"
description: |
Cluster upgrade target version 4.19.21 has been in progress for over 30 minutes without reaching completed. With the alert pending for 5 minutes, paging starts after ~35 minutes. 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/svc-1/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