Skip to main content

Couchbase.HealthChecks is the health check package for Couchbase.

Total Downloads
11.0K
11,017
Published
Apr 28, 2026
6mo ago

Get Started

dotnet add package Couchbase.HealthChecks --version 1.0.0-beta.5
ProductVersions
.NET
net8.0
.NET Standard
netstandard2.1
Other
.NETFramework4.7.2

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 an IServiceProvider and returns an ICluster instance to use for the health check.
  • serviceRequirmentsFactory: A delegate that receives an IServiceProvider and 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 an IServiceProvider and returns the name of the bucket to monitor.
  • healthCheckType: An enum value that defines the type of health check to perform. The default is HealthCheckType.Active, which actively pings services on all nodes for each health check. For a lower overhead option, you can use HealthCheckType.Passive, which simply monitors the state of the existing service connections.
  • name: The health check name. The default is "couchbase".
  • failureStatus: The HealthStatus that should be reported when the health check fails. The default is HealthStatus.Unhealthy.
  • tags: A list of tags that can be used to filter sets of health checks.
  • timeout: A System.TimeSpan representing 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.

This version is marked prerelease. Validate its API and upgrade path before production use.Compatibility metadata lists 3 target frameworks; confirm the exact target used by your application.

Related Guides & Workflows

Learn how to evaluate, integrate, or audit this package in your .NET project.