- create a snapshot of the db
curl -XPOST http://${PROMETHEUS_IP}:8080/api/v1/admin/tsdb/snapshot
- get the prometheus database
tar cvf prometheus.tar /prometheus/snapshots
- create a fake prometheus config so it does not complain
- init the container mounting the folder with the metrics
$ tar xvf prometheus.tar
prometheus/snapshots/
prometheus/snapshots/20210413T203151Z-3f4863bc7872c82f/
$ docker run --rm -p 9090:9090 -uroot \
-v $PWD/prometheus/snapshots/20210413T203151Z-3f4863bc7872c82f:/prometheus \
-v $PWD/prometheus.yml:/prometheus/prometheus.yml \
prom/prometheus --storage.tsdb.path=/prometheus
- bonus use grafana (admin:admin) and add prometheus as source
docker run -d -p 3000:3000 grafana/grafana