diff --git a/.env.example b/.env.example index 49e8f6bf59..7b1ee91fcd 100644 --- a/.env.example +++ b/.env.example @@ -22,7 +22,7 @@ PROMETHEUS_ALERTS_DIR=monitoring/ceph-mixin #PROMETHEUS_ALERTS_DIR=monitoring/prometheus/alerts PROMETHEUS_HOST_PORT=9090 -PROMETHEUS_HOST_PORT1=9098 +PROMETHEUS2_HOST_PORT=9098 #PROMETHEUS_IMAGE= NODE_EXPORTER_HOST_PORT=9100 #NODE_EXPORTER_IMAGE= diff --git a/README.md b/README.md index 72a32653b2..1e1c1209b0 100644 --- a/README.md +++ b/README.md @@ -395,7 +395,7 @@ docker push rhcsdashboard/ceph:main * Start ceph2 + ceph + ...: ``` -docker-compose up -d --scale ceph2=1 +docker-compose up -d --scale ceph2=1 --scale prometheus2=1 # Start ceph2 but not ceph: docker-compose up -d --scale ceph2=1 --scale ceph=0 diff --git a/docker-compose.yml b/docker-compose.yml index 89be5498fd..78e3c22fa9 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -131,6 +131,7 @@ services: volumes: - ./docker/prometheus1:/etc/prometheus:Z - ${CEPH2_REPO_DIR}/${PROMETHEUS_ALERTS_DIR:-monitoring/ceph-mixin}:/etc/prometheus/alerts:Z + scale: -1 node-exporter: image: ${NODE_EXPORTER_IMAGE:-prom/node-exporter:v1.5.0} diff --git a/docker/prometheus/prometheus.yml b/docker/prometheus/prometheus.yml index 7d5fee7fda..da51639d7c 100644 --- a/docker/prometheus/prometheus.yml +++ b/docker/prometheus/prometheus.yml @@ -6,11 +6,19 @@ scrape_configs: file_sd_configs: - files: - node-exporter-targets.yml + relabel_configs: + - source_labels: [__address__] + target_label: cluster + replacement: 'cluster1' - job_name: 'ceph' honor_labels: true file_sd_configs: - files: - ceph-targets.yml + relabel_configs: + - source_labels: [__address__] + target_label: cluster + replacement: 'cluster1' - job_name: 'federate' scrape_interval: 15s honor_labels: true @@ -22,7 +30,8 @@ scrape_configs: - '{job="haproxy"}' - '{job="ceph-exporter"}' static_configs: - - targets: [] + - targets: + - 'prometheus2:9090' alerting: alertmanagers: diff --git a/docker/prometheus1/prometheus.yml b/docker/prometheus1/prometheus.yml index eb9f368e2c..6efc1a9d08 100644 --- a/docker/prometheus1/prometheus.yml +++ b/docker/prometheus1/prometheus.yml @@ -6,18 +6,38 @@ scrape_configs: file_sd_configs: - files: - node-exporter-targets.yml + relabel_configs: + - source_labels: [__address__] + target_label: cluster + replacement: 'cluster2' - job_name: 'ceph' honor_labels: true file_sd_configs: - files: - ceph-targets.yml + relabel_configs: + - source_labels: [__address__] + target_label: cluster + replacement: 'cluster2' + - job_name: 'federate' + scrape_interval: 15s + honor_labels: true + metrics_path: '/federate' + params: + 'match[]': + - '{job="ceph"}' + - '{job="node"}' + - '{job="haproxy"}' + - '{job="ceph-exporter"}' + static_configs: + - targets: [] alerting: alertmanagers: - scheme: http static_configs: - targets: - - 'alertmanager:9094' + - 'alertmanager:9093' rule_files: - 'alerts/ceph_default_alerts.yml'