Class HealthCheckBuilderExtensions
Adds methods such as AddOutboundEndpointsCheck
and AddOutboundQueueCheck
to the
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder.
Inheritance
Inherited Members
Namespace: Microsoft.Extensions.DependencyInjection
Assembly: Silverback.Integration.HealthChecks.dll
Syntax
public static class HealthCheckBuilderExtensions
Methods
| Improve this doc View sourceAddConsumersCheck(IHealthChecksBuilder, ConsumerStatus, Nullable<TimeSpan>, Func<IConsumerEndpoint, Boolean>, String, Nullable<HealthStatus>, IEnumerable<String>)
Adds a health check that verifies that all consumers are connected.
Declaration
public static IHealthChecksBuilder AddConsumersCheck(this IHealthChecksBuilder builder, ConsumerStatus minHealthyStatus = ConsumerStatus.Ready, TimeSpan? gracePeriod = null, Func<IConsumerEndpoint, bool> endpointsFilter = null, string name = "Consumers", HealthStatus? failureStatus = null, IEnumerable<string> tags = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | builder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder. |
ConsumerStatus | minHealthyStatus | The minimum ConsumerStatus a consumer must have to be considered healthy. |
System.Nullable<System.TimeSpan> | gracePeriod | The grace period to observe after each status change before a consumer is considered unhealthy. |
System.Func<IConsumerEndpoint, System.Boolean> | endpointsFilter | An optional filter to be applied to the endpoints to be tested. |
System.String | name | The health check name. The default is "Consumers". |
System.Nullable<Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus> | failureStatus | The Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus that should be reported when the health check reports a failure. The default is Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Unhealthy. |
System.Collections.Generic.IEnumerable<System.String> | tags | An optional list of tags that can be used for filtering health checks. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder so that additional calls can be chained. |
AddOutboundEndpointsCheck(IHealthChecksBuilder, String, Nullable<HealthStatus>, IEnumerable<String>)
Adds a health check that sends a ping message to all the outbound endpoints.
Declaration
public static IHealthChecksBuilder AddOutboundEndpointsCheck(this IHealthChecksBuilder builder, string name = "OutboundEndpoints", HealthStatus? failureStatus = null, IEnumerable<string> tags = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | builder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder. |
System.String | name | The health check name. The default is "OutboundEndpoints". |
System.Nullable<Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus> | failureStatus | The Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus that should be reported when the health check reports a failure. The default is Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Unhealthy. |
System.Collections.Generic.IEnumerable<System.String> | tags | An optional list of tags that can be used for filtering health checks. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder so that additional calls can be chained. |
AddOutboxCheck(IHealthChecksBuilder, String, Nullable<HealthStatus>, IEnumerable<String>)
Adds a health check that monitors the outbox, verifying that the messages are being processed.
Declaration
public static IHealthChecksBuilder AddOutboxCheck(this IHealthChecksBuilder builder, string name = "OutboundQueue", HealthStatus? failureStatus = null, IEnumerable<string> tags = null)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | builder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder. |
System.String | name | The health check name. The default is "OutboundQueue". |
System.Nullable<Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus> | failureStatus | The Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus that should be reported when the health check reports a failure. The default is Microsoft.Extensions.Diagnostics.HealthChecks.HealthStatus.Unhealthy. |
System.Collections.Generic.IEnumerable<System.String> | tags | An optional list of tags that can be used for filtering health checks. |
Returns
Type | Description |
---|---|
Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder | The Microsoft.Extensions.DependencyInjection.IHealthChecksBuilder so that additional calls can be chained. |