-
Notifications
You must be signed in to change notification settings - Fork 10.4k
Open
Labels
area-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)Includes: Healthchecks (some bugs also in Extensions repo)
Description
Is there an existing issue for this?
- I have searched the existing issues
Is your feature request related to a problem? Please describe the problem.
The current default implementation of DbContextHealthCheck
uses dbContext.Database.CanConnectAsync(token)
to determine the health status of the DB. The implementation of CanConnectAsync
swallows errors and only returns true
/false
based on if it was able to connect or not. This does not give adequate details when health checks fail.
Describe the solution you'd like
Update the default implementation of DbContextHealthCheck
to properly log and have the health result contain any exceptions thrown when attempting to connect to the DB. This could either be just using its own "SELECT 1" logic or changing the default implementation to call ExistsAsync
instead, since CanConnectAsync
is just a wrapper around ExistsAsync
that swallows errors.
Metadata
Metadata
Assignees
Labels
area-healthchecksIncludes: Healthchecks (some bugs also in Extensions repo)Includes: Healthchecks (some bugs also in Extensions repo)