From 1b8e9e3b4340836974723adac736153dd1e07529 Mon Sep 17 00:00:00 2001 From: Michal Hucko Date: Fri, 11 Oct 2024 12:52:58 +0200 Subject: [PATCH] Add alert rules to kfp-api based on the KF093 spec (#560) (#575) * Add alert rules to kfp-api based on the KF093 spec * Delete charms/kfp-api/src/prometheus_alert_rules/unit_unavailable.rule Co-authored-by: Robert Gildein --- .../KubeflowKfpApiServices.rules | 24 +++++++++++++++++++ .../unit_unavailable.rule | 10 -------- 2 files changed, 24 insertions(+), 10 deletions(-) create mode 100644 charms/kfp-api/src/prometheus_alert_rules/KubeflowKfpApiServices.rules delete mode 100644 charms/kfp-api/src/prometheus_alert_rules/unit_unavailable.rule diff --git a/charms/kfp-api/src/prometheus_alert_rules/KubeflowKfpApiServices.rules b/charms/kfp-api/src/prometheus_alert_rules/KubeflowKfpApiServices.rules new file mode 100644 index 00000000..6b876b42 --- /dev/null +++ b/charms/kfp-api/src/prometheus_alert_rules/KubeflowKfpApiServices.rules @@ -0,0 +1,24 @@ +groups: +- name: KubeflowKfpApiServices + rules: + - alert: KubeflowServiceDown + expr: up{} < 1 + for: 5m + labels: + severity: critical + annotations: + summary: "{{ $labels.juju_charm }} service is Down ({{ $labels.juju_model }}/{{ $labels.juju_unit }})" + description: | + One or more targets of {{ $labels.juju_charm }} charm are down on unit {{ $labels.juju_model }}/{{ $labels.juju_unit }}. + LABELS = {{ $labels }} + + - alert: KubeflowServiceIsNotStable + expr: avg_over_time(up{}[10m]) < 0.5 + for: 0m + labels: + severity: warning + annotations: + summary: "{{ $labels.juju_charm }} service is not stable ({{ $labels.juju_model }}/{{ $labels.juju_unit }})" + description: | + {{ $labels.juju_charm }} unit {{ $labels.juju_model }}/{{ $labels.juju_unit }} has been unreachable at least 50% of the time over the last 10 minutes. + LABELS = {{ $labels }} diff --git a/charms/kfp-api/src/prometheus_alert_rules/unit_unavailable.rule b/charms/kfp-api/src/prometheus_alert_rules/unit_unavailable.rule deleted file mode 100644 index e9859768..00000000 --- a/charms/kfp-api/src/prometheus_alert_rules/unit_unavailable.rule +++ /dev/null @@ -1,10 +0,0 @@ -alert: KfpApiUnitIsUnavailable -expr: up < 1 -for: 0m -labels: - severity: critical -annotations: - summary: Kfp-api unit {{ $labels.juju_model }}/{{ $labels.juju_unit }} unavailable - description: > - The kfp-api unit {{ $labels.juju_model }} {{ $labels.juju_unit }} is unavailable - LABELS = {{ $labels }}