Closed rothgar closed 7 years ago
I just started the same two containers on my local host manually and didn't have the same issue. There must be something different about when running these containers in kubernetes that isn't working.
If I exec into the vts-exporter pod I can curl localhost/status/format/json
without issue. I'm still trying to figure out what the issue is.
So it appears that the NGINX_HOST isn't getting set in the dockerfile. When I look at the running process in the container I can see the uri doesn't have the $NGINX_HOST variable
nginx-vts-exporter -nginx.scrape_uri=/status/format/json -telemetry.address :9913 -telemetry.endpoint /metrics -metrics.namespace nginx
I tried setting NGINX_HOST but it still didn't pick it up in the entrypoint script. I then set NGINX_STATUS to the full uri http://localhost/status/format/json
and this works now.
I'm not exactly sure why this wouldn't work in kubernetes but works in vanilla docker but I figured out a way to get it to work. Closing this now and hopefully someone else can reference it in the future.
I have nginx with vts and using the exporter I see this in the logs
I can manually go to the /status/format/json endpoint and see the json data. Here's a sample
The metrics endpoint only shows
I'm still troubleshooting but wanted to open an issue as there appears to be some configuration I've set up that doesn't work.