Pdsr.HealthChecks.RabbitMQ
1.3.0
dotnet add package Pdsr.HealthChecks.RabbitMQ --version 1.3.0
NuGet\Install-Package Pdsr.HealthChecks.RabbitMQ -Version 1.3.0
<PackageReference Include="Pdsr.HealthChecks.RabbitMQ" Version="1.3.0" />
paket add Pdsr.HealthChecks.RabbitMQ --version 1.3.0
#r "nuget: Pdsr.HealthChecks.RabbitMQ, 1.3.0"
// Install Pdsr.HealthChecks.RabbitMQ as a Cake Addin #addin nuget:?package=Pdsr.HealthChecks.RabbitMQ&version=1.3.0 // Install Pdsr.HealthChecks.RabbitMQ as a Cake Tool #tool nuget:?package=Pdsr.HealthChecks.RabbitMQ&version=1.3.0
Pdsr HealthChecks Libraries
Contains HealthChecks for OpenId-Connect, RedisCacheManager, Postgres, and RabbitMQ.
Getting Started
Health checks need to register in the DI container.
Redis Healthcheck
In the minimal API, use builder.Services
to add the extension method, AddRedisCacheManager
to IHealthChecksBuilder
.
var degradedThreshold = 50; // in milliseconds, response time higher than 50 will be considered degraded
var unhealthyThreshold = 100; // in milliseconds, response time higher than 100 will be considered unhealthy
builder.Services.AddHealthChecks()
.AddRedisCacheManager(degradedThreshold,unhealthyThreshold);
Memory HealthCheck
You can define a memory usage limit for the MemoryHealthCheck
In the minimal API, use builder.Services
to add the extension method, AddMemoryHealthCheck
to IHealthChecksBuilder
builder.Services.AddHealthChecks()
.AddMemoryHealthCheck(
degradedThreshold: 50 * 1024L * 1024L, // shows degraded at this 50 MB
unhealthyThreshold: 100 * 2048L * 2048L, // threshold to show failureStatus (unhealthy), 100MB
failureStatus: HealthStatus.Unhealthy, // default failure status is HealthStatus.Unhealthy
tags: new string[] { "memory", "ram" }); // optional tags
Health Publisher
The interface ISystemHealth
and the abstract class SystemHealthBase
are available to be used as publisher.
you need to inherit from SystemHealthBase
:
public class MyHealthStatus : SystemHealthBase
{
// some custom properties
}
Register in DI container
builder.Services.RegisterReadinessPublisher<MyHealthStatus>();
The instance of MyHealthStatus
is available through injection.
public class SomeService : ISomeService
{
private readonly MySystemHealth _mySystemHealth;
public SomeService(MySystemHealth mySystemHealth)
{
_mySystemHealth = _mySystemHealth;
}
public void SomeMethod()
{
var health = _mySystemHealth.HealthReport;
// do whatever you like with that health status.
}
}
Samples
Refer to the samples folder.
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
.NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
.NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen40 was computed. tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.2)
- RabbitMQ.Client (>= 6.8.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.