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