If you have an error in the config file, prometheus will just ignore the new config and stays with the old one, check the logs of the container and make sure there are not errors
On Friday, April 9, 2021 at 12:22:18 PM UTC+2 shutima.p...@geotwin.io wrote: > Hello all, > > I am new to Prometheus and docker-compose. I have a project structure with > docker-compose.yml file that setup Prometheus and Grafana: > "*/prometheus-grafana/prometheus/docker-compose.yml*" > > version: '3' > > services: > prometheus: > image: prom/prometheus:v2.21.0 > ports: > - 9000:9090 > volumes: > - ./prometheus:/etc/prometheus > - prometheus-data:/prometheus > command: --web.enable-lifecycle > --config.file=/etc/prometheus/prometheus.yml > > grafana: > image: grafana/grafana:$GRAFANA_VERSION > environment: > GF_SECURITY_ADMIN_USER: $GRAFANA_ADMIN_USER > GF_SECURITY_ADMIN_PASSWORD: $GRAFANA_ADMIN_PASSWORD > ports: > - 3000:3000 > volumes: > - grafana-storage:/var/lib/grafana > depends_on: > - prometheus > networks: > - internal > > networks: > internal: > > volumes: > prometheus-data: > grafana-storage: > > I just added more config in " > */prometheus-grafana/prometheus/prometheus/prometheus.yml*" like this, > the part that I added is yellow highlighted: > > global: > scrape_interval: 30s > scrape_timeout: 10s > > rule_files: > - alert.yml > > scrape_configs: > - job_name: services > metrics_path: /metrics > static_configs: > - targets: > - 'prometheus:9090' > - 'idonotexists:564' > - job_name: myapp > scrape_interval: 10s > static_configs: > - targets: > - localhost:2112 > > I started Prometheus by running: "docker-compose up -d", I got to > Prometheus on "http://localhost:9000/graph" but I don't see the new > config I added to "*prometheus.yml*", in docker-compose.yml file, there > is a line "*command: --web.enable-lifecycle > --config.file=/etc/prometheus/prometheus.yml*" Am I supposed to change > this to refers to the path of my another Prometheus.yml in my project? > > Thank you in advance. > > Rgds, > Shutima Potivorakun > -- You received this message because you are subscribed to the Google Groups "Prometheus Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/52bcdfe1-52fd-491b-af8d-74a7dffba933n%40googlegroups.com.