Table of Contents

Class ConsulHealthContributor

Namespace
Steeltoe.Discovery.Consul.Discovery
Assembly
Steeltoe.Discovery.Consul.dll

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 IConsulClient

a 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 IConsulClient

a Consul client to use for health checks

options ConsulDiscoveryOptions

configuration options

logger ILogger<ConsulHealthContributor>

optional logger

Properties

Id

Gets an identifier for the type of check being performed

public string Id { get; }

Property Value

string

Methods

Health()

Compute the health of the Consul server connection

public HealthCheckResult Health()

Returns

HealthCheckResult

the health check result