-
Notifications
You must be signed in to change notification settings - Fork 113
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
Add support for health-checks to consul_service #64
Conversation
Made a few notes about this in the issue: #54 (comment) |
I used this version of the code for a few weeks and I think there is some problem for the update, I need to add some tests. |
@remilapeyre do you think this would be cleaner with the addition of hashicorp/consul#1680? I think that'd make it much clearer but would require another upstream change. Thoughts? |
This would be better as we could detect changes in checks from other sources. Is there a reason hashicorp/consul#1680 (comment) does not use the same fields than https://www.consul.io/api/agent/check.html#register-check? Does his message predates the introduction of https://www.consul.io/api/agent/check.html#register-check? |
@remilapeyre I feel like we should just get this merged in the current approach, and not necessarily wait for that upstream change. Does that sound good to you? |
Hi @pearkes, I'm getting confused about the issue, if I understand hashicorp/consul#1680 correctly, the information is already available since Consul v1.0.1. Health-Checks definitions were first added in a7c42a6c2a3c63331170e2fee6ca1bc7bf6731e9 (Expose SkipNodeUpdate field and some health check info in the http api), then refined in subsequents commits. Here's what http://localhost:8500/v1/health/checks/example-external gives since v1.0.1:
It seems to me that it is just the documentation at https://www.consul.io/api/health.html#list-checks-for-service that is not up to date. If this is right, this PR need documentation and to make header support in checks work. |
I'm suggesting we change Consul to return the health checks in the same API response as when querying for service instances. Currently it just returns the health check status, not definition. But in the interim I'm supportive of this current approach of using the (separate) heath check API to read the health check definitions. Would just be nice if we could do it in one API call, but not a big deal.
That makes sense to me! |
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.
Nice work. Looks good I just think we shouldn't nest under definition
.
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.
Great job 👍
As proposed in #54, this patch add the support for health-checks defined inline in Consul services definition.