Skip to content

Heartbeat Logging Improvements #10231

@Alsheh

Description

@Alsheh

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:

  1. 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.
  2. 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.
  3. Same as issue#1, config file path is missing especially in the event when multiple config files are used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions