Couchbase.HealthChecks is the health check package for Couchbase.
Get Started
| Product | Versions |
|---|---|
| .NET | |
| .NET Standard | |
| Other |
README
Couchbase Health Check
This health check verifies the ability to communicate with Couchbase. It uses the
provided ICluster and monitors diagnostics or actively pings services or buckets.
Defaults
By default, the ICluster is resolved from IClusterProvider from the service provider.
void Configure(IHealthChecksBuilder healthChecksBuilder)
{
healthChecksBuilder
.AddCouchbase(options => {
options.ConnectionString = "couchbase://localhost";
options.Username = "username";
options.Password = "password";
})
.AddHealthChecks()
.AddCouchbase(); // Adds the health check using IClusterProvider from DI
}
By default, the health check only validates connectivity to the key/value service. It requires at least one healthy connection to each data node in the cluster.
Customization
You can additionally add the following parameters:
clusterFactory: A delegate that receives anIServiceProviderand returns anIClusterinstance to use for the health check.serviceRequirmentsFactory: A delegate that receives anIServiceProviderand returns a dictionary of requirements for each service to be monitored that define if the service is healthy or unhealthy.bucketNameFactory: A delegate that receives anIServiceProviderand returns the name of the bucket to monitor.healthCheckType: An enum value that defines the type of health check to perform. The default isHealthCheckType.Active, which actively pings services on all nodes for each health check. For a lower overhead option, you can useHealthCheckType.Passive, which simply monitors the state of the existing service connections.name: The health check name. The default is "couchbase".failureStatus: TheHealthStatusthat should be reported when the health check fails. The default isHealthStatus.Unhealthy.tags: A list of tags that can be used to filter sets of health checks.timeout: ASystem.TimeSpanrepresenting the timeout of the check.
void Configure(IHealthChecksBuilder healthChecksBuilder)
{
healthChecksBuilder
.AddCouchbase(options => {
options.ConnectionString = "couchbase://localhost";
options.Username = "username";
options.Password = "password";
})
.AddHealthChecks()
.AddCouchbase(
serviceRequirementsFactory: sp =>
{
var requirements = CouchbaseHealthCheck.CreateDefaultServiceRequirements();
requirements[ServiceType.Query] = [CouchbaseServiceHealthNodeRequirement.OneHealthyNode];
return requirements;
},
bucketNameFactory: sp => "my-bucket");
}
Health checks may be further customized by creating custom ICouchbaseServiceHealthRequirement implementations. It is also possible
to inherit from CouchbaseActiveHealthCheck or CouchbasePassiveHealthCheck to create entirely custom health check implementations.
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
A verified publisher signal is available. Assess fit from the package's supported frameworks, license and dependency graph rather than popularity alone.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.