Skip to content

Metrics not appearing on /metrics page #404

Open
@yusi1

Description

@yusi1

Describe the bug
Metrics do not appear on the /metrics page in <server-ip>/metrics. Even when the regex for the log file is correct in both the configuration for the exporter and the NGINX log format.

To Reproduce

Expected Behaviour
More metrics appear in /metrics.

Metrics output (remove section, if not applicable):

# HELP nginx_parse_errors_total Total number of log file lines that could not be parsed
# TYPE nginx_parse_errors_total counter
nginx_parse_errors_total 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

Exporter output (remove section, if not applicable):

From CLI:

2024-11-12T22:20:30.147Z	info	prometheus-nginxlog-exporter/main.go:162	loading configuration file /etc/prometheus-nginxlog-exporter.hcl
2024-11-12T22:20:30.147Z	warn	config/struct_namespace.go:98	No globs for /var/log/nginx/sitename-access.log
2024-11-12T22:20:30.147Z	info	prometheus-nginxlog-exporter/main.go:139	starting listener for namespace nginx
2024-11-12T22:20:30.147Z	info	prometheus-nginxlog-exporter/main.go:148	running HTTP server on address 0.0.0.0:4040, serving metrics at /metrics

From /metrics:

# HELP nginx_parse_errors_total Total number of log file lines that could not be parsed
# TYPE nginx_parse_errors_total counter
nginx_parse_errors_total 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

Environment:

  • Exporter version: (branch: v1.11.0, revision: 76552e7cadc1f76b4e28b5c872412db4a091aca0)
  • OS (e.g. from /etc/os-release): openSUSE Tumbleweed
  • Deployment method (e.g. Docker image, deb/rpm package, self-compiled, ...): rpm package

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions