Class ConsulHealthContributor
A Health contributor which provides the health of the Consul server connection
public class ConsulHealthContributor : IHealthContributor
- Inheritance
-
ConsulHealthContributor
- Implements
- Inherited Members
Constructors
ConsulHealthContributor(IConsulClient, IOptionsMonitor<ConsulDiscoveryOptions>, ILogger<ConsulHealthContributor>)
Initializes a new instance of the ConsulHealthContributor class.
public ConsulHealthContributor(IConsulClient client, IOptionsMonitor<ConsulDiscoveryOptions> optionsMonitor, ILogger<ConsulHealthContributor> logger = null)
Parameters
client
IConsulClienta Consul client to use for health checks
optionsMonitor
IOptionsMonitor<ConsulDiscoveryOptions>configuration options
logger
ILogger<ConsulHealthContributor>optional logger
ConsulHealthContributor(IConsulClient, ConsulDiscoveryOptions, ILogger<ConsulHealthContributor>)
Initializes a new instance of the ConsulHealthContributor class.
public ConsulHealthContributor(IConsulClient client, ConsulDiscoveryOptions options, ILogger<ConsulHealthContributor> logger = null)
Parameters
client
IConsulClienta Consul client to use for health checks
options
ConsulDiscoveryOptionsconfiguration options
logger
ILogger<ConsulHealthContributor>optional logger
Properties
Id
Gets an identifier for the type of check being performed
public string Id { get; }
Property Value
Methods
Health()
Compute the health of the Consul server connection
public HealthCheckResult Health()
Returns
- HealthCheckResult
the health check result