-
Notifications
You must be signed in to change notification settings - Fork 271
WIP: Add a mechanism to distribute textfile collectors alongside node_exporter binary #141
Conversation
801ed4b
to
c4b7f38
Compare
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.
I would prefer to use systemd timer units instead of cron. This would allow for more prometheus-like intervals to be set.
Something like OnActiveSec=30
tasks/configure.yml
Outdated
month: "{{ item.month | default(omit) }}" | ||
weekday: "{{ item.weekday | default(omit) }}" | ||
special_time: "{{ item.special_time | default(omit) }}" | ||
job: "{{ _node_exporter_binary_install_dir }}/{{ item.src | basename }} | sponge {{ node_exporter_textfile_dir }}/{{ item.src | basename }}.prom" |
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.
We need to make sure the moreutils
package is installed for sponge.
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.
Good point! 👍
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.
And of course moreutils
is not available in main CentOS repositories. Is there a way of doing this without sponge
or should I just add epel-release
repo when running on CentOS?
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.
Hrm, I don't know of a good sponge replacement that would be built-in to most distros.
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.
I found what sponge
is doing and it is achievable to do the same with basic linux tools.
Basically it writes what it receives on stdin to a temporary file and then renames temporary file to a target one. Which means we can do the same with mktemp && mv
. I'll create a POC during the weekend.
I was also thinking about doing it this way, but it would be much more complicated as you need 2 units (service and timer) and activate them after changes. Additionally, we would need to somehow surface those custom timer configs in yaml list and provide simple compatibility with cron. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
06d2406
to
dcca5f4
Compare
dcca5f4
to
d162a3d
Compare
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
Up! Does this PR need any help ? |
I am very interested in this feature. |
node_exporter_textfile_dir
in the alternative test scenario instead of default one. This is necessary due to how preflight checks are written.