Referencing Microsoft's Implementing Resilient Applications tutorials. Specifically the Health monitoring, it is suggested that if the overall status of the current service is dependent on the status of a dependency then the healthy status of the service should only be healthy if its dependencies are healthy
However, the MVC web application of eShopOnContainers has multiple dependencies on the rest of the microservices. Therefore, it calls one AddUrlCheck
method for each microservice, as shown in the following example:
// Startup.cs from the MVC web app
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddMvc();
services.Configure<AppSettings>(Configuration);
services.AddHealthChecks(checks =>
{
checks.AddUrlCheck(Configuration["CatalogUrl"]);
checks.AddUrlCheck(Configuration["OrderingUrl"]);
checks.AddUrlCheck(Configuration["BasketUrl"]);
checks.AddUrlCheck(Configuration["IdentityUrl"]);
});
}
}
Thus, a microservice will not provide a “healthy” status until all its checks are healthy as well.
emphasis mine
So to more directly answer your question about
Should the readiness health check for A make a call to the readiness health check for API B because of the dependency?
I would say yes it should. Especially if the health of the dependency B
directly affects the stability of A
.