nav-img
Evolution

Настройка Prometheus

  1. Настройте репозиторий с пакетами для мониторинга кластера:

    curl -fsSL https://pkg.sbercloud.tech/artifactory/api/security/keypair/public/repositories/sds-deb | sudo apt-key add -
    sudo sh -c "echo 'deb https://pkg.sbercloud.tech/artifactory/sds-deb $(lsb_release -cs) monitoring' > /etc/apt/sources.list.d/sds-deb.list"
  2. Установите пакет:

    sudo apt install prometheus storage-grafana-dashboards storage-prometheus-alerts

Настройка Prometheus через статический конфигурационный файл

Укажите адреса всех OpenTelemetry collector для Prometheus в конфигурационном файле /etc/prometheus/prometheus.yml:

global:
scrape_interval: 5s
scrape_configs:
- job_name: 'collector'
honor_labels: true
static_configs:
# Здесь перечислить все адреса OpenTelemetry collector
- targets: ['10.10.40.81:60091']
- targets: ['10.10.40.82:60091']
rule_files:
- "/var/lib/storage/prometheus/rules/*.yml"
- "/var/lib/storage/prometheus/alerts/*.yml"

По умолчанию порт для Prometheus endpoint в OpenTelemetry collector — 60091.

Настройка Prometheus через service discovery

  1. Отредактируйте конфигурационный файл /etc/prometheus/prometheus.yml:

    global:
    scrape_interval: 5s
    scrape_configs:
    - job_name: 'node-exporter'
    honor_labels: true
    http_sd_configs:
    - url: 'http://MDS_IP_ADDRESS:60080/targets?service=node_exporter'
    - job_name: 'mds'
    honor_labels: true
    http_sd_configs:
    - url: 'http://MDS_IP_ADDRESS:60080/targets?service=mds'
    - job_name: 'csd'
    honor_labels: true
    http_sd_configs:
    - url: 'http://MDS_IP_ADDRESS:60080/targets?service=csd'
    rule_files:
    - "/var/lib/storage/prometheus/rules/*.yml"
    - "/var/lib/storage/prometheus/alerts/*.yml"

    Где:

    • MDS_IP_ADDRESS — IP-адрес любого MDS.

  2. Запустите службы:

    systemctl start prometheus.service
    systemctl enable prometheus.service