Merge "Add alert rules when OpenStack services are down" into main

This commit is contained in:
Zuul 2024-07-19 03:51:15 +00:00 committed by Gerrit Code Review
commit f9deb89be3
2 changed files with 25 additions and 1 deletions

View File

@ -42,6 +42,15 @@ The charm by default uses following images:
`ghcr.io/canonical/openstack-exporter:1.6.0-7533071`
## Alerting Rules
This charm automatically adds Prometheus alert rules using the files at
`src/prometheus_alert_rules` when related with `grafana-agent`.
The following alerts are configured by default:
- `OpenStackServicesDown`: This alert rule will trigger when an OpenStack service is down. The
exporter generates metrics that identify if services are up. E.g.: openstack_loadbalancer_up,
openstack_designate_up. Individual alerts will appear if one of those services has problems.
## Contributing
Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines
@ -58,4 +67,3 @@ Please report bugs on [Launchpad][lp-bugs-charm-openstack-exporter-k8s].
[juju-docs-actions]: https://jaas.ai/docs/actions
[juju-docs-config-apps]: https://juju.is/docs/configuring-applications
[lp-bugs-charm-openstack-exporter-k8s]: https://bugs.launchpad.net/charm-openstack-exporter-k8s/+filebug

View File

@ -0,0 +1,16 @@
groups:
- name: OpenStackServices
rules:
- alert: OpenStackServicesDown
expr: |
sum by(service) (
label_replace({__name__=~"openstack_(.+)_up"}, "service", "$1", "__name__", "openstack_(.+)_up")
) == 0
for: 5m
labels:
severity: critical
service: "{{ $labels.service }}"
annotations:
summary: OpenStack Services Down
description: |
The OpenStack service {{ $labels.service }} is down