Skip to content

Commit 4c9641a

Browse files
DiogoSantossOisinKyne
authored andcommitted
remove operator id and use cluster name/peer
1 parent 0c796ff commit 4c9641a

File tree

7 files changed

+16
-22
lines changed

7 files changed

+16
-22
lines changed

.env.sample.holesky

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ CHARON_EXECUTION_CLIENT_RPC_ENDPOINT=http://${EL}:8545
176176
# Loki log aggregation server addresses. Disable loki log aggregation by setting an empty address.
177177
#CHARON_LOKI_ADDRESSES=
178178

179-
# Charon Cluster Name. Mandatory to send logs with Promtail.
179+
# Charon Cluster Name. Mandatory to send logs with Promtail and metrics with Prometheus.
180180
#CLUSTER_NAME=
181181

182-
# Charon Cluster Peer. Mandatory to send logs with Promtail.
182+
# Charon Cluster Peer. Mandatory to send logs with Promtail and metrics with Prometheus.
183183
#CLUSTER_PEER=
184184

185185
# Nickname to identify this charon node on monitoring (max 32 characters).
@@ -256,9 +256,6 @@ LIDODVEXIT_EXIT_EPOCH=256
256256
# Prometheus service owner used to uniquely identify user from which metrics are pushed.
257257
#SERVICE_OWNER=charon_user
258258

259-
# Unique label to identify this operator in Prometheus metrics.
260-
#OPERATOR_PROMETHEUS_LABEL=
261-
262259
# To get Alerted with Obol Agent monitoring on Discord, specify your Discord ID(s) below.
263260
# Enable developer mode on discord with User Settings > Advanced.
264261
# Then right click on a user's profile picture or name and select Copy ID to get a unique 18-digit number that represents their account.

.env.sample.hoodi

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ CHARON_EXECUTION_CLIENT_RPC_ENDPOINT=http://${EL}:8545
176176
# Loki log aggregation server addresses. Disable loki log aggregation by setting an empty address.
177177
#CHARON_LOKI_ADDRESSES=
178178

179-
# Charon Cluster Name. Mandatory to send logs with Promtail.
179+
# Charon Cluster Name. Mandatory to send logs with Promtail and metrics with Prometheus.
180180
#CLUSTER_NAME=
181181

182-
# Charon Cluster Peer. Mandatory to send logs with Promtail.
182+
# Charon Cluster Peer. Mandatory to send logs with Promtail and metrics with Prometheus.
183183
#CLUSTER_PEER=
184184

185185
# Nickname to identify this charon node on monitoring (max 32 characters).
@@ -262,9 +262,6 @@ LIDODVEXIT_EXIT_EPOCH=256
262262
# Prometheus service owner used to uniquely identify user from which metrics are pushed.
263263
#SERVICE_OWNER=charon_user
264264

265-
# Unique label to identify this operator in Prometheus metrics.
266-
#OPERATOR_PROMETHEUS_LABEL=
267-
268265
# To get Alerted with Obol Agent monitoring on Discord, specify your Discord ID(s) below.
269266
# Enable developer mode on discord with User Settings > Advanced.
270267
# Then right click on a user's profile picture or name and select Copy ID to get a unique 18-digit number that represents their account.

.env.sample.mainnet

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,10 @@ CHARON_EXECUTION_CLIENT_RPC_ENDPOINT=http://${EL}:8545
176176
# Loki log aggregation server addresses. Disable loki log aggregation by setting an empty address.
177177
#CHARON_LOKI_ADDRESSES=
178178

179-
# Charon Cluster Name. Mandatory to send logs with Promtail.
179+
# Charon Cluster Name. Mandatory to send logs with Promtail and metrics with Prometheus.
180180
#CLUSTER_NAME=
181181

182-
# Charon Cluster Peer. Mandatory to send logs with Promtail.
182+
# Charon Cluster Peer. Mandatory to send logs with Promtail and metrics with Prometheus.
183183
#CLUSTER_PEER=
184184

