All Projects → Talento90 → go-health

Talento90 / go-health

Licence: MIT license
❤️ Health check your applications and dependencies

Programming Languages

go
31211 projects - #10 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to go-health

Gatus
⛑ Gatus - Automated service health dashboard
Stars: ✭ 1,203 (+1221.98%)
Mutual labels:  monitor, health
health-go
A golang implementation of the upcoming IETF RFC Health Check Response Format for HTTP APIs
Stars: ✭ 31 (-65.93%)
Mutual labels:  healthcheck, health
Servermonitor
💓 Laravel package to periodically monitor the health of your server and application.
Stars: ✭ 148 (+62.64%)
Mutual labels:  monitor, health
aarogya seva
A beautiful 😍 covid-19 app with self - assessment and more.
Stars: ✭ 118 (+29.67%)
Mutual labels:  healthcheck, health
gatus
⛑ Automated service health dashboard
Stars: ✭ 3,018 (+3216.48%)
Mutual labels:  monitor, health
Health
Laravel Health Panel
Stars: ✭ 1,774 (+1849.45%)
Mutual labels:  monitor, health
Mining-Minds
Mining Minds is a collection of services, tools and techniques working collaboratively to investigate on human’s daily routines to provide a personalized well-being and health-care support
Stars: ✭ 43 (-52.75%)
Mutual labels:  healthcheck, health
theonionbox
Dashboard to monitor Tor node operations
Stars: ✭ 116 (+27.47%)
Mutual labels:  monitor
redis-healthy
It retrieves metrics, periodically, from Redis (or sentinel) and send them to Logstash
Stars: ✭ 62 (-31.87%)
Mutual labels:  monitor
HealthDeterminants
Social Determinants of Health Visualization
Stars: ✭ 58 (-36.26%)
Mutual labels:  health
linux-inspect
linux-inspect implements various Linux inspecting utilities.
Stars: ✭ 32 (-64.84%)
Mutual labels:  monitor
lemon
Lemon – LED Monitor – is a $79.43 opensource alternative to LaMetric that supports GitHub-, IFTTT- and Zapier-webhooks and even integrates with Pushover!
Stars: ✭ 45 (-50.55%)
Mutual labels:  monitor
redis-traffic-stats
Live monitor & analyze Redis queries on your client
Stars: ✭ 84 (-7.69%)
Mutual labels:  monitor
fastapi-health
Implement the Health Check API pattern on your FastAPI application! 🚀
Stars: ✭ 110 (+20.88%)
Mutual labels:  healthcheck
network-monitor-ios
Network Monitor SDK for iOS
Stars: ✭ 70 (-23.08%)
Mutual labels:  monitor
habitus
🏄 State-of-the-art Tracker for emotions, habits and thoughts. | Gamified. | Anonymous and open source. | Healthiest version of you
Stars: ✭ 23 (-74.73%)
Mutual labels:  health
rn-fitness-tracker
React Native module to interact with Google Fit and Apple HealthKit.
Stars: ✭ 58 (-36.26%)
Mutual labels:  health
NodePingManage
可用于监控交换机/服务器/防火墙的存活状态的ping监控报警系统
Stars: ✭ 47 (-48.35%)
Mutual labels:  monitor
hms-health-demo-java
HMS Health demo code provides demo programs for your reference or usage. Developers can access the Huawei Health Platform and obtain sports & health data by integrating HUAWEI Health.
Stars: ✭ 37 (-59.34%)
Mutual labels:  health
site-monitor
监控网站的可访问性的监控系统
Stars: ✭ 48 (-47.25%)
Mutual labels:  monitor

health

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

Installation

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() {
    <-gracefulShutdown
        h.Shutdown()

        // 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

{
    "service":"imgart",
    "up_time":"14m5.788341028s",
    "start_time":"2018-03-11T17:02:33Z",
    "memory":{
        "current":{
            "total_alloc":8359984,
            "heap_alloc":2285896,
            "rss":5767168
        },
        "initial":{
            "total_alloc":7784792,
            "heap_alloc":1754064,
            "rss":5701632
        },
        "diff":{
            "total_alloc":575192,
            "heap_alloc":531832,
            "rss":65536
        }
    },
    "go_routines":21,
    "is_shutting_down":false,
    "health_checkers":{
        "mongo":{
            "status":"CHECKED",
            "response_time":"573.813µs"
        },
        "redis":{
            "status":"CHECKED",
            "error":{
                "Syscall":"getsockopt",
                "Err":113
            },
            "response_time":"93.526014ms"
        },
        "external_api": {
            "status":"TIMEOUT",
            "response_time":"1.2s"
        }
    }
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].