HTTP healthcheck for the lazy.

ualive

HTTP healthcheck for the lazy.

ualive runs a command at regular interval and exposes the results through HTTP. That's it. It is aimed to be used as a healthcheck endpoint implementation for other services when modifying the said services are not an option (e.g. legacy stuff you don't want to change).

Usage ualive:
  -bind string
        Address to bind to (default ":8080")
  -command string
        (Required) Command to run to perform healthcheck
  -log-level string
        Log level (default "info")
  -periodicity string
        Healthcheck periodicity, must be robfig/cron compliant (default "@every 1s")
  -resource-name string
        Name of the HTTP resource that delivers healthcheck results (default "/health")
  -timeout int
        Timeout in seconds for healthcheck command (default 3)

Example:

./ualive.go -periodicity "@every 5s" -command "/usr/bin/stat /tmp/serviceFile" -resource-name "/health"

will run /usr/bin/stat /tmp/serviceFile every 5 seconds and expose the result through HTTP at /health.

$ http localhost:8080/health
HTTP/1.1 500 Internal Server Error
Content-Length: 85
Content-Type: application/json
Date: Thu, 25 Nov 2021 14:46:43 GMT

{
    "command": "/usr/bin/stat /tmp/serviceFile",
    "timestamp": "2021-11-25T15:46:40+01:00"
}
$ touch /tmp/serviceFile
$ http localhost:8080/health
http localhost:8080/health                                                                                                                                                      ─╯
HTTP/1.1 200 OK
Content-Length: 85
Content-Type: application/json
Date: Thu, 25 Nov 2021 14:46:02 GMT

{
    "command": "/usr/bin/stat /tmp/serviceFile",
    "timestamp": "2021-11-25T15:46:00+01:00"
}

Build ualive

make build

Disclaimer 🤷

I'm not a go developer and the code is most probably a trash fire. Contributions are most welcome.

Owner
Cyril Thomas
Will put stuff in the ☁️ for food. ¯\_(ツ)_/¯
Cyril Thomas
Similar Resources

Go (golang) http calls with retries and backoff

pester pester wraps Go's standard lib http client to provide several options to increase resiliency in your request. If you experience poor network co

Dec 28, 2022

http client for golang

http client for golang

Request HTTP client for golang, Inspired by Javascript-axios Python-request. If you have experience about axios or requests, you will love it. No 3rd

Dec 18, 2022

Simple HTTP and REST client library for Go

Resty Simple HTTP and REST client library for Go (inspired by Ruby rest-client) Features section describes in detail about Resty capabilities Resty Co

Jan 1, 2023

A nicer interface for golang stdlib HTTP client

rq A nicer interface for golang stdlib HTTP client Documents rq: here client: here jar: here Why? Because golang HTTP client is a pain in the a... Fea

Dec 12, 2022

A Go HTTP client library for creating and sending API requests

A Go HTTP client library for creating and sending API requests

Sling Sling is a Go HTTP client library for creating and sending API requests. Slings store HTTP Request properties to simplify sending requests and d

Jan 7, 2023

HTTP Load Testing And Benchmarking Tool

GBench HTTP Load Testing And Benchmarking Tool inspired by Apache Benchmark and Siege. Requirements You need Golang installed and ready on your system

Jan 2, 2020

HTTP/HTTPS load testing and benchmarking tool

Introduction I wrote that code because: (the obvious reason::I love to write code in Go) We are working so hard to optimize our servers - why shouldn'

Dec 5, 2022

An HTTP proxy library for Go

Introduction Package goproxy provides a customizable HTTP proxy library for Go (golang), It supports regular HTTP proxy, HTTPS through CONNECT, and "h

Jan 4, 2023

Useful HTTP middlewares

This project contains middlewares that I often found myself reimplementing in new projects. In addition, it includes a middleware that logs in a forma

Apr 16, 2022
Speak HTTP like a local. (the simple, intuitive HTTP console, golang version)

http-gonsole This is the Go port of the http-console. Speak HTTP like a local Talking to an HTTP server with curl can be fun, but most of the time it'

Jul 14, 2021
Http client call for golang http api calls

httpclient-call-go This library is used to make http calls to different API services Install Package go get

Oct 7, 2022
fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client.

fhttp The f stands for flex. fhttp is a fork of net/http that provides an array of features pertaining to the fingerprint of the golang http client. T

Jan 1, 2023
NATS HTTP Round Tripper - This is a Golang http.RoundTripper that uses NATS as a transport.

This is a Golang http.RoundTripper that uses NATS as a transport. Included is a http.RoundTripper for clients, a server that uses normal HTTP Handlers and any existing http handler mux and a Caddy Server transport.

Dec 6, 2022
Simple HTTP package that wraps net/http

Simple HTTP package that wraps net/http

Jan 17, 2022
Http-conection - A simple example of how to establish a HTTP connection using Golang

A simple example of how to establish a HTTP connection using Golang

Feb 1, 2022
Full-featured, plugin-driven, extensible HTTP client toolkit for Go

gentleman Full-featured, plugin-driven, middleware-oriented toolkit to easily create rich, versatile and composable HTTP clients in Go. gentleman embr

Dec 23, 2022
An enhanced http client for Golang
An enhanced http client for Golang

go-http-client An enhanced http client for Golang Documentation on go.dev ?? This package provides you a http client package for your http requests. Y

Dec 23, 2022
An enhanced HTTP client for Go
An enhanced HTTP client for Go

Heimdall Description Installation Usage Making a simple GET request Creating a hystrix-like circuit breaker Creating a hystrix-like circuit breaker wi

Jan 9, 2023
Enriches the standard go http client with retry functionality.

httpRetry Enriches the standard go http client with retry functionality using a wrapper around the Roundtripper interface. The advantage of this libra

Dec 10, 2022