From f92b76f266cd64e35efabebd74f7c0bf4001693e Mon Sep 17 00:00:00 2001 From: Andy Bunce Date: Sat, 2 Apr 2022 17:56:21 +0100 Subject: [PATCH] [add] prometheus --- prometheus/config/alert.yml | 6 ++++++ prometheus/config/prometheus.yml | 15 +++++++++++++++ prometheus/docker-compose.yml | 15 +++++++++++++++ tiddlywiki/docker-compose.yml | 2 +- 4 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 prometheus/config/alert.yml create mode 100644 prometheus/config/prometheus.yml create mode 100644 prometheus/docker-compose.yml diff --git a/prometheus/config/alert.yml b/prometheus/config/alert.yml new file mode 100644 index 0000000..a2a4817 --- /dev/null +++ b/prometheus/config/alert.yml @@ -0,0 +1,6 @@ +groups: + - name: DemoAlerts + rules: + - alert: InstanceDown + expr: up{job="services"} < 1 + for: 5m \ No newline at end of file diff --git a/prometheus/config/prometheus.yml b/prometheus/config/prometheus.yml new file mode 100644 index 0000000..a59f4d2 --- /dev/null +++ b/prometheus/config/prometheus.yml @@ -0,0 +1,15 @@ +global: + scrape_interval: 30s + scrape_timeout: 10s + +rule_files: + - alert.yml + +scrape_configs: + - job_name: services + metrics_path: /metrics + static_configs: + - targets: + - 'prometheus:9090' + - 'idonotexists:564' + diff --git a/prometheus/docker-compose.yml b/prometheus/docker-compose.yml new file mode 100644 index 0000000..ddfca7e --- /dev/null +++ b/prometheus/docker-compose.yml @@ -0,0 +1,15 @@ +version: '3' + +services: + prometheus: + image: prom/prometheus:v2.34.0 + ports: + - 9000:9090 + volumes: + - ./prometheus:/etc/prometheus + - prometheus-data:/prometheus + command: --web.enable-lifecycle --config.file=/etc/prometheus/prometheus.yml + + +volumes: + prometheus-data: diff --git a/tiddlywiki/docker-compose.yml b/tiddlywiki/docker-compose.yml index 573ea1e..00b2d2f 100644 --- a/tiddlywiki/docker-compose.yml +++ b/tiddlywiki/docker-compose.yml @@ -2,7 +2,7 @@ version: '3' services: tiddly: - image: tiddlywiki:5.2.0 + image: tiddlywiki:5.2.2 build: . container_name: tiddlywiki-docker restart: unless-stopped