Skip to content

Logging improvements #2

@cjonesy

Description

@cjonesy

More specific log lines

The logging from Anemometer does not tell you which monitor is writing to the log:

2020/05/28 09:26:32 INFO: Sleeping for 300 seconds
2020/05/28 09:26:32 INFO: Sleeping for 300 seconds
2020/05/28 09:26:32 INFO: Sleeping for 300 seconds

The logs should look something like this:

2020/05/28 09:26:32 INFO: [my-first-monitor] Sleeping for 300 seconds
2020/05/28 09:26:32 INFO: [my-second-monitor] Sleeping for 300 seconds
2020/05/28 09:26:32 INFO: [my-other-monitor] Sleeping for 300 seconds

Debug Mode

I'd also like to see the ability to enable debug logging that would log each time a metric is pushed to datadog.

I imagine the output with debug enabled would look something like this:

2020/05/28 09:26:32 DEBUG: [my-first-monitor] Publishing metric - Name: my.first.metric, Value: 1, Tags: ["my:tag", "other:tag"]
2020/05/28 09:26:32 INFO: [my-first-monitor] Sleeping for 300 seconds
2020/05/28 09:26:32 DEBUG: [my-second-monitor] Publishing metric - Name: my.second.metric, Value: 1.9999, Tags: ["my:tag", "other:tag"]
2020/05/28 09:26:32 INFO: [my-second-monitor] Sleeping for 300 seconds
2020/05/28 09:26:32 DEBUG: [my-other-monitor] Publishing metric - Name: my.other.metric, Value: 1, Tags: ["my:tag", "other:tag"]
2020/05/28 09:26:32 INFO: [my-other-monitor] Sleeping for 300 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions