Hello, I checked docker-compose log, I don't see any error but I saw that it loads prometheus.yml file from here and NOT from my project. I should change this directory to load instead from my project and not from /etc/prometheus ?
prometheus_1 | 2021-04-12T09:34:28.726678910Z level=info ts=2021-04-12T09:34:28.726Z caller=main.go:850 msg="Loading configuration file" filename=/etc/prometheus/prometheus.yml Le vendredi 9 avril 2021 à 12:32:37 UTC+2, [email protected] a écrit : > 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 [email protected] > 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 [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/89f7a677-f276-4775-8bda-fa67abdfa576n%40googlegroups.com.

