项目作者: alastairgould

项目描述 :
Watchdog
高级语言: C#
项目地址: git://github.com/alastairgould/Watchdog.git
创建时间: 2018-04-24T10:00:46Z
项目社区:https://github.com/alastairgould/Watchdog

开源协议:MIT License

下载


Watchdog

Build status

Watchdog is a service fabric application designed to monitor the health of services running on a service fabric cluster
using HTTP healthchecks. The result of these healthchecks are then reported to the service fabric health store.

It’s designed to be simple and easy to use.

Currently Watchdog only supports guest executables and stateless services.

How to use

To allow Watchdog to start reporting the health of your services, the service must first register a healthcheck with the Watchdog. To do so you must configure the healthcheck inside your services servicemanifest.xml file as an extension.

An example of how to do this:

  1. <ServiceTypes>
  2. <StatelessServiceType ServiceTypeName="ServiceTypeName">
  3. <Extensions>
  4. <Extension Name="Watchdog">
  5. <Watchdog xmlns="http://schemas.microsoft.com/2015/03/fabact-no-schema">
  6. !-- The relative url of your healthcheck -->
  7. <Healthcheck>/api/healthcheck</Healthcheck>
  8. </Watchdog>
  9. </Extension>
  10. </Extensions>
  11. </StatelessServiceType>
  12. </ServiceTypes>

How it works

Watchdog queries service fabric and looks for all services which have a Watchdog configuration. For each service it finds,
it identifies all service instances running for that service and hits the healthcheck endpoint. It then reports the result of the
healthcheck to the service fabric health store.

Currently Watchdog is designed to be run as single instance application to avoid either multiple Watchdog instances hitting
the same endpoints at similar times, or the added complexity of coordination between multiple processes. There are
plans to extend the application to run multiple instances by either making each instance of the Watchdog responsible
for reporting health of service instances on its own node or by coordination between Watchdog
processes(Reliable collections, actor model, etc).