185185
# Nickname to identify this charon node on monitoring (max 32 characters).
@@ -262,9 +262,6 @@ LIDODVEXIT_EXIT_EPOCH=194048
262262
# Prometheus service owner used to uniquely identify user from which metrics are pushed.
263263
#SERVICE_OWNER=charon_user
264264

265-
# Unique label to identify this operator in Prometheus metrics.
266-
#OPERATOR_PROMETHEUS_LABEL=
267-
268265
# To get Alerted with Obol Agent monitoring on Discord, specify your Discord ID(s) below.
269266
# Enable developer mode on discord with User Settings > Advanced.
270267
# Then right click on a user's profile picture or name and select Copy ID to get a unique 18-digit number that represents their account.

compose-monitoring.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,11 @@ services:
1212
PROM_REMOTE_WRITE_TOKEN: ${PROM_REMOTE_WRITE_TOKEN}
1313
SERVICE_OWNER: ${SERVICE_OWNER}
1414
ALERT_DISCORD_IDS: "${ALERT_DISCORD_IDS}"
15+
CLUSTER_NAME: ${CLUSTER_NAME}
16+
CLUSTER_PEER: ${CLUSTER_PEER}
1517
volumes:
1618
- ./prometheus:/etc/prometheus
1719
- ./data/prometheus:/prometheus
18-
- ./.charon/cluster-lock.json:/opt/charon/.charon/cluster-lock.json:ro
1920
entrypoint: /etc/prometheus/run.sh
2021
restart: unless-stopped
2122

docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,10 +183,11 @@ services:
183183
PROM_REMOTE_WRITE_TOKEN: ${PROM_REMOTE_WRITE_TOKEN}
184184
SERVICE_OWNER: ${SERVICE_OWNER}
185185
ALERT_DISCORD_IDS: "${ALERT_DISCORD_IDS}"
186+
CLUSTER_NAME: ${CLUSTER_NAME}
187+
CLUSTER_PEER: ${CLUSTER_PEER}
186188
volumes:
187189
- ./prometheus:/etc/prometheus
188190
- ./data/prometheus:/prometheus
189-
- ./.charon/cluster-lock.json:/opt/charon/.charon/cluster-lock.json:ro
190191
entrypoint: /etc/prometheus/run.sh
191192
restart: unless-stopped
192193

prometheus/prometheus.yml.example

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ scrape_configs:
3030
static_configs:
3131
- targets: ["mev-mevboost:18551","mev-boost:18551"]
3232
relabel_configs:
33-
- target_label: operator_id
34-
replacement: "$OPERATOR_PROMETHEUS_LABEL"
33+
- target_label: cluster_name
34+
replacement: "$CLUSTER_NAME"
35+
- target_label: cluster_peer
36+
replacement: "$CLUSTER_PEER"
3537
- job_name: "lodestar"
3638
static_configs:
3739
- targets: [ "lodestar:5064" ]

prometheus/run.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
if [ -z "$SERVICE_OWNER" ]
44
then
5-
if [ -f /opt/charon/.charon/cluster-lock.json ]; then
6-
export SERVICE_OWNER=$(cat /opt/charon/.charon/cluster-lock.json | jq -r '.lock_hash[2:9]')
5+
if [ -n "$CLUSTER_NAME" ] && [ -n "$CLUSTER_PEER" ]; then
6+
export SERVICE_OWNER="${CLUSTER_NAME}-${CLUSTER_PEER}"
77
else
88
export SERVICE_OWNER="unknown"
99
fi
@@ -18,7 +18,6 @@ fi
1818
sed -e "s|\$PROM_REMOTE_WRITE_TOKEN|${PROM_REMOTE_WRITE_TOKEN}|g" \
1919
-e "s|\$SERVICE_OWNER|${SERVICE_OWNER}|g" \
2020
-e "s|\$ALERT_DISCORD_IDS|${ALERT_DISCORD_IDS}|g" \
21-
-e "s|\$OPERATOR_PROMETHEUS_LABEL|${OPERATOR_PROMETHEUS_LABEL}|g" \
2221
/etc/prometheus/prometheus.yml.example > /etc/prometheus/prometheus.yml
2322

2423
/bin/prometheus \

0 commit comments

Comments
 (0)