Hey Nicolae,
There is no way to extend the behavior of Consul currently to support what you are asking for in #1.
The filtering logic is pretty simple and just excludes any critical services. I do think this is something we’d
like to support in the future. Not quite arbitrary logic, but a number of configurable knobs for common
scenarios.
With respect to the second question, this is done by default! The health checks of a service transitively
include the checks on the node hosting the service. So if the HTTP health check for a service is passing,
but the disk utilization check for the node hosting that service is critical, that service will still be filtered out.
So #2 is the default behavior.
In addition to this, you can always consume the HTTP API and do any sort of custom logic you need!
That was one of the motivators behind that API was to allow clients to have rich logic when needed.
Hope that helps!
Best Regards,
Armon Dadgar