-
Notifications
You must be signed in to change notification settings - Fork 1
alerting/dashbaording: added minimal monitoring setup for the plugin #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
5e5e9a4
added minimal monitoring setup for the plugin enabled basic alert/das…
christophrichtersap 8163bcb
removed not required values-option
christophrichtersap f17462e
replaced alerts and add possibility to enable/disbale
christophrichtersap 4c5e987
added eviction-metric
christophrichtersap File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| # SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and cobaltcore-dev contributors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| name: Validate Prometheus Alerts | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| paths: | ||
| - 'charts/openstack-hypervisor-operator/alerts/*.yaml' | ||
| - 'charts/openstack-hypervisor-operator/alerts/*.yml' | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| env: | ||
| PROMTOOL_VERSION: 3.8.0 | ||
|
|
||
| defaults: | ||
| run: | ||
| shell: bash | ||
|
|
||
| concurrency: | ||
| group: validate-prometheus-alerts-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| validate-alerts: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 5 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
|
||
| - name: Install promtool | ||
| run: | | ||
| set -euo pipefail | ||
| curl -sSfL "https://github.com/prometheus/prometheus/releases/download/v${PROMTOOL_VERSION}/prometheus-${PROMTOOL_VERSION}.linux-amd64.tar.gz" \ | ||
| | tar xz --strip-components=1 "prometheus-${PROMTOOL_VERSION}.linux-amd64/promtool" | ||
| sudo install -m 0755 promtool /usr/local/bin/promtool | ||
| promtool --version | ||
|
|
||
| - name: Validate Prometheus alert rules | ||
| run: | | ||
| set -euo pipefail | ||
| shopt -s nullglob | ||
| files=(charts/openstack-hypervisor-operator/alerts/*.{yaml,yml}) | ||
| if [ ${#files[@]} -eq 0 ]; then | ||
| echo "No Prometheus rule files found." | ||
| exit 1 | ||
| fi | ||
| promtool check rules "${files[@]}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| # SPDX-FileCopyrightText: 2025 SAP SE or an SAP affiliate company and cobaltcore-dev contributors | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| groups: | ||
| - name: hypervisorOperator | ||
| rules: | ||
| - alert: HypervisorNotReady | ||
| expr: | | ||
| kube_customresource_hypervisor_condition{condition="Ready"} == 0 | ||
| for: 10m | ||
| labels: | ||
| severity: critical | ||
| type: hypervisor_operator | ||
| annotations: | ||
| summary: "Hypervisor {{`{{ $labels.name }}`}} is not ready" | ||
| description: "The hypervisor {{`{{ $labels.name }}`}} in zone {{`{{ $labels.zone }}`}} has been in a non-ready state for more than 10 minutes." | ||
|
|
||
| - alert: HypervisorConditionDegraded | ||
| expr: | | ||
| kube_customresource_hypervisor_condition{condition!="Ready"} == 0 | ||
|
fwiesel marked this conversation as resolved.
Outdated
|
||
| for: 10m | ||
| labels: | ||
| severity: warning | ||
| type: hypervisor_operator | ||
| annotations: | ||
| summary: "Hypervisor {{`{{ $labels.name }}`}} condition {{`{{ $labels.condition }}`}} is degraded" | ||
| description: "The hypervisor {{`{{ $labels.name }}`}} in zone {{`{{ $labels.zone }}`}} has condition {{`{{ $labels.condition }}`}} in a False state for more than 10 minutes. Reason: {{`{{ $labels.reason }}`}}." | ||
|
|
||
| - alert: HypervisorEvicted | ||
| expr: | | ||
| kube_customresource_hypervisor_evicted == 1 | ||
| for: 2d | ||
| labels: | ||
| severity: warning | ||
| type: hypervisor_operator | ||
| annotations: | ||
| summary: "Hypervisor {{`{{ $labels.name }}`}} has been evicted" | ||
| description: "The hypervisor {{`{{ $labels.name }}`}} in zone {{`{{ $labels.zone }}`}} has been in an evicted state for more than 2 days." | ||
|
fwiesel marked this conversation as resolved.
Outdated
|
||
|
|
||
| - alert: HypervisorOperatorReconcileErrors | ||
| expr: | | ||
| rate(controller_runtime_reconcile_errors_total[5m]) > 0 | ||
| for: 15m | ||
| labels: | ||
| severity: warning | ||
| type: hypervisor_operator | ||
| annotations: | ||
| summary: "Hypervisor operator controller {{`{{ $labels.controller }}`}} has persistent reconcile errors" | ||
| description: "The controller {{`{{ $labels.controller }}`}} has been producing reconciliation errors for more than 15 minutes." | ||
|
|
||
| - alert: HypervisorOperatorDown | ||
| expr: | | ||
| up{job=~".*hypervisor-operator.*"} == 0 | ||
| for: 5m | ||
| labels: | ||
| severity: critical | ||
| type: hypervisor_operator | ||
| annotations: | ||
| summary: "Hypervisor operator is down" | ||
| description: "The hypervisor operator metrics endpoint has been unreachable for more than 5 minutes." | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.