-
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
enhancement - inputs/system/diskio_linux - configurable udev data path #3900
Comments
@danielnelson - although i'm new to go, I think I could throw a pr your way if you'd let me know what the expectations would be on the testing side. I think that the current implementation fails gracefully enough since ENOENT/EACCESS/etc get propagated already (obvs), and don't cause any uncontained instability as far as I can tell. I think it's a one-line addition to the DiskIO Type to relocate the module-scoped var into the config if I'm reading things right. The rest would be updating the info cache population to pull from the config type instead of the module-scoped var. I'd be pleased as punch to squish this one unless other plans are in the mix. |
I don't think we need to worry that much about testing right now as that would require a fair bit of refactoring to do right and this is a pretty low risk change. What you are proposing will work fine, just make sure that if the new variable |
Could we build a hardcoded fallback in that uses the Or is the overhead of running twice the amount of stat/read calls for those older systems prohibitive for implementing it this way? |
I think the fallback idea would work too, it won't cost anything for those on platforms where the initial path works and it wouldn't be very expensive in the alternative case. |
I've had a better idea, can't we just instead rely on the Reference:
|
The performance is quite a bit worse running |
i've obviously lost my emotional stake in this bug (wound up switching OS for unrelated reasons) |
Quite a few Telegraf input plugins are based on gopsutil, which has this pattern of using HOST_PROC, HOST_RUN, HOST_VAR environment variables for defining where directories are located. Would it make sense to copy that logic for this, too? |
In this case its not a problem of adding a prefix path, the file has just completely changed locations, so I don't think we want to use the environment variables here. The #5180 pr is on the right track just needs a few tweaks to be ready. |
@danielnelson I've got this new PR that should be a lot cleaner. I'm leaving the older one open for now so you can have your pick basically. |
from the nightly commit 76ce71f, the linux diskio plugin collects its info cache from a hard-coded path:
telegraf/plugins/inputs/system/diskio_linux.go
Line 17 in 76ce71f
this seems to vary by distribution - on amzn-linux 1 at least, this is available in
/dev/.udev/data
, and cannot be configured via udevd. Here's the base AMI I'm using:The text was updated successfully, but these errors were encountered: