{"id":17942499,"url":"https://github.com/locaweb/heartcheck","last_synced_at":"2025-04-04T13:11:21.999Z","repository":{"id":27080236,"uuid":"30546893","full_name":"locaweb/heartcheck","owner":"locaweb","description":"A simple way to check if everything is good in your app","archived":false,"fork":false,"pushed_at":"2024-12-09T18:48:23.000Z","size":133,"stargazers_count":23,"open_issues_count":6,"forks_count":28,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-03-28T12:07:49.883Z","etag":null,"topics":["hacktoberfest","health-check","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/locaweb.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE.txt","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-02-09T16:58:56.000Z","updated_at":"2024-08-08T20:08:44.000Z","dependencies_parsed_at":"2022-08-31T16:11:51.113Z","dependency_job_id":"711563dc-d884-4107-9526-ea2c77465cf2","html_url":"https://github.com/locaweb/heartcheck","commit_stats":{"total_commits":108,"total_committers":27,"mean_commits":4.0,"dds":0.8796296296296297,"last_synced_commit":"6b846295df5311ca501ca281026dcfad60cda237"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaweb%2Fheartcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaweb%2Fheartcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaweb%2Fheartcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/locaweb%2Fheartcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/locaweb","download_url":"https://codeload.github.com/locaweb/heartcheck/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247182365,"owners_count":20897380,"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":["hacktoberfest","health-check","ruby"],"created_at":"2024-10-29T03:05:51.819Z","updated_at":"2025-04-04T13:11:21.981Z","avatar_url":"https://github.com/locaweb.png","language":"Ruby","readme":"# Heartcheck\n\nHeartcheck is a monitoring tool for Rack applications. It provides a DSL to\ndeclare service checks and an URI that returns the status for each service.\nWith this gem you can monitor if your app has access to the database, a cache\nservice, an API, etc.\n\n[![Build Status](https://github.com/locaweb/heartcheck/actions/workflows/ci.yml/badge.svg)](https://github.com/locaweb/heartcheck/actions/workflows/ci.yml)\n[![Code Climate](https://codeclimate.com/github/locaweb/heartcheck/badges/gpa.svg)](https://codeclimate.com/github/locaweb/heartcheck)\n[![Ebert](https://ebertapp.io/github/locaweb/heartcheck.svg)](https://ebertapp.io/github/locaweb/heartcheck)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'heartcheck'\n```\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install heartcheck\n\n## Usage\n\nFirst generate the config file for the framework you are using:\n\n    $ heartcheck rails\n    $ heartcheck padrino\n    $ heartcheck sinatra\n\nThen edit the generated file by adding your checks on it and restart your\nserver. Now you should be able to make a HTTP request for `/monitoring` and\nget a JSON response that contains the status for each monitored service.\n\nThe following environment variables are needed by heartcheck:\n\n    HEARTCHECK_APP_NAME=MyApplicationName\n\n\n### Using built-in checks\n\n#### Firewall check\n\n```ruby\nHeartcheck.setup do |config|\n  config.add :firewall do |c|\n    c.add_service(host: 'domain.com', port: 80)\n    c.add_service(host: 'domain.com', port: 80, timeout: 5) # Default timeout is 2 seconds\n    c.add_service(url: 'https://domain.com')\n    c.add_service(url: 'https://domain.com', proxy: 'http://proxy.domain.com')\n  end\nend\n```\n\n## HTTP Routes\n\n#### Basic health check\n\nTo get the status for all services, make a HTTP request for the following URI:\n\n    /monitoring\n\nIt will return a JSON response and a status for each service.\n\n#### Functional status\n\nFunctional services are services essential for your application. You can get\ntheir status using the following route:\n\n    /monitoring/functional\n\n#### Info route\n\nThis route returns custom information about your app. You can configure it to\nreturn whatever information you want:\n\n    /monitoring/info\n\n#### Dev status\n\nReturns some debugging information:\n\n    /monitoring/dev\n\n#### Very basic health check\n\nReturns a simple `ok` if the app is running. It does not execute any configured\nchecks:\n\n    /monitoring/health_check\n\n\n#### General info and dependencies\n\nReturns general application info and a list of dependencies' URIs, but executes no checking:\n\n    /monitoring/inspect\n\n## Response formatting\n\nAn optional formatter may be set for the monitoring response. We provide the default format\nusing a list of hashes and one with a single Hash. Please check `Heartcheck.use_hash_formatter!`\n\n## Plugins\n\n* [ActiveRecord](https://github.com/locaweb/heartcheck-activerecord)\n* [Cache](https://github.com/locaweb/heartcheck-cache)\n* [Cas](https://github.com/locaweb/heartcheck-cas)\n* [Paypal](https://github.com/feolea/heartcheck-paypal)\n* [Redis](https://github.com/locaweb/heartcheck-redis)\n* [Resque](https://github.com/locaweb/heartcheck-resque)\n* [Sidekiq](https://github.com/locaweb/heartcheck-sidekiq)\n* [Webservice](https://github.com/locaweb/heartcheck-webservice)\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at\nhttps://github.com/locaweb/heartcheck.\n\n#### Docker\n\nHeartcheck can be setup with Docker and Docker Compose on macOS or Linux systems,\nso that you don't need to install ruby and it's dependencies via rbenv or rvm.\n\nJust do your setup locally by running:\n\n```\n./scripts/heartcheck setup\n```\n\nRun `./scripts/heartcheck -h` to see available options, such as bash, rspec, etc.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocaweb%2Fheartcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flocaweb%2Fheartcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flocaweb%2Fheartcheck/lists"}