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

exporter does not work for mulitple nginx instances #55

Closed bsushant-athena closed 6 years ago

bsushant-athena commented 6 years ago

Hi,

We have 2 nginx instances (with nginx-vts module installed) setup to serve the traffic.

We have setup one nginx-vts-exporter and configured it to scrape the metrics from "/status/format/json" endpoint.

Observation: metrics exposed from "/metrics" endpoint of nginx-vts-exporter doesn't include the information about the nginx instance from which the information was grabbed. Hence we are not able to plot the metrics against the nginx instance say in grafana/prometheus.

Does nginx-vts-exporter support to track metrics from multiple nginx instances? or Do we need to configure it differently to support multiple nginx instances setup?

VTS version: 0.1.14 nginx version: 1.12.0

for single instance of nginx we are getting proper data but for multiple it is causing issues. Please help us asap!

sysulq commented 6 years ago

nginx-vts-exporter does not support multiple instances right now. You need to run one exporter per nginx instance.

bsushant-athena commented 6 years ago

In my case I have two instances of nginx and on top of that we have load balancer which chooses the nginx instance in round robin fashion so I can not hard code(id:port) or point to particular nginx instance. Then how do I add two separate nginx vts exporters for two instances of nginx?

sysulq commented 6 years ago

You should use exporter to connect nginx instance directly, instead of the load balancer.

bsushant-athena commented 6 years ago

ok so to resolve this issue we have added nginx its exporter inside our nginx and now we get the required correct data.

bsushant-athena commented 6 years ago

@hnlq715 One other question I've is , this module does not provide any uptime data but when I hit /status I could see the metrics there ; it is just exporter is not exposing . @hnlq715 can you take this as an enhancement ?

sysulq commented 6 years ago

yes, pull request is welcome:)

bsushant-athena commented 6 years ago

I'm not familiar with go language , could you please do that and release a new version ? That will be really helpful :)

sysulq commented 6 years ago

No problem, I would take it into consideration. Thanks for your advise 😄

29 also discussed this topic.

sysulq commented 6 years ago

Server info metrics added, and readme docs updated, please check the latest docker image.