Skip to content

Warning when not using globs #406

Open
@ThisIsMissEm

Description

@ThisIsMissEm

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions