File tree Expand file tree Collapse file tree 5 files changed +31
-6
lines changed Expand file tree Collapse file tree 5 files changed +31
-6
lines changed Original file line number Diff line number Diff line change 93
93
# See available tags https://github.com/prometheus/prometheus/releases.
94
94
# PROMETHEUS_VERSION=
95
95
96
+ # Prometheus remote write token used for accessing external prometheus.
97
+ # PROM_REMOTE_WRITE_TOKEN=
98
+
99
+ # Prometheus service owner used to uniquely identify user from which metrics are pushed.
100
+ # SERVICE_OWNER=charon_user
101
+
96
102
# ######## Voluntary Exit Config #########
97
103
98
104
# This applies to compose-voluntary-exit.yml only
Original file line number Diff line number Diff line change @@ -10,4 +10,5 @@ cluster-lock.json
10
10
.DS_Store
11
11
data /
12
12
.idea
13
- .charon
13
+ .charon
14
+ prometheus /prometheus.yml
Original file line number Diff line number Diff line change @@ -142,12 +142,13 @@ services:
142
142
image : prom/prometheus:${PROMETHEUS_VERSION:-v2.50.1}
143
143
user : " :"
144
144
networks : [dvnode]
145
+ environment :
146
+ - PROM_REMOTE_WRITE_TOKEN=${PROM_REMOTE_WRITE_TOKEN}
147
+ - SERVICE_OWNER=${SERVICE_OWNER}
145
148
volumes :
146
- - ./prometheus/prometheus.yml :/etc/prometheus/prometheus.yml
149
+ - ./prometheus:/etc/prometheus
147
150
- ./data/prometheus:/prometheus
148
- command :
149
- - " --enable-feature=expand-external-labels"
150
- - " --config.file=/etc/prometheus/prometheus.yml"
151
+ entrypoint : /etc/prometheus/run.sh
151
152
restart : unless-stopped
152
153
153
154
grafana :
Original file line number Diff line number Diff line change 7
7
remote_write:
8
8
- url: https://vm.monitoring.gcp.obol.tech/write
9
9
authorization:
10
- credentials : $PROM_REMOTE_WRITE_TOKEN
10
+ credentials: ${ PROM_REMOTE_WRITE_TOKEN}
11
11
write_relabel_configs:
12
12
- source_labels: [job]
13
13
regex: "charon"
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ if [ -z " $SERVICE_OWNER " ]
4
+ then
5
+ echo " \$ SERVICE_OWNER variable is empty"
6
+ fi
7
+
8
+ if [ -z " $PROM_REMOTE_WRITE_TOKEN " ]
9
+ then
10
+ echo " \$ PROM_REMOTE_WRITE_TOKEN variable is empty"
11
+ fi
12
+
13
+ # eval is used instead of envsubst, as prometheus user doesn't have permissions to install envsubst
14
+ eval " echo \" $( cat /etc/prometheus/prometheus.yml.example) \" " > /etc/prometheus/prometheus.yml
15
+
16
+ /bin/prometheus \
17
+ --config.file=/etc/prometheus/prometheus.yml
You can’t perform that action at this time.
0 commit comments