medic / cht-watchdog

Configuration for deploying a monitoring/alerting stack for CHT
GNU Affero General Public License v3.0
4 stars 7 forks source link

The data retention in medic monitoring is not working it is taking the default value of 2 months even though i changed the value to 6m in Prometheus image #92

Open vyshakssekhar opened 1 year ago

vyshakssekhar commented 1 year ago
prometheus:
    image: prom/prometheus:${PROMETHEUS_VERSION:-latest}
    ports:
      - "${PROMETHEUS_BIND:-127.0.0.1}:${PROMETHEUS_PORT:-9094}:9090"
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'
      - '--storage.tsdb.path=/prometheus'
      - '--storage.tsdb.retention.time=${PROMETHEUS_RETENTION_TIME:-6m}'
      - '--web.console.libraries=/usr/share/prometheus/console_libraries'
      - '--web.console.templates=/usr/share/prometheus/consoles'

This is just a part of the docker-compose I'm provided from medic using where Prometheus image is used, here in the data retention part I have specified it as 6m but it is not taking that whenever more than 2 months of data comes it deletes the remaining data.I need at least 6 months of data to be there. so what to do

mrjones-plip commented 1 year ago

hi @vyshakssekhar - thanks for your inquiry!

I've moved your ticket from CHT Core to CHT Watchdog, as that's what you're asking about.

The correct way to do this is not edit the compose file, but instead edit the .env file and change this:

PROMETHEUS_RETENTION_TIME=60d

to this:

PROMETHEUS_RETENTION_TIME=180d

Assuming you have just one compose file and haven't added more compose files, shutdown with docker compose down and then start it up with docker compose up -d and then check live config at of promtheus if possible. If you're running it locally it'll be at http://localhost:9090/status:

image