prometheus docker image could not scrape the target

374 views
Skip to first unread message

cben...@gmail.com

unread,
Jun 23, 2017, 12:44:41 AM6/23/17
to Prometheus Users
Hi There,
I am using the prometheus docker image. 
With the docker image seems that the target scrape is failing.

Below is my prometheus.yml configuration file.

global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.

  # Attach these labels to any time series or alerts when communicating with
  # external systems (federation, remote storage, Alertmanager).
  external_labels:
    monitor: 'codelab-monitor'

# A scrape configuration containing exactly one endpoint to scrape:
# Here it's Prometheus itself.
scrape_configs:
  # The job name is added as a label `job=<job_name>` to any timeseries scraped from this config.
  - job_name: 'client-service-metrics'

    # Override the global default and scrape targets from this job every 5 seconds.
    scrape_interval: 5s

    static_configs: 
      - 
        targets: 
          - "10.3.112.80:8080"
          - "10.3.112.81:8080"
          - "10.4.176.80:8080"
          - "10.4.176.81:8080"


Here is my docker run command:

docker run -it --rm -p 9090:9090 -v /Users/naveen/workspace/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml prom/prometheus

However the same configuration file work without any issue in my local installation pf prometheus.
To add further i am unable to get into the prometheus container using the "docker exec" command as well, Hence i could not check if the targets are reachable from the container or not.


Ionut Ilie

unread,
Jun 26, 2017, 2:54:49 AM6/26/17
to Prometheus Users, cben...@gmail.com
Hi, 

The official image is built "from busybox" and you can into the container.

for kubectl the command is : kubectl exec <POD NAME> -i -t busybox sh

for docker it is similar but the order it is a little different. and to be sincerely i can't remember :)

vim...@gmail.com

unread,
Jul 7, 2017, 5:20:12 AM7/7/17
to Prometheus Users, cben...@gmail.com
Hi
How did you solve this problem?
Thank You
Vimal
Reply all
Reply to author
Forward
0 new messages