- Notifications
You must be signed in to change notification settings - Fork55
Liveness, health check library for ASP.NET Core Applications
License
Xabaril/BeatPulse
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
IMPORTANT UPDATE
Beatpulse project was created to fill a gap in Asp.Net Core ecosystem when no health checks libraries were available.
Now that Microsoft is rolling out their ownhealth checks integration, the Beatpulse project will be focused in contributing towards this library.
All liveness, UI and Beatpulse features are already available as extensions for the new Microsoft health checks package in this repository:
Xabaril - AspNetCore.Diagnostics.HealthChecks
Support
The team will continue to provide support to Beatpulse until version 3.0 with .Net Core version 2.1 but no new features will be added in this repository.
What is Health Checking?
Health checking is the process where load balancers or application delivery controller does periodic checks on our applications to make sure that they are up and responding without any problems. If our applications are down for whatever reason or any of the systems that our applications depends on (A database, a distributed cache, web service, ect) are down, the load balancer, k8s, should detect this and stop sending traffic its way trying to restore services manually or automatically.
BeatPulse is a powerfull liveness, readiness library for .NET Core Applications with many out of box enterprise health check services.
This documentation is for BeatPulse latest version, you can check changes and package compatibility onChangeLog.
- Install the Nuget Package into your ASP.NET Core application.
Install-Package BeatPulse
- Install the liveness libraries that you need on your project. At this momentBeatPulse contains NuGet libraries for:
- System (Disk Storage, Memory)
- Network (Tcp, Ftp, Sftp, Imap, Smtp, Dns resolve)
- Redis
- Elasticsearch
- SqlServer
- MongoDb
- Postgress Sql
- EventStore
- Oracle
- Azure Storage (Blobs, Tables and Queues)
- Azure Service Bus (Event Hub, Service Bus queues and topics)
- DocumentDb
- MySQL
- SqLite
- Kafka
- RabbitMQ
- Identity Server
- AWS DynamoDB
- Custom lambda liveness.
Install-Package BeatPulse.SystemInstall-Package BeatPulse.NetworkInstall-Package BeatPulse.SqlServerInstall-Package BeatPulse.MongoDbInstall-Package BeatPulse.NpgsqlInstall-Package BeatPulse.ElasticsearchInstall-Package BeatPulse.EventStoreInstall-Package BeatPulse.RedisInstall-Package BeatPulse.AzureStorageInstall-Package BeatPulse.AzureServiceBusInstall-Package BeatPulse.MySqlInstall-Package BeatPulse.DocumentDbInstall-Package BeatPulse.SqLiteInstall-Package BeatPulse.KafkaInstall-Package BeatPulse.RabbitMQInstall-Package BeatPulse.IdSvrInstall-Package BeatPulse.DynamoDBInstall-Package BeatPulse.Oracle
- AddBeatPulse into your ASP.NET Core project.UseBeatPulse is a new IWebHostBuilder extension method to register and configure BeatPulse.
publicstaticIWebHostBuildWebHost(string[]args)=>WebHost.CreateDefaultBuilder(args).UseBeatPulse(options=>{options.ConfigurePath(path:"health")//default hc.ConfigureTimeout(milliseconds:1500)// default -1 infinitely.ConfigureDetailedOutput(detailedOutput:true,includeExceptionMessages:true);//default (true,false)}).UseStartup<Startup>().Build();
- AddBeatPulseService and set the liveness libraries to be used.
services.AddBeatPulse(setup=>{//add sql server livenesssetup.AddSqlServer("your-connection-string");});
- RequestBeatPulse to get liveness results.
curl http://your-domain/hc GET /hc HTTP/1.1Host: your-domainUser-Agent: curl/7.49.0Accept:*/*HTTP/1.1 200 OKOK
For more information aboutBeatPulse configuration and other features ( configuration, cache, authentication, etc ) see thespecific documentation section.
WithTrackingPulses you can save liveness information in external services. Currently we have developed different trackers you can use:
The project BeatPulse.UI is a minimal UI interface that stores and shows the liveness results from the configured liveness uri's. To integrate BeatPulse.UI in your project you just need to add the BeatPulse.UI services and middlewares.
publicclassStartup{publicvoidConfigureServices(IServiceCollectionservices){services.AddBeatPulseUI();}publicvoidConfigure(IApplicationBuilderapp,IHostingEnvironmentenv){app.UseBeatPulseUI();}}
This automatically registers a new interface on/beatpulse-ui.
Optionally,UseBeatPulseUI can be configured with different UI response path.
BeatPulseUI is also available as adocker image You can read more aboutbeat pulse ui docker image.
The liveness to be used on BeatPulse-UI are configured using theBeatPulse-UI settings.
{"BeatPulse-UI": {"Liveness": [ {"Name":"HTTP-Api-Basic","Uri":"http://localhost:6457/health?DetailedOutput=true" } ],"Webhooks": [ {"Name":"","Uri":"","Payload":"","RestoredPayload":"" } ],"EvaluationTimeOnSeconds":10,"MinimumSecondsBetweenFailureNotifications":60 }}
1.- Liveness: The collection of liveness uris to watch.2.- EvaluationTimeOnSeconds: Number of elapsed seconds between liveness checks.3.- Webhooks: If any liveness return a *Down* result, this collections will be used to notify the error status. (Payload is the json payload and must be scape. For mor information see Notifications section)4.- MinimumSecondsBetweenFailureNotifications: The minimun seconds between failure notifications in order not flooding the notification receiver.
All liveness results are stored into a SqLite database persisted to disk withlivenessdb name.
If theWebHooks section is configured, BeatPulse-UI automatically posts a new notification into the webhook collection. BeatPulseUI uses a simple replace method for values in the webhook'sPayload property. At this moment we support two bookmarks:
[[LIVENESS]] The name of the liveness that returnsDown.
[[FAILURE]] A detail message with the failure.
Theweb hooks section contains more information and webhooks samples for Microsoft Teams, Azure Functions, Slack and more.
BeatPulse wouldn't be possible without the time and effort of its contributors. The team is made up of Unai Zorrilla Castro @unaizorrilla, Luis Ruiz Pavón @lurumad, Carlos Landeras @carloslanderas and Eduard Tomás @eiximenis.
Our valued committers are: Hugo Biarge @hbiarge, Matt Channer @mattchanner, Luis Fraile @lfraile, Bradley Grainger @bgrainger,Mahamadou Camara @poumup.
If you want to contribute to a project and make it better, your help is very welcome. You can contribute with helpful bug reports, feature request and also new features with pull requests.
- Read and follow theDon't push your pull requests
- Build.ps1 is working on local and AppVeyor.
- Follow the code guidelines and conventions.
- New features are not only code, tests and documentation are also mandatory.
About
Liveness, health check library for ASP.NET Core Applications
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors11
Uh oh!
There was an error while loading.Please reload this page.