Skip to content

feat: add Prow CI health alerts - #6474

Open
roi (roivaz) wants to merge 2 commits into
Azure:mainfrom
roivaz:prow-ci-alerts
Open

feat: add Prow CI health alerts#6474
roi (roivaz) wants to merge 2 commits into
Azure:mainfrom
roivaz:prow-ci-alerts

Conversation

@roivaz

@roivaz roi (roivaz) commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Why

ARO-HCP Prow health currently requires manual inspection, which delays detection of persistently failing jobs, degraded regional provision healthchecks, slow e2e runs, stale telemetry, and a blocked Tide merge queue.

This is a follow-up to #6374. There is no separate tracking ticket because these alert thresholds and failure modes were defined during review of that telemetry work.

What

  • Add Azure Monitor alerts for:
    • permafailing high-frequency and scheduled jobs
    • regional provision healthcheck success below 60%
    • e2e-parallel successful-run P95 above 2h30m
    • stale or empty Prow collection and malformed jobs
    • four consecutive Tide batch failures
  • Add prow_ci_job_consecutive_failures because an ordered failure streak cannot be derived from the existing per-run metric series.

Live baseline

Evaluated against the opstool Azure Monitor workspace on 2026-08-10. Only ProwCIScheduledJobPermafailing would fire, for these four periodic cleanup jobs:

  • periodic-ci-azure-aro-hcp-main-periodic-cleanup-delete-expired-integration-resource-groups
  • periodic-ci-azure-aro-hcp-main-periodic-cleanup-delete-expired-prod-00-resource-groups
  • periodic-ci-azure-aro-hcp-main-periodic-cleanup-delete-expired-prod-resource-groups
  • periodic-ci-azure-aro-hcp-main-periodic-cleanup-delete-expired-stage-resource-groups

The regional provision healthcheck is at 91.7% success and e2e-parallel successful-run P95 is 2h26m30s, so neither crosses its threshold. Collection is healthy with 839 cached runs and no malformed jobs in the last hour. The undeployed Tide batch-streak rule is excluded from this live evaluation.

Prow CI alert live baseline on 2026-08-10

Validation

  • go test -race ./pkg/prow/...
  • tenant-quota golangci-lint
  • az bicep build --file tooling/tenant-quota/alerting.bicep
  • live Azure Monitor evaluation of the proposed PromQL expressions

@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@roivaz
roi (roivaz) marked this pull request as ready for review August 10, 2026 13:50
Copilot AI lite review requested due to automatic review settings August 10, 2026 13:50

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

This PR adds Azure Monitor Prometheus alert rules to proactively detect degraded ARO-HCP Prow CI health (persistent job failures, degraded regional provision healthchecks, slow e2e-parallel successful runs, stale/malformed collection, and blocked Tide/batch activity). It also extends the existing Prow metrics collector to export a “consecutive failures” signal needed for a batch-streak alert.

Changes:

  • Export a new prow_ci_job_consecutive_failures metric computed from completed run history.
  • Add a dedicated prow-ci-alerts Prometheus rule group with multiple CI-health alert rules and thresholds.
  • Add unit test coverage validating consecutive-failure ordering behavior.

Reviewed changes

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

File Description
tooling/tenant-quota/pkg/prow/collector.go Adds per-(job_name, job_type) consecutive failure streak metric emitted by the Prow collector.
tooling/tenant-quota/pkg/prow/collector_test.go Adds unit test validating failure streak calculation uses completion time ordering.
tooling/tenant-quota/alerting.bicep Introduces prow-ci-alerts Prometheus rule group with CI health alerts (permafailing, healthcheck rate, duration P95, stale collection, invalid jobs, batch streak).

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tooling/tenant-quota/pkg/prow/collector.go
Copilot AI review requested due to automatic review settings August 10, 2026 14:08
roi (roivaz) and others added 2 commits August 10, 2026 16:11
Derive per-job failure streaks from completion-ordered cached runs so Tide batch queue blockage can be alerted without per-build timestamp metrics.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Alert on permafailing jobs, regional healthcheck success, e2e duration, stale or malformed collection data, empty caches, and blocked Tide merge queues.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tooling/tenant-quota/pkg/prow/collector.go:256

  • The tie-breaker in the consecutive-failures sort compares buildID lexicographically. If two runs have the same completionAt (possible at second-level timestamp resolution), lexicographic ordering can misorder numeric build IDs (e.g., "9" sorts after "10"), which can produce an incorrect failure streak.

Consider using a numeric-string ordering for buildID (length then lexicographic) to keep the ordering consistent with numeric build IDs without needing per-compare parsing.

		slices.SortFunc(jobRuns, func(a, b runMetrics) int {
			if order := b.completionAt.Compare(a.completionAt); order != 0 {
				return order
			}
			return strings.Compare(b.buildID, a.buildID)
		})

Copilot AI review requested due to automatic review settings August 10, 2026 14:13

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 3 out of 3 changed files in this pull request and generated no new comments.

Suppressed comments (1)

tooling/tenant-quota/pkg/prow/collector.go:256

  • The tie-breaker in the sort for consecutive failure streaks uses strings.Compare on buildID. Prow build IDs are typically numeric strings, and lexicographic ordering can be wrong when lengths differ (e.g., "9" sorts after "10"), which can misorder runs that share the same completionAt timestamp and produce an incorrect consecutive-failure count.
		slices.SortFunc(jobRuns, func(a, b runMetrics) int {
			if order := b.completionAt.Compare(a.completionAt); order != 0 {
				return order
			}
			return strings.Compare(b.buildID, a.buildID)

@roivaz

Copy link
Copy Markdown
Collaborator Author

/retest

@hbhushan3

Copy link
Copy Markdown
Collaborator

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hbhushan3, roivaz

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

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.

3 participants