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

Template function to expose Checks for a Consul Service #599

Open
CpuID opened this issue Mar 31, 2016 · 7 comments
Open

Template function to expose Checks for a Consul Service #599

CpuID opened this issue Mar 31, 2016 · 7 comments

Comments

@CpuID
Copy link

CpuID commented Mar 31, 2016

Is there currently a clean way to expose the list of Checks for a service? Example, the result of an API call to /v1/health/checks/someservicename. Specifically wanting to extract the URI being hit for HTTP based status checks, most likely will have to extract from the Output property (not the cleanest, but otherwise would need to expand the Consul API upstream).

If not, I am happy to PR something to support it.

@sethvargo
Copy link
Contributor

sethvargo commented Mar 31, 2016

Hi @CpuID

There is not currently a way to list checks for a service, and it has not been a widely requested feature. If that endpoint supports blocking queries in Consul, you can add a new dependency type, template function, docs, and associated tests (it's rather easy and captured with the other items in the dependency package). I would definitely review a PR for this.

@CpuID
Copy link
Author

CpuID commented Mar 31, 2016

Thanks for the feedback @sethvargo :)

https://www.consul.io/docs/agent/http/health.html#health_checks - This endpoint supports blocking queries and all consistency modes.

I'll make an attempt at a PR and send it your way.

@sethvargo
Copy link
Contributor

Hey @CpuID

Did you still want to try to submit a PR for this?

@CpuID
Copy link
Author

CpuID commented Jun 4, 2016

Hey @sethvargo - definitely wanting to, have struggled to find the time so far (I am getting back into the project that depends on this nowish though). I might try do it on my flight over to Amsterdam next weekend worst case (before HashiConf EU).

@CpuID
Copy link
Author

CpuID commented Jun 14, 2016

Pending results of hashicorp/consul#1680 and a PR to expose the check components in the Consul API, currently the closest thing to it is the Output key which looks something like HTTP GET http://1.2.3.4:80/health: 200 OK Output: \"healthy\". Would prefer to not have to parse this out on the consul-template side.

@CpuID
Copy link
Author

CpuID commented Nov 16, 2016

@sethvargo as this is still pending a response on hashicorp/consul#1680 - did you want to hassle @slackpad for some movement ? :)

@CpuID
Copy link
Author

CpuID commented Feb 1, 2019

Worth noting (for PR followers): @sethvargo and @slackpad are both no longer at Hashicorp, so we will likely need to consider community derived PRs to get this over the line :) If I get time I'll try to get something done soonish.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants