Skip to content

Latest commit

 

History

History
19 lines (16 loc) · 652 Bytes

health.md

File metadata and controls

19 lines (16 loc) · 652 Bytes

HealthCheck

Services' health are periodically check by Consul. You can register a health indicator for your service component as follows:

    miso.AddHealthIndicator(miso.HealthIndicator{
        Name: "My Component",
        CheckHealth: func(rail miso.Rail) bool {
            err := checkHealth()
            if err != nil {
                rail.Errorf("my component is down, %v", err)
                return false
            }
            return true
        },
    })

Everytime the healthcheck endpoint is called, all registered HealthIndicators are called. If any HealthIndicator is DOWN, the healthcheck endpoint returns 503.