TurboMediator
Observability

Health Checks

Monitor mediator health with ASP.NET Core health checks

TurboMediator integrates with ASP.NET Core health checks to monitor the health of the mediator system.

Configuration

builder.Services.AddTurboMediator(m =>
{
    m.WithHealthCheck(options =>
    {
        options.Tags = new[] { "ready" };
        options.CheckHandlerRegistration = true;
        options.CheckCircuitBreakers = true;
        options.CheckSagaStore = true;
        options.CheckOutboxBacklog = true;
        options.MaxOutboxBacklog = 1000;
        options.Timeout = TimeSpan.FromSeconds(5);
    });
});

// Map health endpoint
app.MapHealthChecks("/health");

TurboMediatorHealthCheckOptions

OptionDefaultDescription
CheckHandlerRegistrationtrueVerify all message types have registered handlers
CheckCircuitBreakerstrueReport unhealthy if any circuit breaker is open
CheckSagaStoretrueCheck saga store connectivity
CheckOutboxBacklogtrueCheck outbox backlog size
MaxOutboxBacklog1000Maximum outbox backlog before reporting degraded
DegradedThreshold0.8Percentage of MaxOutboxBacklog before degraded
Timeout5sTimeout for health check operations
Tags["turbomediator", "ready"]Tags for filtering health checks
IncludeDetailstrueInclude detailed information in response

Health Check Result

The health check verifies:

  • Mediator is registered and can be resolved from DI
  • Handler resolution works correctly
  • Pipeline is configured properly

Returns Healthy, Degraded, or Unhealthy based on the check results.

On this page