Skip to content

Commit

Permalink
ceph-exporter: add support for exporter in docker setup
Browse files Browse the repository at this point in the history
Signed-off-by: Piyush Agarwal <[email protected]>
  • Loading branch information
piyushagarwal1411 committed Nov 26, 2024
1 parent 1438cae commit 4630c2b
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ services:
- PYTHONDONTWRITEBYTECODE=1
- RGW
- RGW_MULTISITE=${RGW_MULTISITE:-0}
- EXPORTER=${EXPORTER:-0}
- NVMEOF_GW=${NVMEOF_GW}
cap_add:
- ALL
Expand Down
1 change: 1 addition & 0 deletions docker/ceph/rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ ARG CEPH_RELEASE=main
COPY rpm/*.* /root/
RUN /root/set-ceph-repo.sh
RUN dnf install -y --nogpgcheck ceph-mds ceph-mgr-cephadm ceph-mgr-dashboard \
ceph-exporter \
ceph-mgr-diskprediction-local \
ceph-mon ceph-osd ceph-radosgw rbd-mirror \
&& dnf clean packages
Expand Down
6 changes: 6 additions & 0 deletions docker/ceph/set-start-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ fi
export RGW_DEBUG
export VSTART_OPTIONS

# Add --exporter to VSTART_OPTIONS if the exporter flag is set
echo "exporter starting"
if [[ "$EXPORTER" == 1 ]]; then
VSTART_OPTIONS="$VSTART_OPTIONS --exporter"
fi

HTTP_PROTO='http'
if [[ "$DASHBOARD_SSL" == 1 ]]; then
HTTP_PROTO='https'
Expand Down
8 changes: 8 additions & 0 deletions docker/prometheus/ceph-exporter-targets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[
{
"targets": [ "ceph:9926" ],
"labels": {
cluster: "cluster1"
}
},
]
9 changes: 9 additions & 0 deletions docker/prometheus/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ scrape_configs:
- source_labels: [__address__]
target_label: cluster
replacement: 'cluster1'
- job_name: 'ceph-exporter'
honor_labels: true
file_sd_configs:
- files:
- ceph-exporter-targets.yml
relabel_configs:
- source_labels: [__address__]
target_label: cluster
replacement: 'cluster1'
- job_name: 'federate'
scrape_interval: 15s
honor_labels: true
Expand Down

0 comments on commit 4630c2b

Please sign in to comment.