❤️ Health check your applications and dependencies
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore working on checkers concurrency Mar 6, 2018
.travis.yml working on checkers concurrency Mar 6, 2018
LICENSE Initial commit Feb 13, 2018
Makefile working on checkers concurrency Mar 6, 2018
README.md Fix typos in example in readme May 1, 2018
_config.yml Set theme jekyll-theme-cayman Jun 13, 2018
health.go Fix misspelling comments Apr 21, 2018
health_test.go fix tests Mar 10, 2018
memory.go Fix misspelling comments Apr 21, 2018
memory_test.go fix diff memory Mar 11, 2018



Build Status Go Report Card codecov GoDoc

Health package simplifies the way you add health check to your service.

For a real application using go-health please check ImgArt

Supported Features

  • Service health status
  • Graceful Shutdown Pattern
  • Health check external dependencies
  • HTTP Handler out of the box that returns the health status


go get -u github.com/Talento90/go-health

How to use

    // Create a new instance of Health
    h := New("service-name", Options{CheckersTimeout: time.Second * 1})

    // Register external dependencies
    h.RegisterChecker("redis", redisDb)
    h.RegisterChecker("mongo", mongoDb)
    h.RegisterChecker("external_api", api)

    // Get service health status
    s := h.GetStatus()

    // Listen interrupt OS signals for graceful shutdown
    var gracefulShutdown = make(chan os.Signal)

    signal.Notify(gracefulShutdown, syscall.SIGTERM)
    signal.Notify(gracefulShutdown, syscall.SIGINT)

    go func() {

        // Close Databases gracefully
        // Close HttpServer gracefully

    // if you have an http server you can register the default handler
    // ServeHTTP return 503 (Service Unavailable) if service is shutting down
    http.HandleFunc("/health", h.ServeHTTP)

Response Example

        "external_api": {