From 3c49cdd8989acd19607585d9dc824260ba6c91ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yannig=20Perr=C3=A9?= Date: Sat, 20 Nov 2021 15:17:57 +0100 Subject: [PATCH] :memo: Ajout fichiers manquants pour chapitre 16 --- chapitre-16/rules/flask.yaml | 17 +++++++++++++++++ chapitre-16/rules/spring-boot.yaml | 22 ++++++++++++++++++++++ chapitre-16/{spring-boot => }/tomcat.yml | 0 3 files changed, 39 insertions(+) create mode 100644 chapitre-16/rules/flask.yaml create mode 100644 chapitre-16/rules/spring-boot.yaml rename chapitre-16/{spring-boot => }/tomcat.yml (100%) diff --git a/chapitre-16/rules/flask.yaml b/chapitre-16/rules/flask.yaml new file mode 100644 index 0000000..421d118 --- /dev/null +++ b/chapitre-16/rules/flask.yaml @@ -0,0 +1,17 @@ +groups: +- name: FlaskErrors + rules: + - alert: HTTPError + expr: > + sum( + rate( + flask_http_request_duration_seconds_count{ + status=~"[45].." + }[5m] + ) + ) > 0 + for: 5m + labels: + severity: critical + annotations: + summary: Too much 4xx or 5xx errors on Flask apps diff --git a/chapitre-16/rules/spring-boot.yaml b/chapitre-16/rules/spring-boot.yaml new file mode 100644 index 0000000..00e8740 --- /dev/null +++ b/chapitre-16/rules/spring-boot.yaml @@ -0,0 +1,22 @@ +groups: +- name: SpringBootAlerts + rules: + - alert: HTTPError + expr: > + sum( + rate( + http_server_requests_seconds_count{status=~"[45].."}[5m] + ) + ) > 0 + for: 5m + labels: + severity: critical + annotations: + summary: Too much 4xx or 5xx errors on Spring boot apps + - alert: LogError + expr: sum(rate(logback_events_total{level="error"}[5m])) > 0 + for: 5m + labels: + severity: critical + annotations: + summary: Too much log error activity since 5 minutes diff --git a/chapitre-16/spring-boot/tomcat.yml b/chapitre-16/tomcat.yml similarity index 100% rename from chapitre-16/spring-boot/tomcat.yml rename to chapitre-16/tomcat.yml