smallrye / smallrye-health

Home Page:https://smallrye.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conditional health checks

HerrDerb opened this issue · comments

We have a situation where we would like to execute only a set of specific health checks depending on the incoming REST call. This is because we run multiple tenants on the same instance and would like to show only "tenant A"-relevant health checks if the request runs in the context of "tenant A." On the other hand, we would like to see all health checks if there is no tenant-specific context.

Registering/unregistering health checks inside of a Vertx router filter is not an option, as it seems hacky and mainly beacuse this changes the configuration of the system rather than only being effective for the current request.

SUGGESTION: A new interface ConditionalHealthCheck which extends HealthCheck that holds an additional method, e.g., boolean runCheck(). The Health Registry can then check if a health check needs to be executed or not.