Skip to content

backend: add alerting for stuck async operations#5952

Open
stevekuznetsov wants to merge 1 commit into
Azure:mainfrom
stevekuznetsov:skuznets/alert-async-operations
Open

backend: add alerting for stuck async operations#5952
stevekuznetsov wants to merge 1 commit into
Azure:mainfrom
stevekuznetsov:skuznets/alert-async-operations

Conversation

@stevekuznetsov

Copy link
Copy Markdown
Contributor

We have end-to-end test assertions that our async operations never take longer than $timeout. We have seen a few cases where customer interactions with the ARM API ended up stuck, and had no visibility into this, even though our end-to-end test suite, had it run on that region at that time, would have clearly caught this.

This new set of alerts is an assertion from the backend that async operations never spend more than a certain amount of time in a particular phase. We still benefit from having our async operations not having a clear timeout in the backend, as fixing the underlying problem will cause them to get un-stuck and finish, but we want to know if we're failing to progress.

Existing SLO alerting is for failed/terminal phases of async operations, which do not trigger for 'stuck' operations which never exit 'progressing.'

Copilot AI review requested due to automatic review settings July 7, 2026 14:35
@openshift-ci openshift-ci Bot requested review from geoberle and janboll July 7, 2026 14:36
@openshift-ci openshift-ci Bot added the approved label Jul 7, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds backend-driven alerting for async operations that appear “stuck” in non-terminal phases, complementing existing SLO/terminal-phase alerting and improving visibility when operations don’t make progress.

Changes:

  • Registers a new backend async-operations PrometheusRule file in the shared service alert bundle.
  • Introduces backend async-operation “stuck” alert rules (plus promtool tests) for cluster, node pool, credential, and external auth operations.
  • Regenerates the Azure Monitor Prometheus rule-group Bicep output to deploy the new alerts.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
observability/alerts-sl-services.yaml Adds the new backend async-operations PrometheusRule YAML to the shared alert set.
dev-infrastructure/modules/metrics/rules/generatedPrometheusAlertingRules.bicep Generated Azure Monitor rule group for the new backend async-operation stuck alerts.
backend/alerts/backend-async-operations-prometheusRule.yaml Defines the new stuck-operation alert rules and alert metadata.
backend/alerts/backend-async-operations-prometheusRule_test.yaml Adds promtool tests validating the new alert rules.

Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml
Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml Outdated
Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml
Comment thread backend/alerts/backend-async-operations-prometheusRule_test.yaml

@machi1990 machi1990 left a comment

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.

lgtm, intentionally not tagging it to give a member of SL team to see if the wiring is done correctly and wether the missing runbook is going to be a problem.

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

Will rebase on #5955

@SudoBrendan SudoBrendan left a comment

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.

Thanks for getting this Steve - been on my list of top alerts for a while; lots of value here.

Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml Outdated
Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml Outdated
summary: 'Node pool create operation stuck'
description: 'Node pool create operation for {{ $labels.resource_id }} has been in {{ $labels.phase }} phase for over 20 minutes (e2e timeout: NodePoolCreationTimeout).'
runbook_url: TBD
# Node pool update: e2e timeout = 45 minutes (NodePoolVersionUpgradeTimeout)

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.

You pulled this straight from the test case, but I wonder if that test itself is wrong and conflating various kinds of "update", maybe it was from the before-times when we hadn't decided to fire-and-forget on OCP version upgrades? As I understand from a backend Operation perspective, the actual LRO should go basically from Accepted -> Succeeded/Failed immediately on an OCP upgrade, right? We should maybe consider a shorter timeout, so that when customers bump their autoscale max from 8 -> 9 and that gets locked it doesn't take 45m to fire (here, and in the test, honestly)

However... while investigating this - I did discover that there are some LROs that we could expect to go longer than 45m or even an hour - internal discussion here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, if/when we change the e2e, we can change this - and you're 100% right that there are possible updates that could take a long time. If and unless we update the metric to classify the 'type' of update LRO, we can't subdivide. Time will tell if it is meaningful or not.

Copilot AI review requested due to automatic review settings July 10, 2026 19:25
@stevekuznetsov stevekuznetsov force-pushed the skuznets/alert-async-operations branch from c85f794 to 6a0b4a6 Compare July 10, 2026 19:25
@bennerv

bennerv commented Jul 10, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bennerv, stevekuznetsov

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment thread backend/alerts/backend-async-operations-prometheusRule.yaml
Comment thread backend/alerts/backend-async-operations-prometheusRule_test.yaml
We have end-to-end test assertions that our async operations never take
longer than $timeout. We have seen a few cases where customer
interactions with the ARM API ended up stuck, and had no visibility into
this, even though our end-to-end test suite, had it run on that region
at that time, would have clearly caught this.

This new set of alerts is an assertion from the backend that async
operations never spend more than a certain amount of time in a
particular phase. We still benefit from having our async operations not
having a clear timeout in the backend, as fixing the underlying problem
will cause them to get un-stuck and finish, but we want to know if
we're failing to progress.

Existing SLO alerting is for failed/terminal phases of async operations,
which do not trigger for 'stuck' operations which never exit
'progressing.'

Signed-off-by: Steve Kuznetsov <stekuznetsov@microsoft.com>
@stevekuznetsov stevekuznetsov force-pushed the skuznets/alert-async-operations branch from 6a0b4a6 to ab53a97 Compare July 11, 2026 02:51
Copilot AI review requested due to automatic review settings July 11, 2026 02:51
@openshift-ci

openshift-ci Bot commented Jul 11, 2026

Copy link
Copy Markdown

New changes are detected. LGTM label has been removed.

@openshift-ci openshift-ci Bot removed the lgtm label Jul 11, 2026
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

/label lgtm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

Comment on lines +16 to +18
# These alerts fire when an async operation has been running longer than
# the corresponding e2e test timeout. Thresholds are anchored to the
# canonical timeout constants in test/util/framework/constants.go.
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 2776c19 and 2 for PR HEAD ab53a97 in total

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

/retest

1 similar comment
@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

/retest

@stevekuznetsov

Copy link
Copy Markdown
Contributor Author

/test all

2 similar comments
@deepsm007

Copy link
Copy Markdown

/test all

@deepsm007

Copy link
Copy Markdown

/test all

@openshift-ci

openshift-ci Bot commented Jul 11, 2026

Copy link
Copy Markdown

@stevekuznetsov: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/periodic-healthcheck-images ab53a97 link true /test periodic-healthcheck-images
ci/prow/e2e-parallel ab53a97 link true /test e2e-parallel
ci/prow/image-updater-images ab53a97 link true /test image-updater-images

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants