maxandersen / internet-monitoring

Monitor your network and internet speed with Docker & Prometheus
433 stars 105 forks source link

Promethous Storage Retention 15d #14

Closed JoJo-Joshua closed 2 years ago

JoJo-Joshua commented 3 years ago

Hey is there any way to change the Prometheus Storage Retention?

If so, how do I do that?

nickovivar commented 2 years ago

This is a default value in Prometheus so you need to modify the configuration. You can add to the docker-compose file this line: - '--storage.tsdb.retention.time=90d'

Here's an example:


services:
  prometheus:
    image: prom/prometheus:v2.0.0
    volumes:
      - ./prometheus/:/etc/prometheus/
      - prometheus_data:/prometheus
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--storage.tsdb.retention.time=90d'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'
    ports:
      - 9090:9090
    links:
      - ping:ping
      - speedtest:speedtest
    networks:
      - back-tier
JoJo-Joshua commented 2 years ago

Ah, perfect thank you I have now changed it with me. 🤗🥳