Files
mtusi2026lab7/infra/prometheus/prometheus.yml
T

62 lines
2.2 KiB
YAML

# Prometheus — хранилище метрик (TSDB на volume, retention 7d) и вычисление alerts.
# Lab7: все scrape — HTTPS с проверкой сервера по CA и клиентским сертификатом
# Prometheus (mTLS); UI/API Prometheus — тоже mTLS (web.yml), наружу не публикуется.
# Исключение: внутренние метрики Collector (:8888, только сеть telemetry, без данных приложений).
# Метрики приложения приходят OTLP → Collector → exporter prometheus (:8889):
# honor_labels сохраняет job=service.name и instance=service.instance.id реплики.
global:
scrape_interval: 5s
evaluation_interval: 5s
external_labels:
deployment_environment: lab
rule_files:
- /etc/prometheus/rules/*.yml
scrape_configs:
- job_name: otel-collector-app
honor_labels: true
scheme: https
tls_config:
ca_file: /run/secrets/ca.crt
cert_file: /run/secrets/prometheus.crt
key_file: /run/secrets/prometheus.key
static_configs:
- targets: ["otel-collector:8889"]
- job_name: otel-collector
static_configs:
- targets: ["otel-collector:8888"]
- job_name: rabbitmq
metrics_path: /metrics/per-object # глубина очередей attachment.process / attachment.dead
scheme: https
tls_config:
ca_file: /run/secrets/ca.crt
cert_file: /run/secrets/prometheus.crt
key_file: /run/secrets/prometheus.key
static_configs:
- targets: ["rabbitmq:15691"]
- job_name: loki
scheme: https
tls_config:
ca_file: /run/secrets/ca.crt
cert_file: /run/secrets/prometheus.crt
key_file: /run/secrets/prometheus.key
static_configs:
- targets: ["loki:3100"]
- job_name: tempo
scheme: https
tls_config:
ca_file: /run/secrets/ca.crt
cert_file: /run/secrets/prometheus.crt
key_file: /run/secrets/prometheus.key
static_configs:
- targets: ["tempo:3200"]
- job_name: prometheus
scheme: https
tls_config:
ca_file: /run/secrets/ca.crt
cert_file: /run/secrets/prometheus.crt
key_file: /run/secrets/prometheus.key
static_configs:
- targets: ["localhost:9090"]