Class QuartzHealthCheckExtensions
- Namespace
- Quartz
- Assembly
- Quartz.dll
Registers the Quartz scheduler health check.
public static class QuartzHealthCheckExtensions
- Inheritance
-
QuartzHealthCheckExtensions
- Inherited Members
Remarks
The check reads Status and probes the job store, and needs nothing from
ASP.NET Core to do either — so it ships in Quartz rather than in Quartz.AspNetCore, and
a worker on a dotnet/runtime image can register it. Serving the report over HTTP is
MapHealthChecks, which is still ASP.NET Core's.
Methods
AddQuartz(IHealthChecksBuilder, Action<QuartzHealthCheckOptions>?)
Adds a health check for the default Quartz scheduler, alongside an application's other checks.
public static IHealthChecksBuilder AddQuartz(this IHealthChecksBuilder builder, Action<QuartzHealthCheckOptions>? configure = null)
Parameters
builderIHealthChecksBuilderThe health checks builder.
configureAction<QuartzHealthCheckOptions>Configures the check's name, tags and failure status.
Returns
AddQuartz(IHealthChecksBuilder, string, Action<QuartzHealthCheckOptions>?)
Adds a health check for one named Quartz scheduler.
public static IHealthChecksBuilder AddQuartz(this IHealthChecksBuilder builder, string schedulerName, Action<QuartzHealthCheckOptions>? configure = null)
Parameters
builderIHealthChecksBuilderThe health checks builder.
schedulerNamestringThe name the scheduler was registered under with
AddQuartz(name, …).configureAction<QuartzHealthCheckOptions>Configures the check's name, tags and failure status.
Returns
AddQuartzHealthChecks(IQuartzBuilder, Action<QuartzHealthCheckOptions>?)
Registers a health check for the scheduler this builder configures: healthy while it is running and can reach its store, degraded while it is in standby or waiting for the application to start it (AutoStart), and unhealthy otherwise.
public static IQuartzBuilder AddQuartzHealthChecks(this IQuartzBuilder builder, Action<QuartzHealthCheckOptions>? configure = null)
Parameters
builderIQuartzBuilderThe scheduler's builder.
configureAction<QuartzHealthCheckOptions>Optional configuration for the health check registration, allowing the name, tags and failure status to be customized (for example to attach liveness/readiness probe tags).
Returns
Remarks
A named scheduler has its own health check, checking its own scheduler rather than the default
one, and defaulting to a name of quartz-scheduler-<scheduler name> so several of
them can be registered side by side.
This is the only AddQuartzHealthChecks, and the receiver is why: a scheduler's builder
knows which scheduler it is, so the check is registered for that one without the name being
written twice. An application composing the check with its own goes through the health-checks
builder — services.AddHealthChecks().AddQuartz(), or
AddQuartz("reporting") for a named scheduler — which is the ecosystem's idiom and says the
same thing said from the other end.