Skip to content
This repository has been archived by the owner on Mar 6, 2023. It is now read-only.

WIP: Add a mechanism to distribute textfile collectors alongside node_exporter binary #141

Closed
wants to merge 1 commit into from

Conversation

paulfantom
Copy link
Member

  • propagate previously downloaded files (downloading is not in scope of this role as there are multiple ways to supply executable file, same goes for that file dependencies)
  • add preflight checks
  • add tests
  • test for existence of node_exporter_textfile_dir in the alternative test scenario instead of default one. This is necessary due to how preflight checks are written.
  • install cron in test preparation stage, but not in role
  • add extended playbook example

@paulfantom paulfantom force-pushed the textfile_collectors_propagation branch from 801ed4b to c4b7f38 Compare January 22, 2020 21:39
@github-actions github-actions bot added area/docs Improvements or additions to documentation area/tasks Logic behind ansible role area/tests Everything related to molecule tests and linters area/vars Ansible variables used in role labels Jan 22, 2020
Copy link
Collaborator

@SuperQ SuperQ left a 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

molecule/alternative/prepare.yml Show resolved Hide resolved
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"
Copy link
Collaborator

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! 👍

Copy link
Member Author

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?

Copy link
Collaborator

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.

Copy link
Member Author

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.

@paulfantom
Copy link
Member Author

I would prefer to use systemd timer units instead of cron.

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.

@stale
Copy link

stale bot commented Mar 9, 2020

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.

@stale stale bot added the wontfix This will not be worked on label Mar 9, 2020
@stale stale bot closed this Mar 23, 2020
@mergify mergify bot deleted the textfile_collectors_propagation branch March 23, 2020 15:04
@paulfantom paulfantom restored the textfile_collectors_propagation branch March 23, 2020 15:57
@paulfantom paulfantom reopened this Mar 23, 2020
@stale stale bot removed the wontfix This will not be worked on label Mar 23, 2020
@paulfantom paulfantom force-pushed the textfile_collectors_propagation branch from 06d2406 to dcca5f4 Compare April 24, 2020 09:32
@paulfantom paulfantom changed the title Add a mechanism to distribute textfile collectors alongside node_exporter binary WIP: Add a mechanism to distribute textfile collectors alongside node_exporter binary Apr 24, 2020
@github-actions github-actions bot added the area/jinja Templates label Apr 24, 2020
@paulfantom paulfantom force-pushed the textfile_collectors_propagation branch from dcca5f4 to d162a3d Compare April 24, 2020 09:34
@stale
Copy link

stale bot commented Jun 9, 2020

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.

@stale stale bot added the wontfix This will not be worked on label Jun 9, 2020
@paulfantom paulfantom mentioned this pull request Jun 18, 2020
@paulfantom paulfantom removed the wontfix This will not be worked on label Jun 18, 2020
@stale
Copy link

stale bot commented Aug 2, 2020

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.

@stale stale bot added the wontfix This will not be worked on label Aug 2, 2020
@stale stale bot closed this Aug 16, 2020
@erolg
Copy link

erolg commented Dec 21, 2020

Up! Does this PR need any help ?

@dorchain
Copy link

I am very interested in this feature.
Can you please reopen th ePR?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/docs Improvements or additions to documentation area/jinja Templates area/tasks Logic behind ansible role area/tests Everything related to molecule tests and linters area/vars Ansible variables used in role wontfix This will not be worked on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants