Issue#1
When using heartbeat.config.monitors to load monitors from files in a directory and one of the files has an invalid config, I get the following log:
heartbeat | 2019-01-21T19:38:10.306Z ERROR cfgfile/reload.go:223 Error loading config: invalid config: yaml: line 17: mapping values are not allowed in this context
This log doesn't tell me which file has the invalid config; it can be very hard to locate the problematic file when there're many files in the heartbeat.config.monitors.path especially when the files are generated by script.
Solution:
Include the absolute path of the config file in the log.
Bonus:
In addition to reporting the absolute path of the config file, include a unique identifier for the specific monitor causing the issue in the event there are multiple monitors defined in a config file.
Issue#2
When a Heartbeat monitor is disabled, the following log is constantly being emitted:
heartbeat | 2019-01-21T21:18:54.984Z ERROR [reload] cfgfile/list.go:96 Error creating runner from config: Monitor not loaded, plugin is disabled
Three problems with this issue:
- This log should have an
INFO log-level not an ERROR log-level since enabling and disabling a monitor are most likely done intentionally in the config file.
- The fact that this log is emitted constantly is not necessary and can hide some other important logs and it would be better to log it just once as an
INFO log-level.
- Same as issue#1, config file path is missing especially in the event when multiple config files are used.
Issue#1
When using
heartbeat.config.monitorsto load monitors from files in a directory and one of the files has an invalid config, I get the following log:This log doesn't tell me which file has the invalid config; it can be very hard to locate the problematic file when there're many files in the
heartbeat.config.monitors.pathespecially when the files are generated by script.Solution:
Include the absolute path of the config file in the log.
Bonus:
In addition to reporting the absolute path of the config file, include a unique identifier for the specific monitor causing the issue in the event there are multiple monitors defined in a config file.
Issue#2
When a Heartbeat monitor is disabled, the following log is constantly being emitted:
Three problems with this issue:
INFOlog-level not anERRORlog-level since enabling and disabling a monitor are most likely done intentionally in the config file.INFOlog-level.