Prometheus 永続化の設定

やったこと

  1. Prometheusのdata folderを見つける
docker exec prometheus ls /
LICENSE
NOTICE
bin
dev
etc
home
lib
npm_licenses.tar.bz2
proc
prometheus
root
sys
tmp
usr
var
  1. docker compose の volumesの設定
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    volumes:
      - ./prometheus:/etc/prometheus
      - ./docker/prometheus:/prometheus/data
  1. 所有権の変更
sudo chown nobody prometheus