WebApi.HealthChecks 1.3.0

Package Description

There is a newer version of this package available.
See the version list below for details.
Install-Package WebApi.HealthChecks -Version 1.3.0
dotnet add package WebApi.HealthChecks --version 1.3.0
<PackageReference Include="WebApi.HealthChecks" Version="1.3.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WebApi.HealthChecks --version 1.3.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

WebApi.HealthChecks

WebApi.HealthChecks offers a WebApi implementation of the health check endpoints for reporting the health of app infrastructure components.

Build status

The package is available on GitHub: https://github.com/kpol/WebApi.HealthChecks

Health checks are exposed by an app as HTTP endpoints.
Supports two endpoints:

  • /health
  • /health/ui?check={check-name}

In the sample app, the health check endpoint is created at /health

public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        // Web API configuration and services

        // Web API routes
        config.MapHttpAttributeRoutes();

        config
            .AddHealthChecks()
            .AddCheck("check1", new HealthyCheck())
            .AddCheck("check2", new UnhealthyCheck())
            .AddCheck("check3", new ExceptionHealthCheck())
            .AddCheck("check5", new DegradedHealthCheck());
    }
}

Every health check must implement IHealthCheck interface

public interface IHealthCheck
{
    Task<HealthCheckResult> CheckHealthAsync();
}

The framework supports three statuses: Unhealthy , Degraded and Healthy.

GET /health returns json in the following format:

{
  "status": "Unhealthy",
  "totalResponseTime": 0,
  "entries": {
    "check1": {
      "responseTime": 0,
      "status": "Healthy"
    },
    "check2": {
      "responseTime": 0,
      "status": "Unhealthy"
    },
    "check3": {
      "status": "Unhealthy"
    },
    "check5": {
      "responseTime": 0,
      "status": "Degraded"
    }
  }
}

The /health/ui?check={check-name} endpoint returns a SVG badge which shows individual status of the service component.
For example /health/ui?check=check1 will output this image: degraded

WebApi.HealthChecks

WebApi.HealthChecks offers a WebApi implementation of the health check endpoints for reporting the health of app infrastructure components.

Build status

The package is available on GitHub: https://github.com/kpol/WebApi.HealthChecks

Health checks are exposed by an app as HTTP endpoints.
Supports two endpoints:

  • /health
  • /health/ui?check={check-name}

In the sample app, the health check endpoint is created at /health

public static class WebApiConfig
{
    public static void Register(HttpConfiguration config)
    {
        // Web API configuration and services

        // Web API routes
        config.MapHttpAttributeRoutes();

        config
            .AddHealthChecks()
            .AddCheck("check1", new HealthyCheck())
            .AddCheck("check2", new UnhealthyCheck())
            .AddCheck("check3", new ExceptionHealthCheck())
            .AddCheck("check5", new DegradedHealthCheck());
    }
}

Every health check must implement IHealthCheck interface

public interface IHealthCheck
{
    Task<HealthCheckResult> CheckHealthAsync();
}

The framework supports three statuses: Unhealthy , Degraded and Healthy.

GET /health returns json in the following format:

{
  "status": "Unhealthy",
  "totalResponseTime": 0,
  "entries": {
    "check1": {
      "responseTime": 0,
      "status": "Healthy"
    },
    "check2": {
      "responseTime": 0,
      "status": "Unhealthy"
    },
    "check3": {
      "status": "Unhealthy"
    },
    "check5": {
      "responseTime": 0,
      "status": "Degraded"
    }
  }
}

The /health/ui?check={check-name} endpoint returns a SVG badge which shows individual status of the service component.
For example /health/ui?check=check1 will output this image: degraded

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
2.2.0 98 6/7/2019
2.1.0 96 6/4/2019
2.0.0 86 5/31/2019
1.6.0 82 5/30/2019
1.5.0 83 5/30/2019
1.4.0 77 5/29/2019
1.3.0 72 5/29/2019
Show less