From 48460fd3d337465db46aeb0200048030cd19cc92 Mon Sep 17 00:00:00 2001 From: Xuhui Zhu Date: Wed, 10 Jul 2024 17:17:00 -0400 Subject: [PATCH] Add alert rules when neutron agents are down This alert rule triggers when a Neutron agent is down. The exporter generates the metric openstack_neutron_agent_state, which checks the status of neutron agents. Alerts will appear if any neutron agent is found to be down. Change-Id: I56deeec3df8197eece0350bcc369e46956e5230f --- charms/openstack-exporter-k8s/README.md | 4 ++++ .../src/prometheus_alert_rules/neutron_rules.yaml | 13 +++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 charms/openstack-exporter-k8s/src/prometheus_alert_rules/neutron_rules.yaml diff --git a/charms/openstack-exporter-k8s/README.md b/charms/openstack-exporter-k8s/README.md index 5308931b..2ecfb6d5 100644 --- a/charms/openstack-exporter-k8s/README.md +++ b/charms/openstack-exporter-k8s/README.md @@ -47,6 +47,10 @@ 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: +- `NeutronStateCritical`: This alert rule triggers when a Neutron agent is enabled, but down. +The exporter generates the metric openstack_neutron_agent_state, which checks the status +of neutron agents. Alerts will appear if any neutron agent is found to be down. + - `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. diff --git a/charms/openstack-exporter-k8s/src/prometheus_alert_rules/neutron_rules.yaml b/charms/openstack-exporter-k8s/src/prometheus_alert_rules/neutron_rules.yaml new file mode 100644 index 00000000..9517cb4a --- /dev/null +++ b/charms/openstack-exporter-k8s/src/prometheus_alert_rules/neutron_rules.yaml @@ -0,0 +1,13 @@ +groups: +- name: Neutron + rules: + - alert: NeutronStateCritical + expr: openstack_neutron_agent_state{adminState="up"} == 0 + for: 5m + labels: + severity: critical + annotations: + summary: Neutron service down. (Instance {{ $labels.hostname }}) + description: | + The Neutron service '{{ $labels.service }}' is currently down on host {{ $labels.hostname }}. + LABELS = {{ $labels }}