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

json.Unmarshal failed #54

Closed xujpxm closed 6 years ago

xujpxm commented 6 years ago

Scraping information, i got log error: " json.Unmarshal failed invalid character '<' looking for beginning of value"

sysulq commented 6 years ago

Maybe you should looking for the contents returned from vts api. Mostly this error occurred when the contents are not json string.

xujpxm commented 6 years ago

Fixed when I added the arg "-nginx.scrape_uri http://127.0.0.1/status/format/json ". 👍

saclin commented 6 years ago

I added the arg "-nginx.scrape_uri http://127.0.0.1/nginx-status/format/json ". but get no json Active connections: 2 server accepts handled requests 18 18 72 Reading: 0 Writing: 1 Waiting: 1

which is exactly same as I use "-nginx.scrape_uri http://127.0.0.1/nginx-status/"

why???
thanks