Below is a contrived example of one of the checks that we run for a service.
Right now we are telling out developers in order to use Consul for services you need to perform two steps
- lookup the service via /v1/catalog/service
- check its health via /v1/health/service
We use tags pretty heavily so we need to use the /v1/catalog/service API in order to filter by the tag set we need.
What we really want is for services to deregister themselves after a certain number of health checks fail and then re-enable when they come back. We have played with "deregister_critical_service_after": "1m" but that leads to longish de-registration time and no automatic re-registration.
My question is really this. Is the two process the "accepted" practice in terms of connecting to healthy services or is there some other paradigm that can be followed to get the behavior we desire.
Thansk!
{
"service": {
"name": "influxdb",
"tags": ["generic","prod","generic-prod"],
"address": "10.123.14.131",
"port": 8086,
"enableTagOverride": false,
"checks": [
{
"tcp": "localhost:8086",
"interval": "10s",
"timeout": "1s",
}
]
}
}