sysulq / nginx-vts-exporter

Simple server that scrapes Nginx vts stats and exports them via HTTP for Prometheus consumption
https://sysulq.github.io/nginx-vts-exporter/
MIT License
645 stars 142 forks source link

[ Question ]How to define the job in prometheus.yml? #28

Closed regardfs closed 7 years ago

regardfs commented 7 years ago

Hi, I find there few doc about how to implement this in prometheus, below is my configuration prometheus.yml

- job_name: 'nginx-exporter' scrape_interval: 15s static_configs:

  • targets: ["http://172.17.15.101/status/format/json"] relabel_configs:
  • sourcelabels: [__address_\] regex: (^http://.*) target_label: __param_target
  • source_labels: [__param_target] target_label: host
  • source_labels: [] regex: .* targetlabel: __address_\ replacement: 172.17.15.101:9913

docker-compose.yml

nginx-exporter: image: sophos/nginx-vts-exporter ports: - 9913:9913 environment: NGINX_HOST: "http://172.17.15.101/status/format/json"

Thanks a ton....T T, wait for u help.

sysulq commented 7 years ago

targets in prometheus.yml should be the address of nginx-vts-exportor. For example

 - targets: ["http://172.17.15.101:9913"]