Skip to content

Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch.

License

Notifications You must be signed in to change notification settings

coderubyonrails/Warden

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 

Repository files navigation

Build status

Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch.

Please note that it's just a preview version of the library (work in progress).

What is Warden?

Warden is a simple library built to solve the problem of monitoring the resources such as the websites, API, databases, CPU etc. It allows to quickly define the watchers responsible for performing checks on specific resources and integrations to easily notify about any issues related to the possible downtime of your system. On top of that, you may use all of this information to collect the custom metrics thanks to the hooks.

What kind of monitoring is available?

Currently available watchers:

More watchers are coming soon (File, Network etc.)

What are the integrations with external services?

As for now, you may use the following integrations:

More integrations are coming soon.

Is there any documentation?

Yes, please navigate to the wiki page where you can find detailed information about configuring and running the Warden.

Installation

Available as a NuGet package.

Install-Package Warden -Pre

Watchers and integrations are available as a separate NuGet packages listed here.

Quick start:

Configure the Warden by adding the watchers and setting up the hooks and integrations to get notified about failures, successful checks, exceptions etc. - use that information e.g. in order to let your system administrator know when something goes wrong or to build your custom metrics.

var configuration = WardenConfiguration
    .Create()
    .AddWebWatcher("http://my-website.com")
    .AddMongoDbWatcher("mongodb://localhost:27017", "MyDatabase", cfg =>
    {
        cfg.WithQuery("Users", "{\"name\": \"admin\"}")
           .EnsureThat(users => users.Any(user => user.role == "admin"));
    })
    .IntegrateWithSendGrid("api-key", "noreply@system.com", cfg =>
    {
        cfg.WithDefaultSubject("Monitoring status")
           .WithDefaultReceivers("admin@system.com");
    })
    .SetGlobalWatcherHooks(hooks =>
    {
        hooks.OnStart(check => GlobalHookOnStart(check))
             .OnCompleted(result => GlobalHookOnCompleted(result));
    })
    .SetAggregatedWatcherHooks((hooks, integrations) =>
    {
        hooks.OnFirstFailureAsync(results => 
                integrations.SendGrid().SendEmailAsync("Monitoring errors have occured."))
             .OnFirstSuccessAsync(results => 
                integrations.SendGrid().SendEmailAsync("Everything is up and running again!"));
    })
    .SetHooks(hooks =>
    {
        hooks.OnIterationCompleted(iteration => OnIterationCompleted(iteration))
             .OnError(exception => Logger.Error(exception));
    })
    .Build();

Start the Warden and let him do his job - now you have the full control over your system monitoring!

var warden = Warden.Create(configuration);
await warden.StartAsync();

Please check out the examples by cloning the repository.

About

Define "health checks" for your applications, resources and infrastructure. Keep your Warden on the watch.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 84.4%
  • HTML 13.4%
  • JavaScript 2.1%
  • CSS 0.1%