Skip to content

[DX-5514] recovering state - #2858

Merged
Tofel merged 4 commits into
mainfrom
dx-5514-recovering-state
Oct 6, 2026
Merged

Tofel merged 4 commits into
mainfrom
dx-5514-recovering-state

Conversation

@Tofel

@Tofel Tofel commented Oct 5, 2026

Copy link
Copy Markdown
Contributor

Handle Recovering state so that we don't fail with:

collect evidence after 2 poll(s): poll rule "[Dev]Griddle App Test Service No Heartbeat" (cfx5gk8k0wqv4c): gave up after 6 sequential failures: transport error: parse rule state: state response: group "one-minute" (folder "devex-cicd"): rule 0: rule "cfx5gk8k0wqv4c": instance 0: unrecognized instance state "Recovering (NoData)" 

Copilot AI balanced review requested due to automatic review settings October 5, 2026 15:14
@Tofel
Tofel requested a review from a team as a code owner October 5, 2026 15:14
@github-actions

github-actions Bot commented Oct 5, 2026

Copy link
Copy Markdown

👋 Tofel, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions

github-actions Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

📊 API Diff Results

No changes detected for module github.com/smartcontractkit/chainlink-testing-framework/grafana-alertcheck

View full report

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.

Copilot review overview

🟡 Changes recommended

Recovery handling can incorrectly pass failures or skip necessary observation.

Review effort: Balanced
Findings: 4 High severity

Open (4)
What changed in this PR

Adds Grafana Recovering-state support to alert checking, including observation beyond the normal window.

Changes:

  • Parses Recovering states and records recovery durations.
  • Adds recovery observation and classification logic with tests.
  • Updates CLI defaults, documentation, and release notes.
File Description
grafana-alertcheck/​internal/​gate/​parse_state.go Parses Recovering and recovery durations.
grafana-alertcheck/​internal/​gate/​parse_state_test.go Tests parsing additions.
grafana-alertcheck/​internal/​gate/​log.go Records recovery durations per poll.
grafana-alertcheck/​internal/​gate/​coverage.go Shares window-membership helpers.
grafana-alertcheck/​internal/​gate/​classify.go Classifies recovery episodes and extension evidence.
grafana-alertcheck/​internal/​gate/​classify_test.go Tests recovery classification.
grafana-alertcheck/​internal/​gate/​check.go Adds bounded recovery observation.
grafana-alertcheck/​internal/​gate/​check_test.go Tests direct and recorded recovery observation.
grafana-alertcheck/​docs/​reference/​cli.md Documents updated state options.
grafana-alertcheck/​docs/​how-alerts-are-evaluated.md Explains recovery behavior and timing.
grafana-alertcheck/​cmd/​common.go Accepts recovering in state selection.
grafana-alertcheck/​cmd/​check.go Updates default-state help text.
grafana-alertcheck/​.changeset/​v0.1.9.md Announces Recovering support.

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

Comment thread grafana-alertcheck/internal/gate/check.go Outdated
Comment thread grafana-alertcheck/internal/gate/check.go Outdated
Comment thread grafana-alertcheck/internal/gate/classify.go
Comment thread grafana-alertcheck/internal/gate/classify.go
@Tofel
Tofel requested a balanced review from Copilot October 6, 2026 09:45

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.

Copilot review overview

🟡 Changes recommended

Recovery observation can lose timely clears during draining, and stale clock calculations can exceed recovery deadlines.

Review effort: Balanced
Findings: 3 High severity · 1 Medium severity

Open (4)
Resolved since last review (2)

Comment thread grafana-alertcheck/internal/gate/check.go
Comment thread grafana-alertcheck/internal/gate/check.go
@Tofel
Tofel requested a balanced review from Copilot October 6, 2026 10:16

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.

Copilot review overview

🟡 Changes recommended

Recovery classification can forgive in-window failures after interval changes, and recovery polling can amplify requests beyond the planned budget.

Review effort: Balanced
Findings: 1 High severity

Open (1)
Resolved since last review (4)
Previously missed (1)

In code that hasn't changed since last review

Medium severity Single-step mode over-polls slow recovery rules

grafana-alertcheck/​internal/​gate/​check.go:1047

In single-step mode, each iteration sends every pending UID to directRecoverySource, then waits only for the shortest rule cadence. With recovering rules evaluating every 10s and 300s, the slow rules are requested roughly every 5s instead of every 150s (assuming short requests). During a long recovery period, this multiplies Grafana requests and queues fast rules behind work that the startup per-rule budget did not account for. Track per-rule due times and pass only due UIDs to the direct source; log-tail reads can keep a shared cadence. Add coverage for mixed evaluation intervals.

Comment thread grafana-alertcheck/internal/gate/classify.go
@Tofel
Tofel merged commit 8ce883e into main Oct 6, 2026
63 checks passed
@Tofel
Tofel deleted the dx-5514-recovering-state branch October 6, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants