It would be useful if a service can have multiple checks associated with it. For example you might want a check for seeing if the service is alive and a check to make sure that the service is running the correct software version.
By allowing multiple checks its then possible to build generic checks for checking version while having a check specific to the service for checking if the service is running.
I ran into a similar situation where I wanted multiple checks for a single service and was surprised to realize that it wasn't allowed.
So internally we allow multiple checks per service, it is just a limitation of our config file format. We can probably add a "checks" key such that a list of checks can be provided instead of a single "check" block.
As a work around, using the API will allow multiple checks to be registered
The only way that I could see to register multiple was to go through the catalog endpoints instead of the agent endpoints. Will the anti-entropy in the agent remove any services/checks/etc that weren't registered through it?
@abursavich Hmm that is a good point. I think you are right, the agent will deregister them when anti-entropy happens.
From my point of view it's important to be able to register/deregister service health checks independent of the service itself. This allows to add health checks at a later time without re-regestring the service itself. Currently it's only possible to register the one service health check together with the service.
This is really a different issue, but if there will be changes to service registration I'd just like to note that it's important to be able to mutate a service definition without having to deregister then reregister it. Consider acquiring a lock and then needing to add a tag (e.g. "master") without losing the lock by first deregistering the service and its associated health checks.
I agree with all of the above 👍
Any updates on this one? Allowing multiple checks on a service is desperately needed.
Not yet, but it is top of mind!
+1 Would be really useful to be able to attach multiple health checks per service