![]() |
VOOZH | about |
dotnet add package Microsoft.Extensions.Diagnostics.HealthChecks.Common --version 10.7.0
NuGet\Install-Package Microsoft.Extensions.Diagnostics.HealthChecks.Common -Version 10.7.0
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="10.7.0" />
<PackageVersion Include="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="10.7.0" />Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Common" />Project file
paket add Microsoft.Extensions.Diagnostics.HealthChecks.Common --version 10.7.0
#r "nuget: Microsoft.Extensions.Diagnostics.HealthChecks.Common, 10.7.0"
#:package Microsoft.Extensions.Diagnostics.HealthChecks.Common@10.7.0
#addin nuget:?package=Microsoft.Extensions.Diagnostics.HealthChecks.Common&version=10.7.0Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Diagnostics.HealthChecks.Common&version=10.7.0Install as a Cake Tool
This package contains common health check implementations. Here are the main features it provides:
Application Lifecycle Health Check
IHostApplicationLifetimeManual Health Check
ReportUnhealthy is calledReportHealthy is calledTelemetry Publisher
See the health checks documentation for general usage guidance.
See the built in metrics page for information regarding the metrics emitted by the telemetry publisher.
From the command-line:
dotnet add package Microsoft.Extensions.Diagnostics.HealthChecks.Common
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Diagnostics.HealthChecks.Common" Version="[CURRENTVERSION]" />
</ItemGroup>
The application's lifecycle health check service can be registered and configured using any of the following API:
public static IHealthChecksBuilder AddApplicationLifecycleHealthCheck(this IHealthChecksBuilder builder, params string[] tags)
public static IHealthChecksBuilder AddApplicationLifecycleHealthCheck(this IHealthChecksBuilder builder, IEnumerable<string> tags)
For example:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHealthChecks()
.AddApplicationLifecycleHealthCheck();
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.Run();
The manual health check service can be registered and configured using any of the following API:
public static IHealthChecksBuilder AddManualHealthCheck(this IHealthChecksBuilder builder, params string[] tags)
public static IHealthChecksBuilder AddManualHealthCheck(this IHealthChecksBuilder builder, IEnumerable<string> tags)
Then you can inject IManualHealthCheck<> into your services and call the following methods:
public static void ReportHealthy(this IManualHealthCheck manualHealthCheck)
public static void ReportUnhealthy(this IManualHealthCheck manualHealthCheck, string reason)
For example:
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHealthChecks()
.AddManualHealthCheck();
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.Run();
public class MyService
{
private readonly IManualHealthCheck<MyService> healthCheck;
// inject IManualHealthCheck<> into your service
public MyService(IManualHealthCheck<MyService> healthCheck)
{
this.healthCheck = healthCheck;
}
public void DoSomething()
{
// ... do something ...
if (somethingBadHappened)
{
this.healthCheck.ReportUnhealthy("reason");
}
this.healthCheck.ReportHealthy();
}
}
The telemetry publisher can be registered and configured using any of the following API:
public static IServiceCollection AddTelemetryHealthCheckPublisher(this IServiceCollection services)
public static IServiceCollection AddTelemetryHealthCheckPublisher(this IServiceCollection services, IConfigurationSection section)
public static IServiceCollection AddTelemetryHealthCheckPublisher(this IServiceCollection services, Action<TelemetryHealthCheckPublisherOptions> configure)
For example:
var builder = WebApplication.CreateBuilder(args);
// register health check services as needed
builder.Services.AddHealthChecks()
.AddCheck<SampleHealthCheck>("Sample");
// register telemetry publisher
builder.Services.AddTelemetryHealthCheckPublisher();
var app = builder.Build();
app.MapHealthChecks("/healthz");
app.Run();
We welcome feedback and contributions in our GitHub repo.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 net8.0 is compatible. net8.0-android net8.0-android was computed. net8.0-browser net8.0-browser was computed. net8.0-ios net8.0-ios was computed. net8.0-maccatalyst net8.0-maccatalyst was computed. net8.0-macos net8.0-macos was computed. net8.0-tvos net8.0-tvos was computed. net8.0-windows net8.0-windows was computed. net9.0 net9.0 is compatible. net9.0-android net9.0-android was computed. net9.0-browser net9.0-browser was computed. net9.0-ios net9.0-ios was computed. net9.0-maccatalyst net9.0-maccatalyst was computed. net9.0-macos net9.0-macos was computed. net9.0-tvos net9.0-tvos was computed. net9.0-windows net9.0-windows was computed. net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
| .NET Framework | net462 net462 is compatible. net463 net463 was computed. net47 net47 was computed. net471 net471 was computed. net472 net472 was computed. net48 net48 was computed. net481 net481 was computed. |
Showing the top 3 NuGet packages that depend on Microsoft.Extensions.Diagnostics.HealthChecks.Common:
| Package | Downloads |
|---|---|
|
Galosys.Foundation.Core
Galosys.Foundation快速开发库 |
|
|
CS2Launcher.AspNetCore.Launcher
A .NET Generic Host Builder for running CS2 Dedicated Servers. |
|
|
UnifiedMonitoring.Toolkit
Unified instrumentation of dotnet applications. |
Showing the top 1 popular GitHub repositories that depend on Microsoft.Extensions.Diagnostics.HealthChecks.Common:
| Repository | Stars |
|---|---|
|
GZTimeWalker/GZCTF
The GZ::CTF project, an open source CTF platform.
|
| Version | Downloads | Last Updated |
|---|---|---|
| 10.7.0 | 3,543 | 6/9/2026 |
| 10.6.0 | 27,393 | 5/12/2026 |
| 10.5.0 | 57,612 | 4/15/2026 |
| 10.4.0 | 110,700 | 3/10/2026 |
| 10.3.0 | 101,535 | 2/10/2026 |
| 10.2.0 | 130,472 | 1/13/2026 |
| 10.1.0 | 172,256 | 12/9/2025 |
| 10.0.0 | 187,195 | 11/11/2025 |
| 9.10.0 | 263,320 | 10/14/2025 |
| 9.9.0 | 247,496 | 9/9/2025 |
| 9.8.0 | 216,452 | 8/12/2025 |
| 9.7.0 | 296,266 | 7/8/2025 |
| 9.6.0 | 274,915 | 6/10/2025 |
| 9.5.0 | 225,232 | 5/13/2025 |
| 9.4.0 | 218,733 | 4/8/2025 |
| 9.3.0 | 270,958 | 3/11/2025 |
| 9.2.0 | 222,440 | 2/11/2025 |
| 9.1.0 | 307,134 | 1/14/2025 |
| 9.0.0 | 345,931 | 11/12/2024 |
| 8.10.0 | 1,588,252 | 10/8/2024 |