XperienceCommunity.AspNetCore.HealthChecks
1.0.0.15
See the version list below for details.
dotnet add package XperienceCommunity.AspNetCore.HealthChecks --version 1.0.0.15
NuGet\Install-Package XperienceCommunity.AspNetCore.HealthChecks -Version 1.0.0.15
<PackageReference Include="XperienceCommunity.AspNetCore.HealthChecks" Version="1.0.0.15" />
paket add XperienceCommunity.AspNetCore.HealthChecks --version 1.0.0.15
#r "nuget: XperienceCommunity.AspNetCore.HealthChecks, 1.0.0.15"
// Install XperienceCommunity.AspNetCore.HealthChecks as a Cake Addin #addin nuget:?package=XperienceCommunity.AspNetCore.HealthChecks&version=1.0.0.15 // Install XperienceCommunity.AspNetCore.HealthChecks as a Cake Tool #tool nuget:?package=XperienceCommunity.AspNetCore.HealthChecks&version=1.0.0.15
XperienceCommunity.AspNetCore.HealthChecks
This project is a NuGet package specifically designed to integrate Kentico Health Checks into applications using the Microsoft.AspNetCore.Health framework. It provides a set of custom health checks that monitor various aspects of a Kentico application, ensuring its optimal performance and stability.
The health checks included in this package cover a wide range of Kentico functionalities, from site configuration and event logs to web farm and search tasks. By leveraging the Microsoft.AspNetCore.Health framework, these health checks can be easily added to any ASP.NET Core application, providing developers with immediate insights into the health of their Kentico applications.
This package is an essential tool for any developer working with Kentico in an ASP.NET Core environment, simplifying the process of monitoring and maintaining the health of their applications.
Getting Started
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
Prerequisites
- .NET 6/.NET 8
- Kentico Xperience 13 Application.
Installing
This package provides a set of Kentico-specific health checks that you can easily add to your ASP.NET Core project. Here's how you can do it:
First, make sure you have the necessary dependencies installed. You will need the
Microsoft.Extensions.DependencyInjection
package for theIServiceCollection
interface.Install this package via NuGet.
In your
Startup.cs
file (or wherever you configure your services), use theAddKenticoHealthChecks
extension method on yourIServiceCollection
instance. Here's an example:
Add all Kentico Health Checks and Microsoft Health Checks
This method will add all the Kentico Health checks to your application.
public void ConfigureServices(IServiceCollection services)
{
services.AddKenticoHealthChecks();
}
Add all Kentico Health Checks
This method will add all the Kentico Health checks to your application.
public void ConfigureServices(IServiceCollection services)
{
services
.AddHealthChecks()
.AddKenticoHealthChecks();
}
Add specific Kentico Health Checks
This method will allow you the most flexibility to add only the health checks you want for your application.
public void ConfigureServices(IServiceCollection services)
{
services.AddHealthChecks()
.AddCheck<SiteConfigurationHealthCheck>("Site Configuration Health Check");
}
Middleware Registration
In your Startup.cs
file (or wherever you configure your application), use the UseHealthChecks
extension method on your IApplicationBuilder
instance. This registers the health checks as middleware.Here's an example:
public void Configure(IApplicationBuilder app)
{
app.UseHealthChecks("/kentico-health");
}
Endpoint Registration
In your Startup.cs
file (or wherever you configure your application), use the MapHealthChecks
extension method on your IEndpointRouteBuilder
instance. This registers the health checks as an endpoint.
Here's an example:
app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecks("/kentico-health");
}
Endpoint Registration with Custom Writer
In your Startup.cs
file (or wherever you configure your application), use the MapHealthChecks
extension method on your IEndpointRouteBuilder
instance. This registers the health checks as an endpoint.
This allows you to customize your HealthCheckOptions class, and specifiy a custom Response Writer.
Here's an example:
app.UseEndpoints(endpoints =>
{
endpoints.MapHealthChecks("/kentico-health",
new HealthCheckOptions()
{
AllowCachingResponses = true,
ResponseWriter = async (context, report) =>
await HealthCheckResponseWriter.WriteResponse(context, report)
});
}
Health Checks
Application Initialized Health Check
The ApplicationInitializedHealthCheck
class is an implementation of the IHealthCheck
interface. It is used to perform a health check on the application initialization.
Azure Search Task Health Check
The AzureSearchTaskHealthCheck
is a health check implementation that checks the Azure Search Task for any errors.
EventLogHealthCheck
The EventLogHealthCheck
class is an implementation of the IHealthCheck
interface. It is used to perform a health check on the event log by investigating the last 100 event log entries for errors.
LocalSearchTaskHealthCheck
The LocalSearchTaskHealthCheck
class is an implementation of the IHealthCheck
interface. It is responsible for checking the health of local search tasks and determining if any errors are present. This health check is used to monitor the status of search tasks in the application.
SiteConfigurationHealthCheck
The SiteConfigurationHealthCheck
class is an implementation of the IHealthCheck
interface. It is responsible for checking the health of the site configuration in a CMS (Content Management System) application.
SitePresentationHealthCheck
The SitePresentationHealthCheck
class is an implementation of the IHealthCheck
interface. It is responsible for checking the health of the site presentation configuration in an ASP.NET Core application.
StagingTaskHealthCheck
The StagingTaskHealthCheck
class is an implementation of the IHealthCheck
interface. It is responsible for checking the health of staging tasks in a Kentico Xperience CMS application.
WebFarmHealthCheck
The WebFarmHealthCheck
class is an implementation of the IHealthCheck
interface provided by the Microsoft.Extensions.Diagnostics.HealthChecks
namespace. It is used to perform health checks on the Kentico web farm servers.
WebFarmTaskHealthCheck
The WebFarmTaskHealthCheck
class is an implementation of the IHealthCheck
interface. It is responsible for checking the health of the web farm server tasks.
Built With
- Microsoft.AspNetCore.Health - The web framework used
- Kentico Xperience 13 - Kentico Xperience
- NuGet - Dependency Management
Versioning
We use SemVer for versioning. For the versions available, see the tags on this repository.
Authors
- Brandon Henricks - Initial work - Brandon Henricks
License
This project is licensed under the MIT License - see the LICENSE.md file for details
Acknowledgments
- Chris Blaylock
- Mike Wills
- Jordan Walters
- Alan Abair
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net6.0 is compatible. 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 is compatible. 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. |
-
net6.0
- CSharpFunctionalExtensions (>= 2.41.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.4)
-
net8.0
- CSharpFunctionalExtensions (>= 2.41.0)
- Microsoft.AspNetCore.Http.Abstractions (>= 2.2.0)
- Microsoft.Bcl.AsyncInterfaces (>= 8.0.0)
- Microsoft.Extensions.Diagnostics.HealthChecks (>= 8.0.4)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.0.0.19 | 816 | 8/29/2024 |
1.0.0.18 | 489 | 6/28/2024 |
1.0.0.17 | 186 | 6/11/2024 |
1.0.0.16 | 382 | 5/14/2024 |
1.0.0.15 | 98 | 5/2/2024 |
1.0.0.14 | 252 | 4/30/2024 |
1.0.0.13 | 129 | 4/7/2024 |
1.0.0.12 | 131 | 3/31/2024 |
1.0.0.11 | 128 | 3/29/2024 |
1.0.0.10 | 115 | 3/29/2024 |
1.0.0.9 | 129 | 3/29/2024 |
1.0.0.8 | 114 | 3/29/2024 |