Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 this issue Sep 28, 2023 · 1 comment

Comments

@vyshakssekhar
Copy link

vyshakssekhar commented Sep 28, 2023

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 mrjones-plip transferred this issue from medic/cht-core Sep 28, 2023
@mrjones-plip
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants