added grafana and prometheus

This commit is contained in:
2026-02-21 15:00:49 +01:00
parent d9347ada81
commit d276792607
6 changed files with 825 additions and 0 deletions

49
prometheus/prometheus.yml Normal file
View File

@@ -0,0 +1,49 @@
global:
scrape_interval: 30s
evaluation_interval: 30s
scrape_configs:
# --- Health checks via Blackbox Exporter ---
- job_name: 'blackbox_http'
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://tutortool:5000/grafana/health
- http://tutortool:5000/
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
# --- TCP check for Postgres ---
- job_name: 'blackbox_tcp'
metrics_path: /probe
params:
module: [tcp_connect]
static_configs:
- targets:
- db:5432
- redis:6379
relabel_configs:
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
# --- Blackbox exporter itself ---
- job_name: 'blackbox_exporter'
static_configs:
- targets: ['blackbox-exporter:9115']
# --- Prometheus itself ---
- job_name: 'prometheus'
static_configs:
- targets: ['localhost:9090']