Because of the strange default settings in the Sametime V12.0.2 Docker configuration, all changes in Grafana and Prometheus are gone after you bring the docker containers down and/or when you restart the server.

By default, HCL decided that Grafana stores information inside the container.
By default, HCL decided that Prometheus data is stored on the host in /tmp/prometheus

When you bring down the Docker containers, Grafana information is gone.
When you restart the entire server, /tmp is cleared and therefor all statistics

Prometheus issue is easy to solve, just change the local path to another location outside /tmp
Grafana also need a local, or Docker storage, outside it’s own container.

This is the strange default docker-compose.yml file delivered by HCL ( only 2 parts of it ):

prometheus:
  image: prom/prometheus:latest
  user: root
  profiles:
    - monitoring
  volumes:
    - /tmp/prometheus:/prometheus
    - ./prometheus.yml:/etc/prometheus/prometheus.yml
  command:
    - '--config.file=/etc/prometheus/prometheus.yml'
  networks:
    sametime.test:


grafana:
  image: grafana/grafana
  user: root
  profiles:
    - monitoring
  depends_on:
    - prometheus
  ports:
    - 3001:3000
  volumes:
    - ./grafana/provisioning/:/etc/grafana/provisioning/
  env_file:
    - ./monitoring.env
  networks:
    sametime.test:
  restart: always

Create 2 mounts or folders on you Docker host:

/data/prometheus
/data/grafana

For Prometheus you change the following lines in docker-compose.yml in the prometheus section:

volumes:
  - /tmp/prometheus:/prometheus

to

volumes:
  - /data/prometheus:/prometheus   



For Grafana you have to change the following lines in docker-compose.yml in the grafana section:

volumes:
  - ./grafana/provisioning/:/etc/grafana/provisioning/

to

volumes:
  - ./grafana/provisioning/:/etc/grafana/provisioning/
  - /data/grafana:/var/lib/grafana


Now just restart prometheus and grafana

docker-compose -f docker.compose.yml down grafana
docker-compose -f docker.compose.yml down prometheus

docker-compose -f docker.compose.yml up -d grafana
docker-compose -f docker.compose.yml up -d prometheus



Visits: 64

By angioni

Leave a Reply

Your email address will not be published. Required fields are marked *

Time limit is exhausted. Please reload CAPTCHA.