fix(inputs.system): Demote missing utmp debug log to trace#18911
Merged
Conversation
The 'Reading users: ... no such file or directory' message fires every gather interval on systems without /var/run/utmp (newer Ubuntu, distroless containers, etc.). The plugin already silently skips n_users and n_unique_users in this case, so the message is purely diagnostic noise for any user running with debug logging enabled. Demote only the os.IsNotExist branch to trace level. The os.IsPermission case stays at debug (actionable) and unexpected errors stay at warn.
Contributor
|
Download PR build artifacts for linux_amd64.tar.gz, darwin_arm64.tar.gz, and windows_amd64.zip. 📦 Click here to get additional PR build artifactsArtifact URLs |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
On systems without /var/run/utmp (newer Ubuntu, distroless containers, etc.), the users collection in inputs.system logs Reading users: ... no such file or directory every gather interval. The plugin already silently drops n_users / n_unique_users in this case, so the message is just diagnostic noise for anyone running with debug logging enabled.
This demotes that one log line (the os.IsNotExist branch) from debug to trace. The os.IsPermission case stays at debug (actionable) and unexpected errors stay at warn.
The include option added in #18533 will let users skip users entirely starting in v1.39.0, but the default config still gathers it, so the noise survives that change without this fix.
Checklist
Related issues
resolves #