Skip to content

Commit 3b37d20

Browse files
committed
Changes to include couchdb-prometheus-exporter
1 parent 02fde22 commit 3b37d20

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

docker/couchdb/Dockerfile

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
FROM cmssw/filebeat:latest as filebeat
12
FROM couchdb:3.2.2
23
MAINTAINER Valentin Kuznetsov vkuznet@gmail.com
34

@@ -24,9 +25,10 @@ RUN mkdir -p $WDIR
2425
WORKDIR ${WDIR}
2526

2627
# get binary build of couchdb exporter
27-
RUN curl -ksLO https://github.com/gesellix/couchdb-prometheus-exporter/releases/download/v27.0.0/couchdb-prometheus-exporter_27.0.0_Linux_x86_64.tar.gz
28-
RUN tar xfz couchdb-prometheus-exporter_27.0.0_Linux_x86_64.tar.gz
29-
RUN rm couchdb-prometheus-exporter_27.0.0_Linux_x86_64.tar.gz LICENSE README*.md
28+
ARG VER=30.14.0
29+
RUN curl -ksLO https://github.com/gesellix/couchdb-prometheus-exporter/releases/download/v${VER}/couchdb-prometheus-exporter_${VER}_Linux_x86_64.tar.gz
30+
RUN tar xfz couchdb-prometheus-exporter_${VER}_Linux_x86_64.tar.gz
31+
RUN rm couchdb-prometheus-exporter_${VER}_Linux_x86_64.tar.gz LICENSE README*.md
3032
ENV PATH="${WDIR}:${PATH}"
3133

3234
# add necessary scripts
@@ -47,6 +49,10 @@ ADD manage /data/srv/current/config/couchdb/manage
4749

4850
ENV PATH="/opt/couchdb/bin:/usr/local/bin/:${PATH}"
4951

52+
# copy exporters
53+
COPY --from=filebeat /usr/share/filebeat /usr/share/filebeat
54+
COPY --from=filebeat /usr/bin/filebeat /usr/bin/filebeat
55+
5056
# setup final environment
5157
USER $USER
5258
WORKDIR $WDIR

docker/couchdb/monitor.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@
44
COUCH_CONFIG=/data/srv/current/auth/couchdb/couchdb_config.ini
55
# test if file is not zero size
66
if [ -s "${COUCH_CONFIG}" ]; then
7-
sudo cp /etc/secrets/$fname /data/srv/current/auth/$srv/$fname
8-
sudo chown $USER.$USER /data/srv/current/auth/$srv/$fname
9-
nohup couchdb-prometheus-exporter -telemetry.address=":9984" -logtostderr=true \
10-
--config=$COUCH_CONFIG -databases.views=false 2>&1 1>& couchdb_exporter.log < /dev/null &
7+
nohup /data/couchdb-prometheus-exporter -telemetry.address=":9984" \
8+
--config=$COUCH_CONFIG -databases.views=false --databases=_all_dbs 2>&1 1>& \
9+
/data/couchdb_exporter.log < /dev/null &
1110
else
1211
echo "ERROR: couchdb_config.ini file is empty and prometheus exporter cannot be started!"
1312
fi
@@ -19,4 +18,6 @@ if [ -f /etc/secrets/filebeat.yaml ] && [ -f /usr/bin/filebeat ]; then
1918
nohup /usr/bin/filebeat \
2019
-c /etc/secrets/filebeat.yaml \
2120
--path.data $ldir/data --path.logs $ldir -e 2>&1 1>& $ldir/log < /dev/null &
21+
else
22+
echo "ERROR: filebeat process is not started as /etc/secrets/filebeat.yaml does not exist"
2223
fi

0 commit comments

Comments
 (0)