-
Notifications
You must be signed in to change notification settings - Fork 374
Description
Is your feature request related to a problem? Please describe.
I scrape metrics from few nginx instances at the same time. Instances passes by few arguments '--nginx.scrape-uri=some_nginx/metrics'. And I get infinite messages in logs:
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
time=... level=ERROR source=nginx.go:57 msg="error getting stats" error="expected 200 response, got 502"
Likely the cause in one or few of my nginx instances, but I don't see from log which exactly. And this is the problem. And even log level change doesn't show more information.
Describe the solution you'd like
NginxCollector contains field nginxClient, which contains apiEndpoint. And I suggest to log apiEndpoint to error message at error log level.
Describe alternatives you've considered
Or log apiEndpoint to error message at debug log level.
Additional context
Found on nginx-prometheus-exporter:1.4.0. Used in docker container in docker swarm.