Skip to content

Commit e374216

Browse files
authored
feat: add cluster_name and cluster_peer labels to Prometheus metrics (#277)
Move cluster_name and cluster_peer from mev-boost relabel_configs to global external_labels so all metrics (charon, mev-boost) include these identity labels. Also add the missing sed substitutions in run.sh that were preventing the variables from being rendered.
1 parent f1f136d commit e374216

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

prometheus/prometheus.yml.example

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ global:
33
evaluation_interval: 30s # Evaluate rules every 30 seconds.
44
external_labels:
55
service_owner: $SERVICE_OWNER # replace this with your Operator name you want to be identified by, it helps us route alerts and metrics to your notification channels easily
6+
cluster_name: $CLUSTER_NAME
7+
cluster_peer: $CLUSTER_PEER
68

79
remote_write:
810
- url: https://vm.monitoring.gcp.obol.tech/write
@@ -32,11 +34,6 @@ scrape_configs:
3234
- job_name: "mev-boost"
3335
static_configs:
3436
- targets: ["mev-mevboost:18551","mev-boost:18551"]
35-
relabel_configs:
36-
- target_label: cluster_name
37-
replacement: "$CLUSTER_NAME"
38-
- target_label: cluster_peer
39-
replacement: "$CLUSTER_PEER"
4037
- job_name: "lodestar"
4138
static_configs:
4239
- targets: [ "lodestar:5064" ]

prometheus/run.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ fi
1717

1818
sed -e "s|\$PROM_REMOTE_WRITE_TOKEN|${PROM_REMOTE_WRITE_TOKEN}|g" \
1919
-e "s|\$SERVICE_OWNER|${SERVICE_OWNER}|g" \
20+
-e "s|\$CLUSTER_NAME|${CLUSTER_NAME}|g" \
21+
-e "s|\$CLUSTER_PEER|${CLUSTER_PEER}|g" \
2022
-e "s|\$ALERT_DISCORD_IDS|${ALERT_DISCORD_IDS}|g" \
2123
/etc/prometheus/prometheus.yml.example > /etc/prometheus/prometheus.yml
2224

0 commit comments

Comments
 (0)