Table of Contents

Class NiteHealthCheck

Namespace
Nite.Observability
Assembly
Nite.dll

Reports whether Nite can serve the app. In development: Degraded while packages install or dependencies pre-bundle, Unhealthy if that failed (a typo in nite.json, a package that does not exist) or if UseNite never ran. In production: Unhealthy if the build output is missing, which usually means the publish did not run nite build.

public sealed class NiteHealthCheck : IHealthCheck
Inheritance
NiteHealthCheck
Implements
Inherited Members

Remarks

A readiness check, not a liveness one: a broken nite.json is not fixed by restarting the app. Register it with AddNite(IHealthChecksBuilder, string, IEnumerable<string>?).

Constructors

NiteHealthCheck(INiteAssets)

Reports whether Nite can serve the app. In development: Degraded while packages install or dependencies pre-bundle, Unhealthy if that failed (a typo in nite.json, a package that does not exist) or if UseNite never ran. In production: Unhealthy if the build output is missing, which usually means the publish did not run nite build.

public NiteHealthCheck(INiteAssets assets)

Parameters

assets INiteAssets

Remarks

A readiness check, not a liveness one: a broken nite.json is not fixed by restarting the app. Register it with AddNite(IHealthChecksBuilder, string, IEnumerable<string>?).

Methods

CheckHealthAsync(HealthCheckContext, CancellationToken)

Runs the health check, returning the status of the component being checked.

public Task<HealthCheckResult> CheckHealthAsync(HealthCheckContext context, CancellationToken cancellationToken = default)

Parameters

context HealthCheckContext

A context object associated with the current execution.

cancellationToken CancellationToken

A CancellationToken that can be used to cancel the health check.

Returns

Task<HealthCheckResult>

A Task<TResult> that completes when the health check has finished, yielding the status of the component being checked.