HealthChecksBuilderExtensions
Class HealthChecksBuilderExtensions in Microsoft.Azure.CosmosRepository.AspNetCore.Extensions.
Namespace: Microsoft.Azure.CosmosRepository.AspNetCore.Extensions
Kind: class
public static class HealthChecksBuilderExtensionsMembers
Methods
HealthChecksBuilderExtensions.AddCosmosRepository(IHealthChecksBuilder, string?, HealthStatus?, IEnumerable<string>?, TimeSpan?, params Assembly[]?)
Add a health check for Azure Cosmos DB by registering AzureCosmosDbHealthCheck for given builder Use this overload to automatically scan assemblies for configured containerIds.
public static IHealthChecksBuilder AddCosmosRepository(this IHealthChecksBuilder builder, string? healthCheckName = "azure_cosmosdb", HealthStatus? failureStatus = null, IEnumerable<string>? tags = null, TimeSpan? timeout = null, params Assembly[]? assemblies)Parameters
| Name | Type | Description |
|---|---|---|
builder | IHealthChecksBuilder | The IHealthChecksBuilder to add HealthCheckRegistration to. |
healthCheckName | String | The health check name. Optional. If null the name ‘azure_cosmosdb’ will be used. |
failureStatus | HealthStatus} | The HealthStatus that should be reported when the health check fails. Optional. If null then the default status of Unhealthy will be reported. |
tags | String} | A list of tags that can be used to filter sets of health checks. Optional. |
timeout | TimeSpan} | An optional TimeSpan representing the timeout of the check. |
assemblies | Assembly[] | The assemblies to scan for IItem types. Optional. If null types are discovered autimatically. Providing a assemblies to scan may reduce start up time. |
Returns — IHealthChecksBuilder: The specified builder.
HealthChecksBuilderExtensions.AddCosmosRepository(IHealthChecksBuilder, string?, HealthStatus?, IEnumerable<string>?, TimeSpan?, Func<IServiceProvider, AzureCosmosDbHealthCheckOptions>?)
Add a health check for Azure Cosmos DB by registering AzureCosmosDbHealthCheck for given builder. Use this overload to configure AzureCosmosDbHealthCheckOptions to customise which containers to check.
public static IHealthChecksBuilder AddCosmosRepository(this IHealthChecksBuilder builder, string? healthCheckName = "azure_cosmosdb", HealthStatus? failureStatus = null, IEnumerable<string>? tags = null, TimeSpan? timeout = null, Func<IServiceProvider, AzureCosmosDbHealthCheckOptions>? optionsFactory = null)Parameters
| Name | Type | Description |
|---|---|---|
builder | IHealthChecksBuilder | The IHealthChecksBuilder to add HealthCheckRegistration to. |
healthCheckName | String | The health check name. Optional. If null the name ‘azure_cosmosdb’ will be used. |
failureStatus | HealthStatus} | The HealthStatus that should be reported when the health check fails. Optional. If null then the default status of Unhealthy will be reported. |
tags | String} | A list of tags that can be used to filter sets of health checks. Optional. |
timeout | TimeSpan} | An optional TimeSpan representing the timeout of the check. |
optionsFactory | AzureCosmosDbHealthCheckOptions} | The AzureCosmosDbHealthCheckOptions to use. Optional. If null, the health check only calls CosmosClient.ReadAccountAsync. |
Returns — IHealthChecksBuilder: The specified builder.