Skip to content

Commit

Permalink
Adding multi-cluster via federation
Browse files Browse the repository at this point in the history
Signed-off-by: cloudbehl <[email protected]>
  • Loading branch information
cloudbehl committed May 21, 2024
1 parent ca39b46 commit 8d53b3c
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
11 changes: 10 additions & 1 deletion docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -22,7 +30,8 @@ scrape_configs:
- '{job="haproxy"}'
- '{job="ceph-exporter"}'
static_configs:
- targets: []
- targets:
- 'prometheus2:9090'

alerting:
alertmanagers:
Expand Down
22 changes: 21 additions & 1 deletion docker/prometheus1/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 8d53b3c

Please sign in to comment.