Skip to content

Commit 50cb8c0

Browse files
authored
fix: sed prometheus env vars (#331)
1 parent 9b4441e commit 50cb8c0

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

prometheus/prometheus.yml.example

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ global:
22
scrape_interval: 30s # Set the scrape interval to every 30 seconds.
33
evaluation_interval: 30s # Evaluate rules every 30 seconds.
44
external_labels:
5-
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
5+
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
66

77
remote_write:
88
- url: https://vm.monitoring.gcp.obol.tech/write
99
authorization:
10-
credentials: ${PROM_REMOTE_WRITE_TOKEN}
10+
credentials: $PROM_REMOTE_WRITE_TOKEN
1111
write_relabel_configs:
1212
- source_labels: [job]
1313
regex: "charon"
@@ -32,4 +32,4 @@ scrape_configs:
3232
- targets: ["node-exporter:9100"]
3333
- job_name: "cadvisor"
3434
static_configs:
35-
- targets: ["cadvisor:8080"]
35+
- targets: ["cadvisor:8080"]

prometheus/run.sh

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

33
if [ -z "$SERVICE_OWNER" ]
44
then
5-
echo "\$SERVICE_OWNER variable is empty"
5+
echo "\$SERVICE_OWNER variable is empty" >&2
6+
exit 1
67
fi
78

89
if [ -z "$PROM_REMOTE_WRITE_TOKEN" ]
@@ -11,8 +12,8 @@ then
1112
exit 1
1213
fi
1314

14-
15-
sed "s|\$PROM_REMOTE_WRITE_TOKEN|${PROM_REMOTE_WRITE_TOKEN}|g" \
15+
sed -e "s|\$PROM_REMOTE_WRITE_TOKEN|${PROM_REMOTE_WRITE_TOKEN}|g" \
16+
-e "s|\$SERVICE_OWNER|${SERVICE_OWNER}|g" \
1617
/etc/prometheus/prometheus.yml.example > /etc/prometheus/prometheus.yml
1718

1819
/bin/prometheus \

0 commit comments

Comments
 (0)