This commit is contained in:
mdivecky 2024-12-10 13:00:10 +01:00
parent 7033a7f74f
commit 757c460be5
3 changed files with 84 additions and 0 deletions

52
compose.yml Normal file
View file

@ -0,0 +1,52 @@
services:
blackbox:
image: prom/blackbox-exporter:latest
command:
- --config.file=/etc/blackbox/blackbox.yml
volumes:
- ./config/blackbox:/etc/blackbox
ports:
- 127.0.0.1:9115:9115
prometheus:
image: prom/prometheus:latest
user: 1000:1000
ports:
- 127.0.0.1:9094:9090
volumes:
- ./config/prometheus:/etc/prometheus
- ./data/prometheus:/prometheus
command: --web.enable-lifecycle --web.enable-remote-write-receiver --config.file=/etc/prometheus/prometheus.yml
restart: unless-stopped
grafana:
image: grafana/grafana-oss:latest
restart: unless-stopped
user: 1000:1000
environment:
GF_DATABASE_TYPE: postgres
GF_DATABASE_HOST: grafana_db:5432
GF_DATABASE_NAME: grafana
GF_DATABASE_USER: grafana
GF_DATABASE_PASSWORD: grafana
GF_DATABASE_SSL_MODE: disable
#GF_SERVER_ROOT_URL: "https://grafana.druit.org/"
depends_on:
- grafana_db
ports:
- 3000:3000
volumes:
- ./data/grafana:/var/lib/grafana
# - ./config/grafana/provisioning:/etc/grafana/provisioning
# - ./config/grafana/dashboards:/var/lib/grafana/dashboards
grafana_db:
image: postgres:15
restart: unless-stopped
environment:
POSTGRES_DB: grafana
POSTGRES_USER: grafana
POSTGRES_PASSWORD: grafana
volumes:
- ./data/grafana-db:/var/lib/postgresql/data

View file

@ -0,0 +1,8 @@
modules:
http_2xx:
prober: http
timeout: 60s
http:
method: GET
valid_http_versions: ["HTTP/1.1", "HTTP/2.0"]
preferred_ip_protocol: "ip4"

View file

@ -0,0 +1,24 @@
global:
scrape_interval: 20s
scrape_timeout: 10s
evaluation_interval: 20s
scrape_configs:
- job_name: 'blackbox/primary'
metrics_path: /probe
scrape_interval: 60s
scrape_timeout: 45s
params:
module: [http_2xx]
http_sd_configs:
- url: https://mdivecky.nolog.page/mon-test/targets.json
refresh_interval: 600s
relabel_configs:
- source_labels: [check_url]
target_label: __address__
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox:9115