server-monitoring/prometheus/prometheus.yml.tpl
ShiZa039 74b6f92cb8 Стек мониторинга: Prometheus + Alertmanager + Grafana + node_exporter + cAdvisor
Самодостаточный docker compose стек с деплоем через deploy.sh,
bootstrap-установкой с нуля и конфигурацией через .env.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-23 12:54:40 +02:00

43 lines
1.4 KiB
Smarty
Raw Permalink 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.

# Шаблон: deploy.sh рендерит его в rendered/prometheus.yml.
# __ПЛЕЙСХОЛДЕРЫ__ подставляются из .env; строки с префиксом #AUTH#
# включаются только при непустом METRICS_PASSWORD.
global:
scrape_interval: 30s
evaluation_interval: 30s
external_labels:
server: '__SERVER_NAME__'
rule_files:
- /etc/prometheus/rules/*.yml
alerting:
alertmanagers:
- static_configs:
- targets: ['alertmanager:9093']
#AUTH# basic_auth:
#AUTH# username: '__METRICS_USER__'
#AUTH# password_file: /etc/prometheus/auth/password
scrape_configs:
- job_name: prometheus
static_configs:
- targets: ['localhost:9090']
#AUTH# basic_auth:
#AUTH# username: '__METRICS_USER__'
#AUTH# password_file: /etc/prometheus/auth/password
# node_exporter работает в host-сети и слушает BIND_IP
- job_name: node
static_configs:
- targets: ['__BIND_IP__:__NODE_EXPORTER_PORT__']
#AUTH# basic_auth:
#AUTH# username: '__METRICS_USER__'
#AUTH# password_file: /etc/prometheus/auth/password
# cAdvisor доступен только по внутренней compose-сети, без auth
- job_name: cadvisor
static_configs:
- targets: ['cadvisor:8080']
# Сюда добавляются удалённые серверы (scrape по tailnet) — см. README