Skip to content

Restore custom KubeVirt PrometheusRule alerts loader #2503

Closed

Description

What happened

After #2502 (KubeVirt operator update to v1.8.2), the cozystack-specific PrometheusRule alerts are no longer rendered.

packages/system/kubevirt-operator/templates/alerts.yaml was the glob loader:

{{ $files := .Files.Glob "alerts/*.yaml" }}
{{ range $path, $bytes := $files }}
...

It was removed in #2502. The data file packages/system/kubevirt-operator/alerts/PrometheusRule.yaml is still in the tree but no template references it now.

What's lost

Two alerts maintained in this repo across multiple commits:

  • VMNotRunningFor10Minutes
  • VMINotRunningFor10Minutes

Verified via helm template packages/system/kubevirt-operator:

The upstream operator does not generate equivalents — checked pkg/monitoring/rules/alerts/vms.go at v1.8.2; the rules package emits VirtLauncherPodsStuckFailed, OrphanedVirtualMachineInstances, etc., but neither of the two cozystack alerts.

Suggested fix

Either:

  1. Restore templates/alerts.yaml (the 7-line glob loader). Smallest possible change.
  2. Move alerts/PrometheusRule.yaml directly under templates/ so it renders without a glob loader, and git rm the empty alerts/ directory.

If dropping the alerts is intentional (e.g., they were considered noisy), please close this with a note and git rm the orphaned alerts/PrometheusRule.yaml so the repo stays consistent.

Note

ServiceMonitor removal in the same PR is fine — the operator creates an equivalent in tenant-root because the cozystack KubeVirt CR sets monitorNamespace: tenant-root.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    priority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next release
    area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)
    kind/regressionCategorizes issue or PR as related to a regression from a prior release
    area/monitoringIssues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor)
    triage/acceptedIndicates an issue is ready to be actively worked on
    on Apr 27, 2026
  2. dosubot commented on Jul 27, 2026

    @dosubot

    Hi, Aleksei Sviridkin (@lexfrei). I'm Dosu, and I'm helping the cozystack team manage their backlog and am marking this issue as stale.

    Recap

    • After the KubeVirt operator was updated to v1.8.2, the cozystack-specific PrometheusRule alerts stopped being rendered.
    • The template loader that previously globbed alerts/*.yaml appears to have been removed.
    • As a result, the maintained alerts VMNotRunningFor10Minutes and VMINotRunningFor10Minutes are no longer generated.
    • The issue asks to restore the loader or otherwise ensure alerts/PrometheusRule.yaml is rendered unless these alerts are intentionally being dropped.

    Next Steps

    • Please confirm whether this is still relevant on the latest version of the cozystack repository.
    • If it is still relevant, you can keep the discussion open by commenting here; otherwise, this issue will be automatically closed in 7 days.

    Thanks for your understanding and contribution.

  3. added
    lifecycle/staleDenotes an issue or PR has remained open with no activity and has become stale
    and removed on Aug 3, 2026
  4. lexfrei commented on Sep 2, 2026

    @lexfrei
    ContributorAuthor

    Fixed by 7106f07: the PrometheusRule is a Helm-rendered template now, packages/system/kubevirt-operator/templates/prometheusrule.yaml renders both VMNotRunningFor10Minutes and VMINotRunningFor10Minutes, and the alerts/ directory is gone. Closing.

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

Metadata

Metadata

Assignees

Labels

area/monitoringIssues or PRs related to the monitoring stack (vlogs, vmstack, grafana, workloadmonitor)area/virtualizationIssues or PRs related to virtualization (kubevirt, cdi, vmi, vm-import)kind/bugCategorizes issue or PR as related to a bugkind/regressionCategorizes issue or PR as related to a regression from a prior releaselifecycle/staleDenotes an issue or PR has remained open with no activity and has become stalepriority/important-soonMust be staffed and worked on either currently, or very soon, ideally in time for the next releasetriage/acceptedIndicates an issue is ready to be actively worked on

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions