Prometheusのデータ保持期間を延ばす

Prometheusのデータ保持期間を延ばす

docker-composeにcommand "--storage.tsdb.retention.time=168h" を追加する

#
# Prometheus
#
  prometheus:
    image: prom/prometheus
    container_name: prometheus
    volumes:
      - ./prometheus:/etc/prometheus
    command: 
      - "--config.file=/etc/prometheus/prometheus.yaml"
      - "--storage.tsdb.retention.time=168h"
    ports:
      - 9090:9090
    restart: always