-
-
Notifications
You must be signed in to change notification settings - Fork 174
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No metrics prometheus-nginxlog-exporter! #358
Comments
Looks like the log format configured in your exporter configuration doesn't match the actual log files; pay attention to the double quotes and the additional fields at the end of the log lines. Hope that helps! |
Adjusted the log format in the prometheus-nginxlog-exporter.hcl config to match the format specified in /etc/nginx/nginx.conf /etc/nginx/nginx.conf
/etc/prometheus/prometheus-nginxlog-exporter.hcl
The log is written like this:
I restarted NGINX and the prometheus-nginxlog-exporter container, but it didn’t last long... in the container log 2023-10-24T13:36:16.760Z info prometheus-nginxlog-exporter/main.go:101 caught term terminated. exiting |
The problem was that when starting the container, monitoring was done in a directory inside the container which differs from the directory specified in the exporter configuration file
That is, the correct command to launch the container and mount the folder with logs should be
This is why there were entries in the container log that the exporter is waiting for files to appear
Please add this to the documentation! |
Hello, please help me figure out the reason for the lack of metrics
the exporter is installed in the container with the command
$ docker run -d --name nginxlog-exporter -p 4040:4040 -v /var/log/nginx:/mnt/nginxlogs -v /etc/prometheus/prometheus-nginxlog-exporter.hcl:/etc/prometheus-nginxlog-exporter.hcl quay.io/martinhelmich/prometheus-nginxlog-exporter -config-file /etc/prometheus-nginxlog-exporter.hcl
NGINX logs are configured like this:
As a result, I get statistics like this:
# HELP allnginx_parse_errors_total Total number of log file lines that could not be parsed
# TYPE allnginx_parse_errors_total counter
allnginx_parse_errors_total{vhost="all"} 0
allnginx_parse_errors_total{vhost="itscript.ru"} 0
# HELP prometheus_nginxlog_exporter_build_info A metric with a constant '1' value labeled by version, revision, branch, goversion from which prometheus_nginxlog_exporter was built, and the goos and goarch for the build.
# TYPE prometheus_nginxlog_exporter_build_info gauge
prometheus_nginxlog_exporter_build_info{branch="v1.11.0",goarch="amd64",goos="linux",goversion="go1.18.10",revision="76552e7cadc1f76b4e28b5c872412db4a091aca0",tags="unknown",version="1.11.0"} 1
In the docker container log
In the host access log
/var/log/nginx/access_itscript.ru.log
Exporter configuration file
/etc/prometheus/prometheus-nginxlog-exporter.hcl
Help me please!
The text was updated successfully, but these errors were encountered: