For the moment the disk plugin report wrong measurements on btrfs filesystems. The issue isn't apparent until your the partition become full, here is relevant article from the btrfs's wiki. To get the proper size we should use a method similar to btrfs fi df instead of the df way.
The quicker way would be to fix this in the disk plugin but having a separated plugin like zfs seems the way to go since btrfs have a lot more features than usual filesystems.
I created this python script to capture some btrfs stats in telegraf. I haven't done anything for df yet but should be possible. Take a look at this and see if this is useful for you.
@clara-j Thanks for the link, this could be quite useful in writing a plugin. Can you add a license to the repo?
Sure I will update the license. I hadn't even thought of that. I was thinking of taking what I learned here and working on a plugin but at the moment I don't have any familiarity with go or how to build telegraf. But once I have this working properly I will look into it.
Cool, one thing I wonder (doing 0 research) is if it is possible to get these stats through procfs. This would perform quite a bit better than running the cli tools. If not I suggest taking a look at the unbound input for a basic structure.
I also have done 0 research. Only started using telegraf 2 days ago and decided to build this in python last night to learn that too since hadn't used it before either. I think some, if not all, stats may be available through /sys/fs/btrfs/ but haven't looked into it to make sense of it.
Thanks for the tip on unbound input.
I have made an update to now support btrfs filesystem usage/df
Will make sure everything is working well and if so I will start looking into making a plugin.
Most helpful comment
I have made an update to now support btrfs filesystem usage/df
Will make sure everything is working well and if so I will start looking into making a plugin.