Documentation
¶
Index ¶
Constants ¶
const HEALTHCHECK_INTERVAL = 1 * time.Second
Duration between health checks
Variables ¶
This section is empty.
Functions ¶
func MonitorPodHealth ¶
func MonitorPodHealth(config *preparer.PreparerConfig, logger *logging.Logger, shutdownCh chan struct{})
MonitorPodHealth is meant to be a long running go routine. MonitorPodHealth reads from a consul store to determine which services should be running on the host. MonitorPodHealth runs a CheckHealth routine to monitor the health of each service and kills routines for services that should no longer be running.
Types ¶
type PodWatch ¶
type PodWatch struct {
// contains filtered or unexported fields
}
PodWatch houses a pod's manifest, a channel to kill the pod's goroutine if the pod is removed from the reality tree, and a bool that indicates whether or not the pod has a running MonitorHealth go routine
func (*PodWatch) MonitorHealth ¶
func (p *PodWatch) MonitorHealth()
Monitor Health is a go routine that runs as long as the service it is monitoring. Every HEALTHCHECK_INTERVAL it performs a health check and writes that information to consul
type StatusChecker ¶
StatusChecker holds all the data required to perform a status check on a particular service
func (*StatusChecker) Check ¶
func (sc *StatusChecker) Check() (health.Result, error)
Given the result of a status check this method creates a health.Result for that node/service/result
func (*StatusChecker) StatusCheck ¶
func (sc *StatusChecker) StatusCheck() (*http.Response, error)
Go version of http status check