Skip to content

Commit

Permalink
output a debug log if the requested path in the scrape config doesn't…
Browse files Browse the repository at this point in the history
… match any files (grafana#2069)

Signed-off-by: Ed Welch <[email protected]>
  • Loading branch information
slim-bean authored May 13, 2020
1 parent 11937d3 commit f206165
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/promtail/targets/filetarget.go
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ func (t *FileTarget) sync() error {
return errors.Wrap(err, "filetarget.sync.filepath.Glob")
}

if len(matches) == 0 {
level.Debug(t.logger).Log("msg", "no files matched requested path, nothing will be tailed", "path", t.path)
}

// Gets absolute path for each pattern.
for i := 0; i < len(matches); i++ {
if !filepath.IsAbs(matches[i]) {
Expand Down

0 comments on commit f206165

Please sign in to comment.