Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker - Prometheus container dies immediately

I have cadvisor running with port mapping 4000:8080 and I have to link it with a container with prometheus.

My prometheus.yml is:

scrape_configs:
# Scrape Prometheus itself every 2 seconds.
- job_name: 'prometheus'
  scrape_interval: 2s
  target_groups:
  - targets: ['localhost:9090', 'cadvisor:8080']

This file has path /home/test/prometheus.yml. To run the container with prometheus, I do:

docker run -d -p 42047:9090  --name=prometheus -v /home/test/prometheus.yml:/etc/prometheus/prometheus.yml  --link cadvisor:cadvisor prom/prometheus -config.file=/etc/prometheus/prometheus.yml -storage.local.path=/prometheus -storage.local.memory-chunks=10000 

The container is created, but it dies immediately. Can you tell me where the problem is?

Messages form docker events& :

2016-11-21T11:43:04.922819454+01:00 container start 69d03c68525c5955cc40757dc973073403b13fdd41c7533f43b7238191088a25 (image=prom/prometheus, name=prometheus)
2016-11-21T11:43:05.152141981+01:00 container die 69d03c68525c5955cc40757dc973073403b13fdd41c7533f43b7238191088a25 (exitCode=1, image=prom/prometheus, name=prometheus)
like image 754
SegFault Avatar asked Nov 21 '16 10:11

SegFault


1 Answers

Config format is changed. targets come under static_config in the latest version.

scrape_configs:
# Scrape Prometheus itself every 2 seconds.
  - job_name: 'prometheus'
  scrape_interval: 2s
  static_configs:
      - targets: ['localhost:9090', 'cadvisor:8080']

Prometheus Documentation for further help

like image 134
Anon Avatar answered Sep 28 '22 20:09

Anon