https://github.com/lurumad/aspnetcore-health
AspNetCore.Health enables load balancers to monitor the status of deployed Web applications.
https://github.com/lurumad/aspnetcore-health
Last synced: 5 months ago
JSON representation
AspNetCore.Health enables load balancers to monitor the status of deployed Web applications.
- Host: GitHub
- URL: https://github.com/lurumad/aspnetcore-health
- Owner: lurumad
- License: apache-2.0
- Archived: true
- Created: 2016-12-04T21:23:25.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-05-02T09:26:01.000Z (almost 7 years ago)
- Last Synced: 2024-08-04T01:09:44.439Z (9 months ago)
- Language: C#
- Homepage:
- Size: 43.9 KB
- Stars: 49
- Watchers: 6
- Forks: 16
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# AspNetCore.Health [](http://myget.org/gallery/aspnetcore-health) [](https://www.nuget.org/packages/AspNetCore.Health/)
 This libray has been **discontinued** in favor of [BeatPulse](https://github.com/Xabaril/BeatPulse) 
### What Is Application Health Check?
Health checking is the process where [load balancers](https://en.wikipedia.org/wiki/Load_balancing_(computing)) or application delivery controller does periodic check on our applications to make sure that they are up and responding without any problems. If our applications are down for every reason or any of the system that our applications depends on (A database, a distributed cache, web service, ect) are down, the load balancer should detect this and stop sending traffic its way.
### Why AspNetCore.Health?
AspNetCore.Health enables load balancers to monitor the status of deployed Web applications.
### Scenarios
AspNetCore.Health enables you to do the following tasks:
* Monitor the performance of an AspNetCore application to make sure that it is healthy.
* Rapidly diagnose applications or systems that are failing.### Install AspNetCore Health
You should install [AspNetCore.Health with NuGet](https://www.nuget.org/packages/AspNetCore.Health):
Install-Package AspNetCore.Health
This command from Package Manager Console will download and install AspNetCore.Health and all required dependencies.### Meet AspNetCore.Health
By default AspNetCore provides out of the box some health checks providers:
* Check Urls (Http services)
* Ftp```csharp
public void ConfigureServices(IServiceCollection app)
{
services.AddHealthChecks(context =>
{
context
.AddUrlCheck("http://www.google.com")
.AddFtp("ftp.uconn.edu", "anonymous", "", 21, FtpTransferMode.Binary, "Public Ftp Test");
});
}
```
```csharp
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
app.UseHealthCheck("/health")
}
```You can create your own health check providers in a functional style avoiding inheritance:
```csharp
Func>
```You can see some examples [here] (https://github.com/lurumad/aspnetcore-health/blob/master/src/AspNetCore.Health/HealthCheckContextExtensions.cs)
Run the [HealthSample](https://github.com/lurumad/aspnetcore-health/tree/master/samples/HealthSample) and open your browser [http://localhost:5000/health](http://localhost:5000/health)
```json
[
{
Name: "WebService (Google)",
Status: "Healthy"
}
]
```
If all services are healthy, returns http **200 OK** status code, but if there are any unhealthy service returns http **500 Internal Server Error** status code.Try with other services!
### Continous integration build
| Platform | Status |
|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|
| AppVeyor (.NET Core) | [](https://ci.appveyor.com/project/lurumad/aspnetcore-health/branch/master) |### Copyright
Copyright © 2016 Luis Ruiz (lurumad)