Giter Club home page Giter Club logo

health's Introduction

Hi there ๐Ÿ‘‹

I'm Alex, a software engineer working on backend with Go, previously Java, while also learning Rust. I'm an open-source enthusiast and the author of httpmock, health and PumpStation. Curious what I've been working on recently?

๐Ÿ‘ท Check out what I'm currently working on

๐ŸŒฑ My latest projects

๐Ÿ”ญ Latest releases I've contributed to

๐Ÿ”จ Latest Pull Requests I published

๐Ÿ“œ My recent blog posts

โญ Recent stars

  • apple/corenet - CoreNet: A library for training deep neural networks (2 weeks ago)
  • sunng87/handlebars-rust - Rust templating with Handlebars (2 weeks ago)
  • webern/cargo-readme - Generate README.md from docstrings (2 months ago)
  • adrg/go-wkhtmltopdf - Go bindings for wkhtmltopdf and high-level HTML to PDF conversion interface (2 months ago)
  • sentriz/flagconf - extensions to Go's flag package to support prefixed environment variables and a simple config file format (2 months ago)

๐Ÿ’ฌ Feedback

If you use one of my projects, I'd love to hear from you! Don't be shy and let me know what you liked and what needs being improved. Got an issue? Open a ticket, I don't bite and will try my best to help!

๐Ÿ“ซ How to reach me

health's People

Contributors

alexliesenfeld avatar dependabot[bot] avatar mochacaffe avatar nicolascb avatar panta avatar sabban avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

health's Issues

Add Redis check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if Redis is alive (e.g. by pinging Redis and see if the ping result is successful).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add DNS resolve check

It would be useful to have a small library of commonly used health checks. In the scope of this issue, a DNS resolver check should be implemented (e.g. using LookupHost method if net.Resolver). Optimally, the implementation should support timeouts from the context.Context value that is being passed to every health check function.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add garbage collection max pause check

It would be useful to have a small library of commonly used health checks. In the scope of this issue, a garbage collection max pause check should be implemented (e.g. calling runtime.ReadMemStats and see if the PauseNs returns a value that is above a certain threshold.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add goroutine count check

It would be useful to have a small library of commonly used health checks. In the scope of this issue, a goroutine count check should be implemented (e.g. calling an count := runtime.NumGoroutine() and se if it is above a throeshold.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Make health check runnable by name

Currently, the Checker interface exposes a method Check(ctx context.Context) CheckerResult which runs all synchronous health checks. It should be possible to add a new method CheckByName(ctx context.Context, name string) (CheckResult, CheckerResult) which allows execution of a single synchronous check by name.

Add IMAP server health check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if a mail server (IMAP) is alive and can be used to receive/read emails, e.g. by using Golangs https://pkg.go.dev/net/smtp package.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add MySQL check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if MySQL is alive (e.g. calling an sql.PingContext first and e.g. execute a query, such as 'SELECT 1 ' afterwards to see if MySQL is ready for query execution.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add panic recovery mechanism

When a user created health check function panics, this health check library currently does not provide a means to recover from it automatically and continue. Instead, the application terminates. This behaviour is most likely is not wanted. Therefore, this library should provide a way to recover from panics right after the check function call (e.g.: here). The user should

  • be able to able to opt out of this by configuration (e.g. by disabling it with a configuration option) and
  • instead of panicking, the library should instead return an error.

Duplicate call to checker Start()?

Is the call to handler (and thus checker) Start() duplicate here:

health/config.go

Lines 55 to 57 in 39c698e

if !cfg.withManualStart {
handler.Start()
}

since it's already done from newChecker() here?

health/check.go

Lines 89 to 92 in 39c698e

if !cfg.withManualStart {
ckr.Check(context.Background())
ckr.Start()
}

Also I wonder if the cancel() deferral doesn't immediately terminate the check here:

health/handler.go

Lines 23 to 32 in 39c698e

// Start allows to start periodic checks manually if the health check was configured using
// WithManualStart or when checks have been stopped earlier using health.Stop.
// This function has no effect otherwise.
func (h Handler) Start() {
ctx, cancel := context.WithTimeout(context.Background(), h.cfg.timeout)
defer cancel()
h.ckr.Start()
h.ckr.Check(ctx)
}

Add Postgres check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if Postgres is alive (e.g. calling an sql.PingContext first and do a 'SELECT VERSION()' afterwards to see if Postgres is ready for query execution.

A few constraints to keep things clean and simple:

  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Add disk space check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks the hosts disk space is above a preconfigured threshold (e.g. bny using syscall.Statfs and using the total and free disk blocks to see if the threshold constraints are met)

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add GRPC check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if a GRPC endpoint is reachable, e.g. by using a HealthClient instance from google.golang.org/grpc/health/grpc_health_v1 to retrieve its status and see if it is "serving" (I.e. HealthCheckResponse_SERVING).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add Kafka producer check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if a Kafka procuder is alive. Strategies on how to do this can be discussed here prior to implementation.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

ADD HTTP check

It would be useful to have a small library of commonly used health checks. In the scope of this issue, an HTTP check should be implemented (e.g. calling an http.Client HTTP method and return it's result). Optimally, the implementation should respect the context.Context value that is being passed to each health check function (e.g., by using the Deadline from the context to pass it as a paramter of http.Client (or pass the entire context if there is a way to do that).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Make health check results consumable by Prometheus

It should be possible to expose health checks as a prometheus gauge.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add Mongo DB check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if Mongo DB is alive (e.g. by pinging Mongo DB and see if the ping result is successful).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add Kafka Consumer check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if a Kafka consumer is alive. Strategies on how to do this can be discussed here prior to implementation.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add TCP Dial check

It would be useful to have a small library of commonly used health checks. In the scope of this issue, a TCP check should be implemented (e.g. calling net.DialTimeout("tcp", addr, timeout) and return it's result). Optimally, the implementation should respect the context.Context value that is being passed to each health check function (e.g., by using the Deadline from the context to pass it as a parameter to net.DialTimeout (or pass the entire context if there is a way to do that).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add Memcached check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if Memcached is alive (e.g. by pinging Memcached and see if the ping result is successful).

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add Elasticsearch check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if Elasticsearch is alive (e.g. calling an sql.PingContext first and e.g. execute a query, such as 'SELECT 1 ' afterwards to see if MySQL is ready for query execution.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Add SMTP server health check

It would be useful to have a library of commonly used health checks. In the scope of this issue, a health check should be implemented that checks if a mail server (SMTP) is alive and can be used to send emails, e.g. by using Golangs https://pkg.go.dev/net/smtp package.

A few constraints to keep things clean and simple:

  • The check should be added to the checks module that you can find in the development branch.
  • As with all health check functions of this library, the check implementation should support accepting and forwarding context.Context that is being passed to each health check function.
  • If the health check requires external external modules or other dependencies, the check should be implemented as a separate Go module(similarly how it is done for the tests, that require dependencies to other packages as well). This is required to avoid that when people import the base library, they also need to import all dependencies of all provided checks.
  • The check should have a README.md in its root directory that describes how to use it and maybe what to look out for.
  • You should provide a test that checks at least the happy path. If a docker container is required to properly test the check, the docker container can be added to the docker-compose.yaml file in the checks base package.

Should you have questions or require help, please join our discord chat room.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.