{"id":46296785,"url":"https://github.com/dotse/go-health","last_synced_at":"2026-03-04T10:04:15.701Z","repository":{"id":39388858,"uuid":"217047796","full_name":"dotse/go-health","owner":"dotse","description":"⚕️ Healthcheck utilities for Go","archived":false,"fork":false,"pushed_at":"2025-05-14T12:29:52.000Z","size":84,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-14T19:02:39.886Z","etag":null,"topics":["docker","go","golang","healthcheck"],"latest_commit_sha":null,"homepage":"https://godoc.org/github.com/dotse/go-health","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dotse.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-23T12:08:06.000Z","updated_at":"2025-05-14T12:29:02.000Z","dependencies_parsed_at":"2022-09-20T03:41:30.741Z","dependency_job_id":"b6677e32-3c27-4f30-a384-4b05bf13a475","html_url":"https://github.com/dotse/go-health","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/dotse/go-health","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotse%2Fgo-health","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotse%2Fgo-health/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotse%2Fgo-health/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotse%2Fgo-health/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dotse","download_url":"https://codeload.github.com/dotse/go-health/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dotse%2Fgo-health/sbom","scorecard":{"id":353222,"data":{"date":"2025-08-11","repo":{"name":"github.com/dotse/go-health","commit":"50c07849942c4d0331441a21fc6f7b4396fde63c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Code-Review","score":8,"reason":"Found 13/15 approved changesets -- score normalized to 8","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/go.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/dotse/go-health/go.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/go.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/dotse/go-health/go.yml/master?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 23 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GO-2025-3829"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T08:51:10.350Z","repository_id":39388858,"created_at":"2025-08-18T08:51:10.350Z","updated_at":"2025-08-18T08:51:10.350Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30078307,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T08:01:56.766Z","status":"ssl_error","status_checked_at":"2026-03-04T08:00:42.919Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","go","golang","healthcheck"],"created_at":"2026-03-04T10:04:12.221Z","updated_at":"2026-03-04T10:04:15.689Z","avatar_url":"https://github.com/dotse.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ⚕ `go-health`\n\n[![License](https://img.shields.io/github/license/dotse/go-health)](https://opensource.org/licenses/MIT)\n[![GoDoc](https://img.shields.io/badge/-Documentation-green?logo=go)](https://godoc.org/github.com/dotse/go-health)\n[![Releases](https://img.shields.io/github/v/release/dotse/go-health?sort=semver)](https://github.com/dotse/go-health/releases)\n[![Issues](https://img.shields.io/github/issues/dotse/go-health)](https://github.com/dotse/go-health/issues)\n\n`go-health` is a Go library for setting up monitoring of anything within an\napplication. Anything that can have a health status can be registered, and then\nan HTTP server can be started to serve a combined health status.\n\nIt follows the proposed standard [_Health Check Response Format for HTTP APIs_]\n(but you don’t even have to know that, `go-health` takes care of that for you).\n\n## Example\n\nℹ️ The code below is minimal. There’s more to `go-health`, but this is enough to\nget something up and running.\n\n### Setting up Health Checks\n\nLet’s say your application has a database handle, and you want to monitor that\nit can actually communicate with the database. First implement the `Checker`\ninterface:\n\n```go\nimport (\n    \"github.com/dotse/go-health\"\n)\n\ntype MyApplication struct {\n    conn Connection\n    // …\n}\n\nfunc (app *MyApplication) CheckHealth(ctx context.Context) []health.Check {\n    c := health.Check{}\n    if err := app.conn.Ping(ctx); err != nil{\n        c.Status = health.StatusFail\n        c.Output = err.Error()\n    }\n    return []health.Check{ c }\n}\n```\n\nThen whenever you create your application register it as a health check:\n\n```go\napp := NewMyApplication()\nhealth.Register(ctx, \"my-application\", app)\nhealth.StartServer(ctx)\n```\n\nEither like the above, e.g. in `main()`, or the application could even register\n_itself_ on creation. You can register any number of checks. The reported health\nstatus will be the ‘worst’ of all the registered checkers.\n\nThen there will be an HTTP server listening on \u003chttp://127.0.0.1:9999/\u003e and\nserving a fresh health [response] on each request.\n\n### Checking the Health\n\nTo then check the health, GET the response and look at its `status` field.\n\n`go-health` has a function for this too:\n\n```go\nresp, err := health.CheckNow(ctx)\nif err != nil {\n    return err\n}\nfmt.Printf(\"Status: %s\\n\", resp.Status)\n```\n\n### Command-Line Tool\n\n`go-health` provides a command-line tool for health checking. To install it run:\n\n```sh\ngo install github.com/dotse/go-health/cmd/healthcheck@latest\n```\n\nFor usage documentation see [`usage.txt`].\n\n### Using as a Docker Health Check\n\nA way to create a health check for a Docker image is to use the same binary as\nyour application to do the checking. E.g. if the application is invoked with the\nfirst argument `healthcheck`:\n\n```go\nfunc main() {\n    // …\n\n    if os.Args[1] == \"healthcheck\" {\n        health.Main(ctx)\n    }\n\n    // Your other code, including health.StartServer(ctx)…\n}\n```\n\n`Main()` will GET the current health from the local HTTP server, parse the\nresponse and `os.Exit()` either 0 or 1, depending on the health.\n\nThen in your `Dockerfile` add:\n\n```dockerfile\nHEALTHCHECK --interval=10s --timeout=30s CMD ./app healthcheck\n```\n\n💁 Voilà! A bit of code and your Docker image has a built-in health check for\nall the things you want monitored.\n\n## Using as a Kubernetes Probe\n\nIf your Kubernetes pod runs a health check server, e.g. using\n`health.StartServer(ctx)`, then [probing it][probe] can be as little as:\n\n```yaml\nspec:\n  containers:\n    - # …\n      ports:\n        - containerPort: 9999\n          name: health\n      livenessProbe:\n        httpGet:\n          port: health\n      readinessProbe:\n        httpGet:\n          port: health\n      startupProbe:\n        httpGet:\n          port: health\n```\n\n[_Health Check Response Format for HTTP APIs_]: https://inadarei.github.io/rfc-healthcheck/\n[`usage.txt`]: ./cmd/healthcheck/usage.txt\n[probe]: https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#Probe\n[response]: https://inadarei.github.io/rfc-healthcheck/#rfc.section.3\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotse%2Fgo-health","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdotse%2Fgo-health","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdotse%2Fgo-health/lists"}