-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
fix(inputs.systemd_units): Revert to only gather loaded units by default #15108
fix(inputs.systemd_units): Revert to only gather loaded units by default #15108
Conversation
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.
Thanks for jumping on this. As a PR this looks fine, but I'm still concerned that the usage is still higher than it used to be. Do we need to have this new method be opt-in?
3043413
to
232654d
Compare
@1tft FYI: This PR disables collection of non-loaded/disabled units by default, so in case you need them please use the new |
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.
Thank you - one question about a println statement?
@srebhan Thank you so much for keeping that feature alive. With this build and |
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 |
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.
Thank you!
Summary
With PR #14814 we also produce metrics for unloaded units. However, for unspecific filters (like
*
being the default) this touches a lot of files and forces systemd to lookup those unit-files which is expensive.Therefore, this PR reverts the behavior to pre-v1.30.0 versions and only collects units already loaded by systemd. To allow collecting disabled/unloaded units you can use the new
collect_disabled_units
.Additionally to this change, the PR also optimizes the interaction with systemd for cases where non-detailed metrics are requested.
This leads to the following improvements when gathering all units (
pattern = "*"
) in non-detailed modeChecklist
Related issues
resolves #15104
resolves #15093