Lack of HealthCheck ,we need it
Currently Dubbo does not have the ability of readiness check and that is somehow very helpful and needed in production env.
Does dubbo team has any plans on it ? can you show some detail design drafts ?
Our team currently is planing to add the healthcheck ability on dubbo , so we want to know dubbo team's opinion , if ok , we may give a pr on this topic.
@stoneapple Can you describe the requirements in detail? Or the dubbo services fully exposed to provide hooks?
@stoneapple It's a nice way to describe more details for your idea.
@stoneapple Can you describe the requirements in detail? Or the dubbo services fully exposed to provide hooks?
we know dubbo have the delay exposed ability, sometimes delay time is not easy to figure out. Also we may want to check other resources like db,cache before we exposed our service to meet the business trade.
@stoneapple if you have good idea for builtin /health service, pls. simply submit a pull request :) From the point of view of Dubbo, it sounds like Dubbo can only provide readiness for dubbo services only.
我这边提供一个思路看看是否可行,实现一个最低优先级的ServiceBean, 在这里拿到所有spring上下文ServiceBean的名字(BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, ServiceBean.class, false, false)), 每次在服务export时把成功暴露的bean从map剔除,在最后一个低优先级servicebean中检查没有正确暴露服务。
我这边提供一个思路看看是否可行,实现一个最低优先级的ServiceBean, 在这里拿到所有spring上下文ServiceBean的名字(BeanFactoryUtils.beansOfTypeIncludingAncestors(applicationContext, ServiceBean.class, false, false)), 每次在服务export时把成功暴露的bean从map剔除,在最后一个低优先级servicebean中检查没有正确暴露服务
should not rely on spring.
what I propose is to provide a builtin health service which expose metrics data to the user, from which at lease user can easily to learn whether all other services are UP or not.
- In what condition would we consider a service is ready for use? Currently, we have a serial of model artifacts which store all the services consumed and provided by one application. Some telnet commands, for example, ls, online and offline rely on this model to retrieve service status and update the service status if it's a write command. But the service status in these models only reflects whether a service has been published to the registry. It cannot meet @stoneapple's requirements:
we know dubbo have the delay exposed ability, sometimes delay time is not easy to figure out. Also we may want to check other resources like db,cache before we exposed our service to meet the business trade.
To meet this customized requirement, I think we should add a hook mechainism in the export/unexport process and let the users to register callbacks, once the export/unexport process finished Dubbo will trigger all these callbacks. And still, besides callbacks, we need a place to store the status of all services, and I think model artifacts can be a good choice.
A step further, what about the abnormal scenarios, e.g., connection broken, resource exhausted, should we also update the service status, these will mostly happens at runtime, while the scenario @stoneapple cares is focused on starup phase.
- How to export the health check service to end users, monitor systems or peer Dubbo Consumers? http, telnet or Dubbo?
I think http is more general and more convenience to use for end users and monitor systems, but for peer Dubbo Conumers it maybe not the the case.
- In what condition would we consider a service is ready for use? Currently, we have a serial of model artifacts which store all the services consumed and provided by one application. Some telnet commands, for example, ls, online and offline rely on this model to retrieve service status and update the service status if it's a write command. But the service status in these models only reflects whether a service has been published to the registry. It cannot meet @stoneapple's requirements:
we know dubbo have the delay exposed ability, sometimes delay time is not easy to figure out. Also we may want to check other resources like db,cache before we exposed our service to meet the business trade.
To meet this customized requirement, I think we should add a hook mechainism in the export/unexport process and let the users to register callbacks, once the export/unexport process finished Dubbo will trigger all these callbacks. And still, besides callbacks, we need a place to store the status of all services, and I think model artifacts can be a good choice.
A step further, what about the abnormal scenarios, e.g., connection broken, resource exhausted, should we also update the service status, these will mostly happens at runtime, while the scenario @stoneapple cares is focused on starup phase.
- How to export the health check service to end users, monitor systems or peer Dubbo Consumers? http, telnet or Dubbo?
I think http is more general and more convenience to use for end users and monitor systems, but for peer Dubbo Conumers it maybe not the the case.
yes,i think a hook mechanism maybe a nice solution.Simply,add all the service ready for export to a list collection , when all the ready service are all added, we check the system readiness. Let these services do export if check passes, or waiting until check passes. besides startup, we also need runtime checking ability
Dear @stoneapple @beiwei30, Adding health checking for a service is an interesting feature. Was this feature implemented in the recent version, or do we have any plan to implement it in a near future?