grok_exporter
grok_exporter copied to clipboard
grok exporter not reading the new log file after moving directory
In our environment we use grok exporter to monitor the application log file and report metrics.
We face problem when we deploy the new application. During the deployment the existing application home directory will be moved to application.previous and new application home directory will get create.
After the deployment grok exporter not reading the new log file and we have to restart the grok exporter evert time after the deployment.
global: config_version: 3
server: protocol: http port: 7250
input: type: file readall: false # Read from the beginning of the file? False means we start at the end of the file and read only new lines. fail_on_missing_logfile: true
True, this happens because grok_exporter uses the directory to learn when a logfile is moved, and this will fail if the directory is gone. It's hard to fix this. Restarting grok_exporter sounds like a good workaround.