docker run -it -d --name prometheus -p 9090:9090  -v /home/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v /home/prometheus:/prometheus dockertest2.io:12000/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9090" --web.enable-lifecycle




docker run -it -d --name prometheus -p 9090:9090  -v /home/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml -v /home/prometheus:/prometheus --link cadvisor:cadvisor dockertest2.io:12000/prometheus:latest --config.file=/etc/prometheus/prometheus.yml --web.listen-address="0.0.0.0:9090" --web.enable-lifecycle




---------- prometheus reload ----------------

t@workstation:/home/edu3/prometheus-2.3.2.linux-amd64# curl -X POST http://localhost:9090/-/reload

level=info ts=2018-07-13T05:25:49.600841981Z caller=main.go:603 msg="Loading configuration file" filename=prometheus.yml

level=info ts=2018-07-13T05:25:49.601703886Z caller=main.go:629 msg="Completed loading of configuration file" filename=prometheus.yml

--------------------------------------------------------------

prometheus.yml

# my global config
global:
  scrape_interval:     15s # Set the scrape interval to every 15 seconds. Default is every 1 minute.
  evaluation_interval: 15s # Evaluate rules every 15 seconds. The default is every 1 minute.
  # scrape_timeout is set to the global default (10s).

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

# Load rules once and periodically evaluate them according to the global 'evaluation_interval'.
rule_files:
  # - "first.rules"
  # - "second.rules"

# 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'

    # metrics_path defaults to '/metrics'
    # scheme defaults to 'http'.

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

  - job_name: 'docker'
         # metrics_path defaults to '/metrics'
         # scheme defaults to 'http'.

    static_configs:
      - targets: ['localhost:9323']


[참고용]

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 -log.level=debug -storage.local.path=/prometheus -storage.local.memory-chunks=10000

+ Recent posts