Giter VIP home page Giter VIP logo

aspnetcore-health's Introduction

AspNetCore.Health MyGet CI NuGet

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:

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:

  • Sql Server
  • Redis
  • Web service (Http services)
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    var options = new HealthCheckOptions()
        .AddSqlServer("Server=.\SQLExpress...", "Sql Server 2012")
        .AddRedis("localhost", "Local Redis")
        .AddWebService("Google", "http://www.google.com");

    app.UseHealthCheck(options);
}

You can create your own health check providers by inheriting from HealthCheck class, and add it using Add extension method:

public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
    var options = new HealthCheckOptions()
        .Add(new MyCustomHealthCheck("", ""));

    app.UseHealthCheck(options);
}

Run the HealthSample and open your browser http://localhost:5000/health

[
    {
        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) Build status

Copyright

Copyright © 2016 Luis Ruiz

aspnetcore-health's People

Contributors

lurumad avatar cmendible avatar

Watchers

Tomny avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.