← Back to Pull requests

[Backport v1.32] [CONTP-2261] Make health controller more reliable: reduce flapping and avoid false resolution of issues #3698

Closed
unknown closed this pull request without merging on Nov 02, 2026 14:09 UTC
View on GitHub
unknown unknown commented on Oct 30, 2026 14:53 UTC
Author

Backport 130789d89ea6f722b397551aecfbe3a33403d4e4 from #3690.

___

What does this PR do?

Makes the health component controller more reliable by avoiding emitting resolution signal to the backend too early, avoiding issues flapping (Active -> Resolved -> Active -> Resolved ...).

This happens particularly in cases such as container being killed due to OOM, and keeps restarting, resolving the issue, and then OOM'ing after a few seconds.

After this change, an issue is RESOLVED only after it has never been detected as active during 5 minutes.

Log levels have been adjusted as well to avoid noisy logs in case of flapping.

Additional Notes

This stops flapping snapshotting, not flapping internal state. In other words, the controller still sees and logs flapping states, but snapshots stable states only.

Describe your test plan

Use this spec:

spec:
  features:
    clusterChecks:
      enabled: true
      useClusterChecksRunners: true
  global:
    clusterName: qa-3536
    credentials:
      apiKey: "00000000000000000000000000000000"
      appKey: "0000000000000000000000000000000000000000"
    kubelet:
      tlsVerify: false
  override:
    clusterAgent:
      image:
        name: gcr.io/datadoghq/cluster-agent
        tag: this-tag-does-not-exist-qa3536
    clusterChecksRunner:
      containers:
        agent:
          resources:
            limits:

Before the fix, there was false RESOLVE signals emitted:

21:15:21.049 detected cluster-checks-runner component_oomkilled
21:15:29.678 detected cluster-checks-runner component_crash_looping
21:15:40.106 resolved cluster-checks-runner component_oomkilled
21:15:40.106 resolved cluster-checks-runner component_crash_looping
21:15:41.104 detected cluster-checks-runner component_oomkilled
21:15:44.677 detected cluster-checks-runner component_crash_looping
21:16:13     resolved cluster-checks-runner component_oomkilled
21:16:13     resolved cluster-checks-runner component_crash_looping
21:16:14     detected cluster-checks-runner component_oomkilled
21:16:15     detected cluster-checks-runner component_crash_looping
21:17:03     resolved cluster-checks-runner component_crash_looping
21:17:07     SNAPSHOT active 2 resolved: [('cluster-checks-runner', 'component_crash_looping')]
21:17:13     detected cluster-checks-runner component_crash_looping

After this change, this should stop happening, it should become stable:


12:31:03.848  detected  cluster-agent image_pull_failure
12:31:05.893  detected  cluster-checks-runner component_oomkilled
12:31:07.865  detected  cluster-checks-runner component_crash_looping
12:31:10.772  SNAPSHOT active 3 resolved: []
12:31:20.768  SNAPSHOT active 3 resolved: []
12:31:29.900  resolved  cluster-checks-runner component_crash_looping
12:31:30.767  SNAPSHOT active 2 resolved: []          <- tick landed in the blip; pre-fix this emitted a false RESOLVE
12:31:30.911  detected  cluster-checks-runner component_crash_looping
12:31:40.768  SNAPSHOT active 3 resolved: []
12:31:58.815  resolved  cluster-checks-runner component_crash_looping
12:31:59.821  detected  cluster-checks-runner component_crash_looping
12:32:53.495  resolved  cluster-checks-runner component_crash_looping
12:32:58.986  detected  cluster-checks-runner component_crash_looping
...
12:34:13.156  resolved  cluster-checks-runner component_cras
12:34:14.169  detected  cluster-checks-runner component_crash_looping   <- still flapping internally
12:34:15.773  resolved  cluster-checks-runner component_oomkcovery (pods healthy)
12:34:15.773  resolved  cluster-checks-runner component_crash_looping
12:34:20.762  SNAPSHOT active 0 resolved: []          <- res
   ... (held quiet 12:34:20 → 12:39:10, ~5 min) ...
12:39:20.758  SNAPSHOT active 0 resolved: [('cluster-agent',luster-checks-runner','component_crash_looping'),('cluster-checks-runner','component_oomkilled')]   <- emitted ONCE
12:39:30.758  SNAPSHOT active 0 resolved: []          <- qui

Checklist

  • PR has at least one valid label: bug, enhancement, refactoring, documentation, tooling, and/or dependencies

  • PR has a milestone or the qa/skip-qa label

  • All commits are signed (see: [signing commits][1])
  • [1]: https://docs.github.com/en/authentication/managing-commit-signature-verification/signing-commits

    Diff: 565 lines (+423 / -142) across 7 files Reviewer: adel121 Review duration: 4275m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 565 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.379
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #3698"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.7% (MEDIUM) · Higher = larger blast radius
    49.7%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.6% · Safe to merge
    19.6%