ansible
ansible copied to clipboard
enhancement(node_exporter): use systemd to create node_exporter_textfile_dir if it doesn't exist
We're currently using a directory inside tmpfs for textfile collectors to reduce possible unnecessary IO usage, and the directory will be removed after a reboot. This PR is to ensure that node_exporter_textfile_dir exists when node-exporter is started.
I wonder if using systemd tmpfiles in this scenario would be a better solution? https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html
ping @ym
I wonder if using systemd tmpfiles in this scenario would be a better solution? https://www.freedesktop.org/software/systemd/man/latest/tmpfiles.d.html
ping @ym
External scripts will also need to write to node_exporter_textfile_dir, so I think a predictable and static path might be a better idea. But if you have any good suggestions, I'm all ears.
The path is not dynamic like what you get with mktemp, you define the path you wish to be created in a config file under tmpfiles.d and then systemd will take care of creating it.