System healthchecks


#1

I think it would be great for Preside to have some central approach to system healthchecks. So that:

  • When using micro services, remote APIs, etc. your application can fail gracefully when these become unavailable without having to ping them on every request
  • The system can report out to docker, Zabbix, Nagios, or whatever

I was thinking that the core could provide a scheduled task that would run every minute by default. Your applications could then provide some configuration for registering healthchecks that would be performed in the task. Finally, there would be an API along the lines of:

// my custom logic that relies on external service
if ( $isServiceDead( "myExternalService" ) ) {
    // fail gracefully here
}

// carry on as normal

Any thoughts, ideas, experience, etc very welcome before we dive in :slight_smile:


#2

Brilliant idea, would definitely be useful.
Special scenario where this pops up all the time: using preside-ext-elasticsearch