Skip to content

codecontemplator/common-heartbeat

 
 

Repository files navigation

common-heartbeat

Heartbeat middleware

Intercepts HttpGet requests to /api/heartbeat and executes a registered heartbeatmonitor that runs healthchecks on the system. By default it will try to find a registered instance of IHeartbeatMonitor and execute

Basic usage

using Collector.Common.Heartbeat

app.UseHeartbeat();
//HeartbeatOptions Default values:
//ApiKey = null
//ApiKeyHeaderKey = "DiagnosticsAPIKey"
//HeartbeatRoute = "/api/heartbeat"

Advanced usage

using Collector.Common.Heartbeat

app.UseHeartbeat<IHeartbeatMonitor>(
	monitor => monitor.RunAsync(), 
    new HeartbeatOptions {
		ApiKey = "Secret",
		ApiKeyHeaderKey = "ApiKeyAuthorization",
		HeartbeatRoute = "/api/custom/heartbeat"
	}
);

About

Heartbeat middleware

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 100.0%