-
Notifications
You must be signed in to change notification settings - Fork 810
Don't log collector errors #1050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
collector/collector.go
Outdated
| logger.Debug("collector returned no data", "name", name, "duration_seconds", duration.Seconds(), "err", err) | ||
| } else { | ||
| logger.Error("collector failed", "name", name, "duration_seconds", duration.Seconds(), "err", err) | ||
| logger.Debug("collector failed", "name", name, "duration_seconds", duration.Seconds(), "err", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Error is the right level here. It really is an error.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's not normal for collectors to error, we have success metrics to let users know that individual collectors fail.
We don't want scrapes to generate logs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Users often go to the logs when things aren't working as expected. We have metrics that say was successful or failed, but that doesn't tell you the why. That's what the logs are for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still pretty standard for exporters to not log individual scrape errors due to the amount of noise that generates.
At a minimum, this should probably be Warn, since it's not fatal to the scrape itself.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would be happy to agree on Warn
Avoid logging collector failures at Error level to avoid log spam. Signed-off-by: SuperQ <superq@gmail.com>
ab6089d to
a690241
Compare
Avoid logging collector failures at Error level to avoid log spam. Signed-off-by: SuperQ <superq@gmail.com>
Avoid logging collector failures at Error level to avoid log spam. Signed-off-by: SuperQ <superq@gmail.com> Signed-off-by: pincher95 <yuri.tsuprun@logz.io>
Avoid logging collector failures at Error level to avoid log spam.