You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is no official industry standard for the health endpoint. /health or variations like /_health are common by convention. ASP.NET Core uses Microsoft.Extensions.Diagnostics.HealthChecks.
Useful for automation
For example, Azure App Service & Azure Kubernetes Service (AKS) support health probes to monitor the health of your application. If a service fails health checks, Azure can automatically restart it or redirect traffic to healthy instances.
Similarly, if Data API builder fails health checks in a way a customer deems past a threshold, they have the option to recycle the container or send an alert to direct engineers.
Term
Description
Health Endpoint
The URL (e.g., /health) exposed as JSON.
Check
A specific diagnostic test (e.g., database, API).
Status
The result of a check.
Status.Healthy
The system is functioning correctly.
Status.Unhealthy
The system has a critical failure or issue.
Status.Degraded
The system is functioning, but with issues.
More on degraded
We might opt not to have degraded. But "Degraded" means the system is operational but not performing optimally. For example, for a database, the query duration might exceed a defined threshold.
if(QueryDuration>DurationThreshold){
Check.Status ="Degraded";// Query taking too long, degrading performance}
Overall health calculation
Healthy
Unhealthy
Degraded
Global Status
-
0
0
Healthy
-
≥ 1
-
Unhealthy
-
0
≥ 1
Degraded
This logic shows how the global health status is determined:
Healthy: All checks are healthy.
Unhealthy: If any is unhealthy.
Degraded: No unhealthy checks, any degraded.
Output standard schema
Health check responses follow a common convention rather than a strict standard. The typical pattern involves a "checks" property for individual components' statuses (e.g., database, memory), with each status rolling up to an overall "status" at the top level.
There is no formal guidance on check complexity; however, checks should not make the health endpoint unusable, and checks should implement a cancellation token to support timeouts.
Because we have the configuration, we know if this is a stored procedure or table/view endpoint. We might want to allow the developer to influence how the checks work against the endpoint/entity.
It looks like https://github.com/Xabaril/AspNetCore.Diagnostics.HealthChecks has support across the four supported data sources for DAB, would it be easier to add those internally to surface up the health checks, or at least treat them as additive to DAB-specific ones?
Once there is some native health check info surfaced by DAB, I'd love to get it integrated in the .NET Aspire Community Toolkit integration (tracking via CommunityToolkit/Aspire#190).
What is it?
Health as a standard
There is no official industry standard for the health endpoint.
/health
or variations like/_health
are common by convention. ASP.NET Core usesMicrosoft.Extensions.Diagnostics.HealthChecks
.Useful for automation
For example, Azure App Service & Azure Kubernetes Service (AKS) support health probes to monitor the health of your application. If a service fails health checks, Azure can automatically restart it or redirect traffic to healthy instances.
Similarly, if Data API builder fails health checks in a way a customer deems past a threshold, they have the option to recycle the container or send an alert to direct engineers.
/health
) exposed as JSON.More on degraded
We might opt not to have degraded. But "Degraded" means the system is operational but not performing optimally. For example, for a database, the query duration might exceed a defined threshold.
Overall health calculation
This logic shows how the global health status is determined:
Output standard schema
Health check responses follow a common convention rather than a strict standard. The typical pattern involves a
"checks"
property for individual components' statuses (e.g.,database
,memory
), with each status rolling up to an overall"status"
at the top level.Basic format
Example
Other common fields
Fields like
description
,tags
,data
, andexception
provide additional metadata.1. Description:
A textual explanation of what the health check is doing or testing.
2. Tags:
Labels or categories that group or identify related health checks.
3. Data:
Any additional information collected during the health check, often technical metrics or diagnostics.
4. Exception:
Information about any error or failure encountered during the health check.
Overall example
These fields help provide a more granular view of the health status, making it easier to understand why a particular check is failing or succeeding.
(Additive) Data API builder config
The standard allows for additive data, like DAB config data we could add.
Simple implementation
There is no formal guidance on check complexity; however, checks should not make the health endpoint unusable, and checks should implement a cancellation token to support timeouts.
In addition to one class for each check, we can reuse checks by leveraging the factory syntax:
Example API check
Configuration changes
Because we have the configuration, we know if this is a stored procedure or table/view endpoint. We might want to allow the developer to influence how the checks work against the endpoint/entity.
Output sample
Questions
development
versusproduction
?https://localhost/health/ui
.Related issues to close
log-level
property to runtime config schema #1645The text was updated successfully, but these errors were encountered: