forked from mtusi2026/mtusi2026lab7
52 lines
2.5 KiB
YAML
52 lines
2.5 KiB
YAML
# Prometheus 3.5 LTS — хранилище метрик. Метрики приложения приходят PUSH через Collector на OTLP receiver
|
|
# (--web.enable-otlp-receiver); метрики самих компонентов наблюдаемости — обычный scrape.
|
|
global:
|
|
scrape_interval: 10s
|
|
evaluation_interval: 10s # правила алертов/записи проверяются каждые 10 с
|
|
|
|
# Ресурсные атрибуты OTel → labels каждой серии (иначе они только в target_info).
|
|
# service.instance.id — низкокардинальный: число реплик × перезапуски (случайный alias процесса).
|
|
otlp:
|
|
promote_resource_attributes:
|
|
- service.name
|
|
- service.namespace
|
|
- service.instance.id
|
|
- deployment.environment.name
|
|
translation_strategy: UnderscoreEscapingWithSuffixes # http.server.request.duration → http_server_request_duration_seconds
|
|
|
|
storage:
|
|
tsdb:
|
|
out_of_order_time_window: 10m # повторная отправка Collector после восстановления backend
|
|
|
|
rule_files:
|
|
- /etc/prometheus/rules/*.yml
|
|
|
|
scrape_configs:
|
|
# Сам Prometheus слушает только 127.0.0.1:9091 в namespace шлюза prometheus-gw (снаружи — mTLS :9090).
|
|
- job_name: prometheus
|
|
static_configs: [{targets: ['127.0.0.1:9091']}]
|
|
# Компоненты наблюдаемости — HTTPS + клиентский сертификат identity prometheus; шлюзы пускают её
|
|
# только на GET /metrics. Проверка сервера — CA + hostname (server_name), без insecure_skip_verify.
|
|
- job_name: otel-collector # otelcol_*: принято/отклонено/отправлено/очереди экспортёров
|
|
scheme: https
|
|
tls_config: &mtls
|
|
ca_file: /run/tls/trust/ca.crt
|
|
cert_file: /run/tls/self/tls.crt
|
|
key_file: /run/tls/self/tls.key
|
|
min_version: TLS12
|
|
static_configs: [{targets: ['otel-collector:8888']}]
|
|
- job_name: loki
|
|
scheme: https
|
|
tls_config: *mtls
|
|
static_configs: [{targets: ['loki:3100']}]
|
|
- job_name: tempo
|
|
scheme: https
|
|
tls_config: *mtls
|
|
static_configs: [{targets: ['tempo:3200']}]
|
|
- job_name: grafana # Grafana — native HTTPS (сертификат grafana), метрики без client cert
|
|
scheme: https
|
|
tls_config:
|
|
ca_file: /run/tls/trust/ca.crt
|
|
min_version: TLS12
|
|
static_configs: [{targets: ['grafana:3000']}]
|