-
Notifications
You must be signed in to change notification settings - Fork 469
IHealthCheck
implementations from active ScriptHost into health checks.#11403Description
The current health check design in the host only resolves IHealthCheck
implementations from the WebHost layer. This precludes extensions from registering their own health checks as they all live in the ScriptHost layer.
Requirements
- Health checks registered to script host service using existing
Microsoft.Extensions.HealthCheck
APIs will be included in the WebHost'sHealthCheckService
. - Health checks from the script host layer are correctly resolved/invoked with a service scope from the ScriptHost.
Implementation
We will introduce our own implementation of HealthCheckService
which will aggregate health checks from the WebHost and then from the ScriptHost. This will work by internally invoking CheckHealthAsync
on WebHost and ScriptHost layers separately, then combining the results for a final health check.
Considerations:
Conflict Resolution: since we will have two discrete health check configurations, we will have the possibility of conflicting health check names. In the case of a conflict, we will log a warning and take the check from the WebHost. We take the check from the WebHost as this will prevent extensions from stepping over host-specific health checks. Conflicts should be rare as we will ensure to keep all of the hosts health checks in the azure.functions.
namespace (and extensions should ideally be in azure.webjobs.
namespace, if any namespace at all).