add serf reporter by https://github.com/patrickviet#82
add serf reporter by https://github.com/patrickviet#82jschaul wants to merge 8 commits intoairbnb:masterfrom
Conversation
|
Hello. Yea sorry about the contributing guidelines, I'm fixing them in #83 As for this PR, at the minimum we need some documentation in the README about what the parameters to this reporter are. It seems that it has an external dependency on serf running on the same box, which is cool (I haven't worked with serf but I grok it does registrations somewhere for you), but that needs to be documented too. I'll comment inline on the diff itself. |
lib/nerve/reporter/serf.rb
Outdated
| FileUtils.touch @config_file if File.exists? @config_file | ||
| sleep 2 | ||
| must_hup = false | ||
| oldest = Time.new.to_i - 3 |
There was a problem hiding this comment.
This seems really jank to me because anything that assumes time works is usually a bad design (i.e. you have no guarantee when you'll be scheduled or that Time.new.to_i is at all monotonic). Can we do this with logical clocks somehow?
There was a problem hiding this comment.
You are right about this being bad design. This cleanup thread is not strictly necessary, as that cleanup of files is only necessary if services get renamed or removed from the nerve configuration. I added a note to the README that people should ensure to wipe the configuration directory through configuration management on changes to service names.
It will be up to the provisioning code to ensure no unnecessary files are left in that folder.
8573b60 to
4a56103
Compare
|
Hi @jolynch, thank you for your comments, sorry for the delay in getting back to this PR. I added a paragraph to the README on how to use this. Do you have any further comments / things I should change? |
4a56103 to
5727f24
Compare
Hi,
It would be nice if nerve would support serf as a reporter out of the box. I've been using a fork by https://github.com/patrickviet and this has worked well for us so far.
The original commit is here: https://github.com/getyourguide/nerve/blob/bb1734211b7d5b162ad9e4d62f33cb2834bdf481/lib/nerve/reporter/serf.rb
Your contributing guidelines say to open a PR onto the
pull_requestsbranch; though that one seems very much out-of-date, so I'm opening the PR tomaster. Let me know if I should re-open the PR to another branch.also related to #72
If you accept this I can also open a PR to synapse for serf support.
Thanks.