Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 32 additions & 19 deletions .github/workflows/check-alerts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,45 @@ name: Check Alerts using Promtool
on:
pull_request:
paths:
- '**/*.rules.yaml'
- '**/*.alerts.yaml'
- 'helm/bundles/*/templates/alerts.yaml'
- 'helm/bundles/*/values.yaml'
- 'helm/bundles/*/Chart.yaml'
- 'helm/library/**'
- '.github/workflows/check-alerts.yaml'

jobs:
lint:
runs-on: ubuntu-latest
# Pinned to ubuntu-24.04 so the pre-installed helm and yq versions are
# stable. helm and yq come from the base runner image (no install step
# needed); promtool is installed by the peimanja action below.
runs-on: ubuntu-24.04
steps:
- name: Checkout PR
uses: actions/checkout@v6
- uses: actions/checkout@v6

- name: Get changed rule and alert files
id: changed
uses: tj-actions/changed-files@v47
with:
files: |
**/*.rules.yaml
**/*.alerts.yaml
- name: Render bundles to rule files
run: |
set -euo pipefail
mkdir -p rendered

helm dep update helm/bundles/cortex-cinder
helm dep update helm/bundles/cortex-manila
helm dep update helm/bundles/cortex-nova
helm dep update helm/bundles/cortex-placement-shim

helm template cortex-cinder helm/bundles/cortex-cinder | yq 'select(.kind == "PrometheusRule") | .spec' > rendered/cortex-cinder.yaml
helm template cortex-manila helm/bundles/cortex-manila | yq 'select(.kind == "PrometheusRule") | .spec' > rendered/cortex-manila.yaml
helm template cortex-placement-shim helm/bundles/cortex-placement-shim | yq 'select(.kind == "PrometheusRule") | .spec' > rendered/cortex-placement-shim.yaml

# nova has KVM-gated rules; render both flavours.
helm template cortex-nova helm/bundles/cortex-nova | yq 'select(.kind == "PrometheusRule") | .spec' > rendered/cortex-nova-default.yaml
helm template cortex-nova helm/bundles/cortex-nova --set kvm.enabled=true | yq 'select(.kind == "PrometheusRule") | .spec' > rendered/cortex-nova-kvm.yaml

- name: Install Helm
uses: azure/setup-helm@v5
ls -la rendered/

- name: Check changed rule and alert files via promtool
if: steps.changed.outputs.any_changed == 'true'
uses: peimanja/promtool-github-actions@v0.0.2
- name: Check rules with promtool
uses: peimanja/promtool-github-actions@741be6fd6b8ee6a1d777ea020076b70c6233b3a1 # v0.0.2
with:
promtool_actions_subcommand: 'rules'
promtool_actions_files: ${{ steps.changed.outputs.all_changed_files }}
promtool_actions_files: 'rendered/*.yaml'
promtool_actions_version: 'latest'
promtool_actions_comment: 'false'
promtool_actions_comment: 'false'
2 changes: 1 addition & 1 deletion docs/reservations/committed-resource-reservations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ The CR reservation implementation is located in `internal/scheduling/reservation
- Scheduling pipeline selection per flavor group
- Per-flavor-group resource flags (`handlesCommitments`, `hasCapacity`, `hasQuota`) controlling which resource types are active for each group

**Metrics and Alerts**: Defined in `helm/bundles/cortex-nova/alerts/nova.alerts.yaml` with prefixes:
**Metrics and Alerts**: Defined in `helm/bundles/cortex-nova/templates/alerts.yaml` with prefixes:
- `cortex_committed_resource_change_api_*`
- `cortex_committed_resource_usage_api_*`
- `cortex_committed_resource_capacity_api_*`
Expand Down
260 changes: 0 additions & 260 deletions helm/bundles/cortex-cinder/alerts/cinder.alerts.yaml

This file was deleted.

Loading