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

can u provide a complete metrics for me ? #29

Closed dk900912 closed 6 years ago

dk900912 commented 7 years ago

Hi, hnlq715. Nginx has many metrics, but i only get 3 useful metrics :nginx_server_bytes、nginx_server_cache、nginx_server_connections. Is there some metrics i missed ? like nginx_uptime

sysulq commented 7 years ago

Sounds useful, I would add these metrics like uptime, version and so on... :-) And yes, you missed some metrics like upstreamZones

ivan-pinatti commented 6 years ago

Hi @hnlq715,

I agree with @dk900912, could you please add;

Without these I can't create alarms to check if Nginx container is running and/or has spontaneously rebooted.

Cheers!

bsushant-athena commented 6 years ago

👍 same here, I also can't create alarms to check if Nginx container is running and/or has spontaneously rebooted.

sysulq commented 6 years ago

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

bsushant-athena commented 6 years ago

@hnlq715 We are not able to plot the graph for the nginx uptime value as it is not the metric output but it is inside the tag. Is it possible for you expose the nginx uptime value as a separate metric?

sysulq commented 6 years ago

Refer to this link http://docs.grafana.org/features/datasources/prometheus/ You could get label value through label_values(metric, label)

bsushant-athena commented 6 years ago

@hnlq715 that is only possible in templating and that value does not update automatically. label_values(metric, label) this we can not use for metrics query.

sysulq commented 6 years ago

Alright, what about this?

nginx_server_info{hostName="localhost", nginxVersion="1.11.1"} 100

the value 100 is nginx's uptime

bsushant-athena commented 6 years ago

yes if this is possible then it will be really helpful. But currently it is not.

sysulq commented 6 years ago

@bsushant-athena please try the latest release.

bsushant-athena commented 6 years ago

@hnlq715 can you please provide the binary file for the latest release?

bsushant-athena commented 6 years ago

@hnlq715 that worked but the problem I see is that , if I put this metric in singlestat graph then it only shows the seconds ; ideally it should be like 60 seconds 60 minutes 24 hours then days and so on. is it possible to add these changes as well ? 🙏

sysulq commented 6 years ago

This should be done in grafana I think? Prometheus can not store string metrics.