{"id":16111355,"url":"https://github.com/bripkens/health-check-adapter","last_synced_at":"2026-03-08T16:35:51.527Z","repository":{"id":66009295,"uuid":"47464897","full_name":"bripkens/health-check-adapter","owner":"bripkens","description":"Connect health check endpoints to Slack","archived":false,"fork":false,"pushed_at":"2016-07-03T20:30:10.000Z","size":112,"stargazers_count":3,"open_issues_count":1,"forks_count":3,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T11:02:21.809Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Scala","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bripkens.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}},"created_at":"2015-12-05T17:12:22.000Z","updated_at":"2020-06-30T08:08:04.000Z","dependencies_parsed_at":"2023-08-31T12:16:33.656Z","dependency_job_id":null,"html_url":"https://github.com/bripkens/health-check-adapter","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bripkens%2Fhealth-check-adapter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bripkens%2Fhealth-check-adapter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bripkens%2Fhealth-check-adapter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bripkens%2Fhealth-check-adapter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bripkens","download_url":"https://codeload.github.com/bripkens/health-check-adapter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248781627,"owners_count":21160709,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":[],"created_at":"2024-10-09T19:41:55.461Z","updated_at":"2026-03-08T16:35:51.476Z","avatar_url":"https://github.com/bripkens.png","language":"Scala","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003eHealth Check Adapter\u003c/h1\u003e\n\u003cp align=\"center\"\u003eSend health check changes to Slack\u003c/p\u003e\n\n[![Docker Layer Info](https://badge.imagelayers.io/bripkens/health-check-adapter:latest.svg)](https://imagelayers.io/?images=bripkens/health-check-adapter:latest 'Get your own badge on imagelayers.io') \n[![Build Status](https://travis-ci.org/bripkens/health-check-adapter.svg)](https://travis-ci.org/bripkens/health-check-adapter)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/d40c3012631b4b53b6bb0c7420c2c06d)](https://www.codacy.com/app/britter/health-check-adapter?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=bripkens/health-check-adapter\u0026amp;utm_campaign=Badge_Grade)\n[![License](http://img.shields.io/:license-apache-blue.svg)](http://www.apache.org/licenses/LICENSE-2.0.html)\n\nThis application connects to one or more applications and\ncontinuously calls the applications' health check endpoint to determine\nthe applications' health. When the health status changes, it will send\na message to a Slack channel.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"./screenshot.png\"\n       alt=\"Screenshot showing the Slack integration\"/\u003e\n\u003c/p\u003e\n\n*We are living in a weird world: This tool is not affiliated with Dr. Mario in any way and copyright belongs to Nintendo. You probably knew that, but you know how it is…*\n\n## What is a Health Check?\nHealth checks are tests that are executed as part of a running application\nto verify that an application is functioning correctly in production.\nSuch tests can be used to verify that database connections are possible or\nthat third party services are responding. Health checks are often easy to\nwrite and can be very helpful to get a quick understanding of an\napplication's status.\n\nHealth checks are typically some kind of callable resource, e.g. an HTTP\nendpoint or a JMX MBean. Frameworks like [Dropwizard](http://www.dropwizard.io/)\nmake it easy to\n[add health checks to an application](http://www.dropwizard.io/0.9.1/docs/getting-started.html#creating-a-health-check).\nDropwizard automatically exposes these health checks on\nan admin port for remote execution. This means that health checks can\neasily be integrated into continuous integration jobs or tools like this.\n\nThis health check adapter specifically expects health checks to be callable\nvia HTTP(S). It does not yet have support for MBeans or other mechanisms.\nRefer to the following section to understand the HTTP resources' expected\nresponse types. It is important to note that this tool is not restricted to\nDropwizard. Any HTTP based health check endpoint can be integrated!\n\n## How It Works\nThe mechanism is currently very simple:\n\n - An actor is started for every configured component. These actors will\n   continuously poll the components' health check endpoints in the\n   configured interval.\n - A component is determined to be…\n   - *healthy* when the health check endpoint returns a `200` HTTP status code,\n   - *not reachable* when a connection cannot be established or the health\n     check does not send a response within two seconds or\n   - *unhealthy* in all other cases. \n - When an identified component's health changes, a message is send to\n   its designated reporting actor. Reporting actors are named and it is\n   possible to use varying reporting strategies per component.\n - The reporting actor compares the component health to the previous health\n   and executes its reporting action, e.g. sends a message to Slack or\n   prints to the console.\n\n## Usage\nThere are currently two known usage patterns. The first and recommended one is\nvia a Docker container. The other one is the compilation from source.\n\n### Docker Container\nThe Docker image is\n[published to Docker Hub](https://hub.docker.com/r/bripkens/health-check-adapter/).\nThis makes it comfortable if you already have Docker configured. Care was taken\nto follow Docker best practices and to a have a proper init process. Image usage\nis easy and the only additional thing you will need is a configuration file for\nthe health checks.\n\nThe health check adapter expects a config file to exist at\n`/opt/health-check-adapter/config/config.yaml` within the container. To place\na config file at this location you can either create a derived image which\ncopies a config to this location or you can make use of volumes. The following\nexample shows how you can run the health check adapter in a Docker container\nusing volumes.\n\n```\ndocker run -v \"`pwd`:/opt/health-check-adapter/config\" \\\n       --name health-check-adapter \\\n       bripkens/health-check-adapter\n```\n\nThe command will start a Docker container and mount the current working\ndirectory at `/opt/health-check-adapter/config` within the container. This\nmeans that we can place a `config.yaml` into the current working directory\nin order to configure the health check adapter.\n\nApplication logging is enabled and logs are stored at\n`/var/log/health-check-adapter.log`. \n\n### Manual Setup\nThere is no distribution of the compiled application besides the Docker image.\nThis means that you will need to compile it from source in all other cases\nTo get this up and running manually…\n\n - clone this repository,\n - build the project, e.g. `sbt assembly` and\n - execute it with the main class `de.bripkens.ha.App` and the path to the\n   config file as its only argument.\n\n## Configuration\nIn order to make use of the health check adapter, you will need to configure\nthe components and reporters. The configuration is done in YAML format. The\nfollowing example shows a simple configuration. For further reference,\ninspect the [class definitions](https://github.com/bripkens/health-check-adapter/blob/master/src/main/scala/de/bripkens/ha/Configuration.scala)\ninto which the configuration will be deserialized.\n\n```yaml\n---\nendpoints:\n  - url: http://127.0.0.1:8081/healthcheck\n    id: shopping\n    name: Shopping System\n    # How often the health of the component should be checked in millis\n    interval: 3000\n    reporter: mySlackReporter\n  - url: http://127.0.0.1:8181/healthcheck\n    id: recommendation\n    name: Recommendation system\n    interval: 10000\n    reporter: myConsoleReporter\n\nreporters:\n  mySlackReporter:\n    type: slack\n    # either use a channel (identified via leading #) or\n    # send a direct message to a user (identified via leading @)\n    channel: #test\n    # see the Slack WebHook API reference to generate this url:\n    # https://api.slack.com/incoming-webhooks\n    webhookUrl: https://hooks.slack.com/services/\u003csome secret id\u003e\n    botName: Health Check\n    botImage: http://lorempixel.com/64/64/\n  myConsoleReporter:\n    type: console\n```\n\n## FAQ\n\n- **We are not using Slack, can we use this adapter with X?**: This health\n  check adapter has a concept of reporters. Currently only a Slack and console\n  reporter exist. Feel free to open a pull request to add another reporting\n  integration!\n\n## Contributing\n\n### Working on the Docker image\nTo work on the image, you can execute the `./deployment/build` script. It\nwill build the project and the Docker image. You can even try the Docker\nimage locally via:\n\n```\ndocker run -v \"`pwd`/src/test/resources:/opt/health-check-adapter/config\" \\\n       --name health-check-adapter \\\n       bripkens/health-check-adapter\n```\n\n### Releasing a new Docker image\nMake sure that you are signed in to Docker Hub via `docker login` and then\nexecute the `./deployment/build --release` script. The script will build the\nproject, build the new Docker image and push it to Docker Hub. The script\nwill only push to Docker Hub when the `--release` parameter is specified.\nThis is useful for local development purposes.\n\n## License ##\n\nThis code is open source software licensed under the [Apache 2.0 License](http://www.apache.org/licenses/LICENSE-2.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbripkens%2Fhealth-check-adapter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbripkens%2Fhealth-check-adapter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbripkens%2Fhealth-check-adapter/lists"}