elleryq
9/18/2015 - 3:07 PM

docker + node-exporter + prometheus + promdash

docker + node-exporter + prometheus + promdash

# This file should place in conf/
global:
  scrape_interval:     15s # By default, scrape targets every 15 seconds.
  evaluation_interval: 15s # By default, scrape targets every 15 seconds.
  # scrape_timeout is set to the global default (10s).

  # Attach these extra labels to all timeseries collected by this Prometheus instance.
  labels:
    monitor: 'cyrix200-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: 'prometheus'

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

    target_groups:
      - targets: ['localhost:9090']

  - job_name: 'node-exporter'
    scrape_interval: 15s
    target_groups:
      - targets: ['nodeexporter:9100']
# Need to do the following steps:
#  1. create /var/prometheus first.
#  2. run: docker-compose run promdash ./bin/rake db:migrate
nodeexporter:
  image: prom/node-exporter
  ports:
    - "9100:9100"

prometheus:
  image: prom/prometheus
  ports:
    - "9090:9090"
  volumes:
    - "/var/prometheus:/prometheus"
    - "${PWD}/conf:/etc/custom"
  links:
    - nodeexporter
  entrypoint: /bin/prometheus
  command: "-config.file=/etc/custom/prometheus.yml -storage.local.path=/prometheus -web.console.libraries=/etc/prometheus/console_libraries -web.console.templates=/etc/prometheus/consoles"

promdash:
  image: prom/promdash
  ports:
    - "3000:3000"
  environment:
    - DATABASE_URL=sqlite3:/var/prometheus/file.sqlite3
  volumes:
    - "/var/prometheus:/var/prometheus"
    - /tmp/prom:/tmp/prom
  links:
    - prometheus
    - nodeexporter