health icon indicating copy to clipboard operation
health copied to clipboard

Add TCP Dial check

Open alexliesenfeld opened this issue 2 years ago • 1 comments

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.

alexliesenfeld avatar Sep 15 '22 17:09 alexliesenfeld

I could take a look at this, if it's ok with you

wmb1207 avatar Sep 19 '22 17:09 wmb1207

@wmb1207 Sure! I assigned this issue to you!

alexliesenfeld avatar Sep 30 '22 13:09 alexliesenfeld

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Apr 19 '23 01:04 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 04 '23 01:05 github-actions[bot]