Files
aramesh-backend/monitoring/prometheus/prometheus.yml
T
MMD 74770cd99d fix(stack): bring-up fixes from first local deployment
- traefik pin v3.3 -> v3.6: v3.3's old docker client fails against
  Engine 29 socket proxy (empty daemon errors, no routers)
- backend/minio/chatbot/umami: traefik.docker.network hint — Traefik
  picked the internal-network IP for multi-network services and replies
  were hairpin-dropped (all backend routes hung)
- db-init: psql needs an explicit -d arameshplaza (no default db 'aramesh'),
  set -e so failures actually fail; one-shot folded-YAML needs semicolons
- chatbot image: drop g++ (apt unreachable in build network; all wheels
  prebuilt) and mkdir /data before chown (VOLUME does not create it)
- frontend image: create caddy user (alpine image has none) with writable
  /config and /data
- monitoring: blackbox probes replace raw metric scrapes of JSON/HTML
  health endpoints (they reported 'down' while healthy); blackbox joins
  edge; SITE_URL passed via env (Prometheus has no ${VAR:-default}
  expansion); ContainerMemoryNearLimit PromQL fixed (comparison inside
  label braces); HostDiskAlmostFull filters WSL/Docker-Desktop
  pseudo-mounts
- alertmanager: config rendered by stack.sh (no env expansion in AM) and
  delivered to Bale (tapi.bale.ai); stack.sh monitoring command
- machine-local override: minio console/API moved to 29001/29000
2026-09-19 01:22:02 +03:30

107 lines
3.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# تنظیمات Prometheus — اسکرپ همهٔ سرویس‌های استک از شبکه‌های داخلی
global:
scrape_interval: 30s
evaluation_interval: 30s
alerting:
alertmanagers:
- static_configs:
- targets: ["alertmanager:9093"]
rule_files:
- /etc/prometheus/alerts.yml
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ["localhost:9090"]
# بک‌اند FastAPI — /metrics با instrumentator (فقط از شبکه داخلی)
- job_name: backend
static_configs:
- targets: ["backend:8000"]
# پراکسی — RPS هر روتر، کدهای وضعیت، انقضای گواهی TLS
- job_name: traefik
static_configs:
- targets: ["traefik:8080"]
# منابع کانتینرها و میزبان
- job_name: cadvisor
static_configs:
- targets: ["cadvisor:8080"]
- job_name: node
static_configs:
- targets: ["node-exporter:9100"]
- job_name: postgres
static_configs:
- targets: ["postgres-exporter:9187"]
# سلامت سرویس‌های بدون متریک — با پروب blackbox (پاسخ JSON/HTML قابل اسکرپ نیست)
# نتیجه: probe_success (۱ = سالم، ۰ = پایین) — هشدار ProbeFailing پوشش می‌دهد
- job_name: blackbox-frontend
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://frontend/
relabel_configs: &blackbox_relabel
- source_labels: [__address__]
target_label: __param_target
- source_labels: [__param_target]
target_label: instance
- target_label: __address__
replacement: blackbox-exporter:9115
- job_name: blackbox-minio
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://minio:9000/minio/health/live
relabel_configs: *blackbox_relabel
- job_name: blackbox-umami
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://umami:3000/api/heartbeat
relabel_configs: *blackbox_relabel
- job_name: blackbox-chatbot
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://chatbot:8000/chat/healthz
relabel_configs: *blackbox_relabel
# پروب بیرون‌نگر — سلامت واقعی /api/health (بخش عمق: DB و MinIO را می‌آزماید)
# و در تولید، آدرس عمومی سایت (SITE_URL از .env — پشتیبانی متغیر محیطی Prometheus)
- job_name: blackbox-internal-health
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
- http://backend:8000/api/health
relabel_configs: *blackbox_relabel
- job_name: blackbox-public
metrics_path: /probe
params:
module: [http_2xx]
static_configs:
- targets:
# مقدار پیش‌فرض در docker-compose.monitoring.yml تنظیم می‌شود
# (Prometheus سینتکس ${VAR:-default} را پشتیبانی نمی‌کند)
- ${SITE_URL}
relabel_configs: *blackbox_relabel