Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Don't log collector errors #1050

wants to merge 1 commit into from

Conversation

SuperQ
Copy link
Contributor

@SuperQ SuperQ commented Jun 12, 2025

Avoid logging collector failures at Error level to avoid log spam.

Avoid logging collector failures at Error level to avoid log spam.

Signed-off-by: SuperQ <[email protected]>
@SuperQ SuperQ requested a review from sysadmind June 12, 2025 16:10
@@ -185,7 +185,7 @@ func execute(ctx context.Context, name string, c Collector, ch chan<- prometheus
if IsNoDataError(err) {
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)
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants