Skip to content
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

Warning when not using globs #406

Open
ThisIsMissEm opened this issue Dec 18, 2024 · 0 comments
Open

Warning when not using globs #406

ThisIsMissEm opened this issue Dec 18, 2024 · 0 comments
Labels

Comments

@ThisIsMissEm
Copy link

Describe the bug

When we've been working with prometheus-nginxlog-exporter on the hachyderm.io infrastructure, we kept seeing the log line:

warn        config/struct_namespace.go:98        No globs for /var/log/nginx/access.log

Which felt like something we should pay attention to, but upon reading the code it seems like this is actually an expected condition? https://github.com/martin-helmich/prometheus-nginxlog-exporter/blob/master/pkg/config/struct_namespace.go#L89-L101

To Reproduce

Use configuration such as:

listen {
  port = 4040
  metrics_endpoint = "/metrics"
}

namespace "example" {
  source = {
    files = [
      "/var/log/nginx/access.log"
    ]
  }

  format = "$remote_addr - $remote_user [$time_local] \"$request\" $status $body_bytes_sent \"$http_referer\" \"$http_user_agent\" rt=$request_time urt=$upstream_response_time"

  labels {
    app = "example"
  }

  metrics_override = { prefix = "nginxlog" }
  namespace_label = "server"
}

Expected behavior

The warning should be reduced to an info level log line, since it doesn't actually indicate that something went wrong.

Environment:

  • Exporter version:
prometheus-nginxlog-exporter, version  (branch: , revision: unknown)
  build user:       
  build date:       
  go version:       go1.21.1
  platform:         linux/amd64
  tags:             unknown
  • OS (e.g. from /etc/os-release): Arch Linux
  • Deployment method (e.g. Docker image, deb/rpm package, self-compiled, ...): AUR
  • Others:
$ pacman -Qe prometheus-nginxlog-exporter 
prometheus-nginxlog-exporter 1.11.0-1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant