Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,12 @@ services:
image: prom/prometheus:${PROMETHEUS_VERSION:-v2.46.0}
user: ":"
networks: [dvnode]
environment:
PROM_REMOTE_WRITE_TOKEN: ${PROM_REMOTE_WRITE_TOKEN}
volumes:
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
- ./prometheus:/etc/prometheus
- ./data/prometheus:/prometheus
entrypoint: /etc/prometheus/run.sh
restart: unless-stopped

grafana:
Expand Down
File renamed without changes.
13 changes: 13 additions & 0 deletions prometheus/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/sh

if [ -z "$PROM_REMOTE_WRITE_TOKEN" ]
then
echo "\$PROM_REMOTE_WRITE_TOKEN variable is empty" >&2
exit 1
fi

sed "s|\$PROM_REMOTE_WRITE_TOKEN|${PROM_REMOTE_WRITE_TOKEN}|g" \
/etc/prometheus/prometheus.yml.example > /etc/prometheus/prometheus.yml

/bin/prometheus \
--config.file=/etc/prometheus/prometheus.yml