Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RFC : Riemann-consul : Sends consul services status to riemann #125

Merged
merged 1 commit into from
Jan 10, 2016

Conversation

shanielh
Copy link
Contributor

Currently it's a basic tool thats changes the status of a service registered to consul if all the health checks inside it are not "ok".

I hope that people that use consul and riemann would have some suggestions to add.

if (leader_hostname == @hostname)
services = JSON.parse(get(@consul_services_url))
for service in services
service_name = service[0]
Copy link
Collaborator

Choose a reason for hiding this comment

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

The only thing I'd like to ensure here is to make sure that all these services start with the same word, e.g. "consul whatever", "consul foobar", and so on. That way we don't clobber other services by accident. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, they don't. Do you want me to add "consul" as a prefix?

Copy link
Collaborator

Choose a reason for hiding this comment

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

That'd be great, thanks! Most folks use riemann to monitor multiple things so having prefixes keeps things easy to organize. :-)
On Oct 5, 2015 9:39 AM, Shani Elharrar [email protected] wrote:In bin/riemann-consul:

  • report(opts)
  • end
  • def get(url)
  • Net::HTTP.get_response(url).body
  • end
  • def tick
  • leader = get(@consul_leader_url)
  • leader_hostname = URI.parse("http://" + leader[1..-2]).hostname
  • if (leader_hostname == @hostname)
  •  services = JSON.parse(get(@consul_services_url))
    
  •  for service in services
    
  •    service_name = service[0]
    

Oh, they don't. Do you want me to add "consul" as a prefix?

—Reply to this email directly or view it on GitHub.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah. I do that too, I just use tags to keep it organized. I'll add a configurable prefix that will be "defaulted" to "consul."

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hey, any chance you could make that change for me? Would love to get this merged. :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Did it (pushed w/ force to update in same commit).

Also added node status checking.

@shanielh shanielh force-pushed the feature/consul branch 2 times, most recently from 508aacb to af2bae3 Compare January 10, 2016 06:56
@aphyr
Copy link
Collaborator

aphyr commented Jan 10, 2016

Good to go! Thanks @shanielh! :)

aphyr added a commit that referenced this pull request Jan 10, 2016
RFC : Riemann-consul : Sends consul services status to riemann
@aphyr aphyr merged commit 8799985 into riemann:master Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants