Skip to content
Snippets Groups Projects
Verified Commit 6d6e3eba authored by Vincent Sellier's avatar Vincent Sellier
Browse files

admin: Add wordpress site monitoring with regexp checks

Related to swh/infra/sysadm-environment#4525
parent ac9d04b3
No related branches found
No related tags found
1 merge request!15admin: Configure some probes to monitor the websites
......@@ -23,6 +23,50 @@ spec:
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: website
name: websites-body-critical-alertmanager.rules
namespace: cattle-monitoring-system
spec:
groups:
- name: critical-website-body.rules
rules:
- alert: WebsiteIncorrectBody
annotations:
description: The {{ $labels.domain }} website {{ $labels.instance }} has an incorrect body since more than 5m.
summary: A blackbox probe regex check is failing since more then 5mn
expr: |-
max_over_time(probe_failed_due_to_regex{level="critical"}[1m]) == 1
for: 5m
labels:
severity: critical
namespace: cattle-monitoring-system
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: website
name: websites-body-warning-alertmanager.rules
namespace: cattle-monitoring-system
spec:
groups:
- name: warning-website-body.rules
rules:
- alert: WebsiteIncorrectBody
annotations:
description: The {{ $labels.domain }} website {{ $labels.instance }} has an incorrect body since more than 5m.
summary: A blackbox probe regex check is failing since more then 5mn
expr: |-
max_over_time(probe_failed_due_to_regex{level="critical"}[1m]) == 1
for: 5m
labels:
severity: warning
namespace: cattle-monitoring-system
---
apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
labels:
app: website
......
---
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: production-wordpress-monitoring
namespace: cattle-monitoring-system
labels:
release: "rancher-monitoring"
spec:
interval: 60s
jobName: production-websites-monitoring
module: swh_www
prober:
url: admin-blackbox-exporter-application-prometheus-blackbox-exporte:9115
path: /probe
scheme: http
targets:
staticConfig:
static:
- "https://www.softwareheritage.org"
labels:
level: critical
domain: production
---
apiVersion: monitoring.coreos.com/v1
kind: Probe
metadata:
name: production-websites-monitoring
namespace: cattle-monitoring-system
......@@ -17,7 +40,6 @@ spec:
targets:
staticConfig:
static:
- "https://www.softwareheritage.org"
- "https://archive.softwareheritage.org"
- "https://hedgedoc.softwareheritage.org"
labels:
......
......@@ -21,6 +21,17 @@ spec:
enabled: true
prometheusRule:
enabled: true
config:
modules:
swh_www:
prober: http
timeout: 5s
http:
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
follow_redirects: true
preferred_ip_protocol: "ip4"
fail_if_body_not_matches_regexp:
- '<title>Software Heritage</title>'
destination:
server: https://rancher.euwest.azure.internal.softwareheritage.org/k8s/clusters/c-q2wd4
namespace: cattle-monitoring-system
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment