Files
Grafana-Prometheus/config/prometheus.yaml

28 lines
1.3 KiB
YAML

global:
scrape_interval: 15s # ⏱️ Default interval Prometheus uses to scrape metrics from all targets, unless overridden in specific jobs.
scrape_configs:
# Existing Hetzner Dynamic Configuration
- job_name: "hetzner-dynamic" # 🏷️ Logical name for the scrape job (used in metrics as job="hetzner-dynamic").
file_sd_configs: # 📂 Enable file-based service discovery. Prometheus will look at files to dynamically load targets.
- files:
- "/opt/phx/main/config/hetzner_targets.json" # 📁 JSON file containing the list of targets (e.g. IPs, ports, labels).
refresh_interval: 30s # 🔁 How often Prometheus checks the file for changes and updates the target list.
scrape_interval: 5s # ⏱️ Override global default: scrape metrics from each target in this job every 5 seconds.
scheme: http # 🌐 Use plain HTTP when scraping the targets (not HTTPS).
# - job_name: "phoenix-system"
# file_sd_configs:
# - files:
# - "/opt/phx/main/config/phoenix_system_hetzner_targets.json"
# refresh_interval: 30s
# scrape_interval: 5s
# scheme: http
# - job_name: "phoenix-worker"
# file_sd_configs:
# - files:
# - "/opt/phx/main/config/phoenix_worker_hetzner_targets.json"
# refresh_interval: 30s
# scrape_interval: 5s
# scheme: http