{"id":347,"name":null,"description":"Simple health check of Rails app for use with uptime checking sites like newrelic and pingdom","url":"https://github.com/Purple-Devs/health_check","last_synced_at":"2026-04-30T19:30:19.213Z","repository":{"id":793256,"uuid":"491737","full_name":"Purple-Devs/health_check","owner":"Purple-Devs","description":"Simple health check of Rails app for use with uptime checking sites like newrelic and pingdom","archived":false,"fork":false,"pushed_at":"2024-05-14T19:19:19.000Z","size":637,"stargazers_count":481,"open_issues_count":35,"forks_count":132,"subscribers_count":11,"default_branch":"master","last_synced_at":"2026-04-16T14:16:17.074Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","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/Purple-Devs.png","metadata":{"files":{"readme":"README.rdoc","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"MIT-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":"2010-01-28T05:11:30.000Z","updated_at":"2026-04-15T19:08:22.000Z","dependencies_parsed_at":"2024-01-21T16:06:05.083Z","dependency_job_id":"a7728b08-aec8-4065-ab22-1fbbffdc0fa7","html_url":"https://github.com/Purple-Devs/health_check","commit_stats":{"total_commits":484,"total_committers":40,"mean_commits":12.1,"dds":"0.13842975206611574","last_synced_commit":"5a19a91100ec8e731bc2c778312adfd2cb200cf2"},"previous_names":["ianheggie/health_check"],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/Purple-Devs/health_check","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Purple-Devs","download_url":"https://codeload.github.com/Purple-Devs/health_check/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31930100,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-17T12:37:54.787Z","status":"ssl_error","status_checked_at":"2026-04-17T12:37:25.095Z","response_time":62,"last_error":"SSL_read: 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"}},"owner":{"login":"Purple-Devs","name":"Purple-Devs","uuid":"120435984","kind":"organization","description":null,"email":null,"website":null,"location":null,"twitter":null,"company":null,"icon_url":"https://avatars.githubusercontent.com/u/120435984?v=4","repositories_count":4,"last_synced_at":"2023-03-10T19:32:45.735Z","metadata":{"has_sponsors_listing":false},"html_url":"https://github.com/Purple-Devs","funding_links":[],"total_stars":null,"followers":null,"following":null,"created_at":"2023-03-10T19:32:45.736Z","updated_at":"2023-03-10T19:32:45.736Z","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Purple-Devs","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Purple-Devs/repositories"},"packages":[],"commits":{"id":272610,"full_name":"Purple-Devs/health_check","default_branch":"master","total_commits":485,"total_committers":41,"total_bot_commits":0,"total_bot_committers":0,"mean_commits":11.829268292682928,"dds":0.14020618556701026,"past_year_total_commits":0,"past_year_total_committers":0,"past_year_total_bot_commits":0,"past_year_total_bot_committers":0,"past_year_mean_commits":0.0,"past_year_dds":0.0,"last_synced_at":"2026-04-29T12:31:43.493Z","last_synced_commit":"53ae042bf0cc69b1d8d7b1b47e2296303b0a591c","created_at":"2023-03-08T14:00:29.178Z","updated_at":"2026-04-29T12:31:27.947Z","committers":[{"name":"Ian Heggie","email":"ian@heggie.biz","login":"ianheggie","count":417},{"name":"Filip","email":"filip.haftek@airhelp.com","login":null,"count":17},{"name":"kenner kliemann","email":"kenner.hp@gmail.com","login":"gnomex","count":4},{"name":"Yuji Hanamura","email":"yuji.developer@gmail.com","login":"yujideveloper","count":4},{"name":"John D'Agostino","email":"john.dagostino@fairfaxmedia.com.au","login":null,"count":3},{"name":"Marek de Heus","email":"marek@deheus.net","login":"mdh","count":2},{"name":"Emil Sågfors","email":"emil.sagfors@iki.fi","login":"lime","count":2},{"name":"Anton Dimitrov","email":"dimitrov.anton@gmail.com","login":"antonrd","count":2},{"name":"Alessio Signorini","email":"alessio@signorini.us","login":"alessio-signorini","count":2},{"name":"Charles Comstock","email":"dgtized@gmail.com","login":"dgtized","count":1},{"name":"Brian Beyer","email":"brianebeyer@gmail.com","login":"brianebeyer","count":1},{"name":"Archana Singh","email":"archana@juvo.com","login":"archana-juvo","count":1},{"name":"tokenshift","email":"Nathan.Clark+github@tokenshift.com","login":"tokenshift","count":1},{"name":"Flo Heinle","email":"florian.heinle@posteo.de","login":null,"count":1},{"name":"Alex Zherdev","email":"alex.zherdev@siliconmint.com","login":null,"count":1},{"name":"thorstenspringhart","email":"thorstenspringhart@endress.com","login":null,"count":1},{"name":"macgregordennis","email":"macgregordennis@gmail.com","login":null,"count":1},{"name":"Yves Le Douaron","email":"yves@finalcad.com","login":null,"count":1},{"name":"Redmar Kerkhoff","email":"rkerkhoff@digidentity.eu","login":null,"count":1},{"name":"Omar Khan","email":"okhan@instructure.com","login":null,"count":1},{"name":"Iuri Matias","email":"iuri.matias@gmail.com","login":"iurimatias","count":1},{"name":"Vesa Laakso","email":"laakso.vesa@gmail.com","login":"valscion","count":1},{"name":"Ryan Selk","email":"ryanselk@gmail.com","login":"rselk","count":1},{"name":"Ryan McGeary","email":"ryan@mcgeary.org","login":"rmm5t","count":1},{"name":"Richard Lee","email":"dlackty@gmail.com","login":"dlackty","count":1},{"name":"Olle Jonsson","email":"olle.jonsson@gmail.com","login":"olleolleolle","count":1},{"name":"Michael Noack","email":"michael@noack.com.au","login":"mnoack","count":1},{"name":"Marcos Toledo","email":"mtoledo@gmail.com","login":"dui","count":1},{"name":"Marcio Gomes","email":"mgomes@fairfaxmedia.com.au","login":"mgomes1","count":1},{"name":"KrunaL Parvadiya","email":"krunalcp@gmail.com","login":"krunalcp","count":1},{"name":"Kevin Traver","email":"kevintraver@gmail.com","login":"kevintraver","count":1},{"name":"Katsuki","email":"Katsuki_Sato0130@icloud.com","login":"K-Sato1995","count":1},{"name":"Jordan Yaker","email":"jordan.e.yaker@gmail.com","login":"jordanyaker","count":1},{"name":"John Lemp","email":"john@graavy.com","login":"duckworth","count":1},{"name":"Gregor Schmidt","email":"gregor.schmidt@tourlane.com","login":"schm","count":1},{"name":"Gabe Kopley","email":"gabe@binti.com","login":"gkop","count":1},{"name":"Fernando Alvarez","email":"feju@akra.de","login":"arbesulo","count":1},{"name":"Felix Bünemann","email":"buenemann@louis.info","login":"felixbuenemann","count":1},{"name":"Dmytro Stepaniuk","email":"stepaniuk@mlsdev.com","login":"DmytroStepaniuk","count":1},{"name":"Corrado Masciullo","email":"masciugo@gmail.com","login":"masciugo","count":1},{"name":"Nate Faerber","email":"nate@ujet.co","login":null,"count":1}],"past_year_committers":[],"commits_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/commits","host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-29T00:00:10.453Z","repositories_count":6222923,"commits_count":900408653,"contributors_count":34905630,"owners_count":1147472,"icon_url":"https://github.com/github.png","host_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://commits.ecosyste.ms/api/v1/hosts/GitHub/repositories"}},"issues_stats":{"full_name":"Purple-Devs/health_check","html_url":"https://github.com/Purple-Devs/health_check","last_synced_at":"2026-04-25T17:00:37.402Z","status":"error","issues_count":55,"pull_requests_count":66,"avg_time_to_close_issue":32393161.87878788,"avg_time_to_close_pull_request":27792899.11320755,"issues_closed_count":33,"pull_requests_closed_count":53,"pull_request_authors_count":52,"issue_authors_count":44,"avg_comments_per_issue":1.9272727272727272,"avg_comments_per_pull_request":2.090909090909091,"merged_pull_requests_count":34,"bot_issues_count":0,"bot_pull_requests_count":0,"past_year_issues_count":2,"past_year_pull_requests_count":0,"past_year_avg_time_to_close_issue":null,"past_year_avg_time_to_close_pull_request":null,"past_year_issues_closed_count":0,"past_year_pull_requests_closed_count":0,"past_year_pull_request_authors_count":0,"past_year_issue_authors_count":2,"past_year_avg_comments_per_issue":0.0,"past_year_avg_comments_per_pull_request":null,"past_year_bot_issues_count":0,"past_year_bot_pull_requests_count":0,"past_year_merged_pull_requests_count":0,"created_at":"2023-05-12T11:55:30.710Z","updated_at":"2026-04-25T17:00:37.402Z","repository_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check","issues_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories/Purple-Devs%2Fhealth_check/issues","issue_labels_count":{"Needs further work / discussion":4,"Enhancement":4,"Idea":3,"Like":2,"Bug":1},"pull_request_labels_count":{"Enhancement":7,"Needs further work / discussion":5,"Like":1},"issue_author_associations_count":{"NONE":47,"CONTRIBUTOR":5,"COLLABORATOR":3},"pull_request_author_associations_count":{"NONE":33,"CONTRIBUTOR":30,"COLLABORATOR":3},"issue_authors":{"trombini77":4,"ianheggie":3,"jmarchello":3,"DannyBen":3,"brandondrew":2,"haffla":2,"nikolai-b":1,"nwlucas":1,"ndbroadbent":1,"mipearson":1,"CaioCSdev":1,"httpdss":1,"benlinton":1,"connorshea":1,"masciugo":1,"illegalnumbers":1,"rmzoni":1,"hotgazpacho":1,"mithucste30":1,"mnoack":1,"zoltrain":1,"alain-andre":1,"Crammaman":1,"evolve2k":1,"jclif":1,"vergenzt":1,"jasonkarns":1,"rahil-helios":1,"morus":1,"wyaeld":1,"artempartos":1,"adrys-lab":1,"evanbattaglia":1,"brentsnook":1,"dfuentes77":1,"wesley-harding":1,"icapuccio":1,"shlima":1,"ACPK":1,"gmassman":1,"johanlunds":1,"pyromaniac":1,"lcx":1,"miguelaferreira":1},"pull_request_authors":{"ianheggie":3,"filiphaftek":3,"alessio-signorini":2,"olleolleolle":2,"ryanmt":2,"lime":2,"cprodhomme":2,"ArmandoAssuncao":2,"yujideveloper":2,"kevintraver":2,"y-yagi":2,"kianmeng":2,"simonsanchez":1,"katsudonik":1,"felixbuenemann":1,"dlackty":1,"DmytroStepaniuk":1,"gkop":1,"archanasingh":1,"romanb":1,"omarkhan":1,"lowang":1,"broosk1993":1,"jordanyaker":1,"ghost":1,"lcx":1,"mrcook":1,"jmarchello":1,"Crammaman":1,"ouranos":1,"britton":1,"natefaerber":1,"duckworth":1,"cconstantine":1,"gnomex":1,"schm":1,"rmm5t":1,"masciugo":1,"rmzoni":1,"mnoack":1,"rselk":1,"willnet":1,"thorstenspringhart":1,"tokenshift":1,"yld":1,"K-Sato1995":1,"nirvdrum":1,"arbesulo":1,"jamiemccarthy":1,"FloHeinle":1,"rhuanbarreto":1,"itsatifjaved":1},"host":{"name":"GitHub","url":"https://github.com","kind":"github","last_synced_at":"2026-04-29T00:00:10.439Z","repositories_count":14445388,"issues_count":34191397,"pull_requests_count":112259968,"authors_count":11248822,"icon_url":"https://github.com/github.png","host_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/repositories","owners_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/owners","authors_url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors"},"past_year_issue_labels_count":{},"past_year_pull_request_labels_count":{},"past_year_issue_author_associations_count":{"NONE":1},"past_year_pull_request_author_associations_count":{},"past_year_issue_authors":{"morus":1},"past_year_pull_request_authors":{},"maintainers":[{"login":"ianheggie","count":6,"url":"https://issues.ecosyste.ms/api/v1/hosts/GitHub/authors/ianheggie"}],"active_maintainers":[]},"events":{"total":{"PullRequestEvent":1,"ForkEvent":5,"IssuesEvent":3,"WatchEvent":6,"IssueCommentEvent":4,"PullRequestReviewEvent":1,"PullRequestReviewCommentEvent":1},"last_year":{"ForkEvent":3,"IssuesEvent":1,"WatchEvent":4,"IssueCommentEvent":1}},"keywords":[],"dependencies":[{"ecosystem":"rubygems","filepath":"Gemfile","sha":null,"kind":"manifest","created_at":"2022-08-08T13:00:15.282Z","updated_at":"2022-08-08T13:00:15.282Z","repository_link":"https://github.com/Purple-Devs/health_check/blob/master/Gemfile","dependencies":[{"id":656272558,"package_name":"jruby-openssl","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"development","optional":false},{"id":656272559,"package_name":"activerecord-jdbcsqlite3-adapter","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"development","optional":false},{"id":656272560,"package_name":"sqlite3","ecosystem":"rubygems","requirements":"~\u003e 1.3.7","direct":true,"kind":"development","optional":false},{"id":656272561,"package_name":"travis-lint","ecosystem":"rubygems","requirements":"\u003e= 0","direct":true,"kind":"development","optional":false}]},{"ecosystem":"rubygems","filepath":"health_check.gemspec","sha":null,"kind":"manifest","created_at":"2022-08-08T13:00:15.581Z","updated_at":"2022-08-08T13:00:15.581Z","repository_link":"https://github.com/Purple-Devs/health_check/blob/master/health_check.gemspec","dependencies":[{"id":656272668,"package_name":"railties","ecosystem":"rubygems","requirements":"\u003e= 5.0","direct":true,"kind":"runtime","optional":false},{"id":656272669,"package_name":"smarter_bundler","ecosystem":"rubygems","requirements":"\u003e= 0.1.0","direct":true,"kind":"development","optional":false},{"id":656272670,"package_name":"rake","ecosystem":"rubygems","requirements":"\u003e= 0.8.3","direct":true,"kind":"development","optional":false},{"id":656272671,"package_name":"shoulda","ecosystem":"rubygems","requirements":"~\u003e 2.11.0","direct":true,"kind":"development","optional":false},{"id":656272672,"package_name":"bundler","ecosystem":"rubygems","requirements":"\u003e= 1.2","direct":true,"kind":"development","optional":false}]}],"score":9.95967883218587,"created_at":"2024-12-15T21:38:07.821Z","updated_at":"2026-04-30T19:30:19.214Z","avatar_url":"https://github.com/Purple-Devs.png","language":"Shell","monthly_downloads":0,"readme":"= health_check gem\n\nSimple health check of Rails 5.x and 6.x apps for use with Pingdom, NewRelic, EngineYard etc.\n\nThe basic goal is to quickly check that rails is up and running and that it has access to correctly configured resources (database, email gateway)\n\nCheck the latest README {master}[https://github.com/ianheggie/health_check/tree/master] for other versions\n\nUse gem versions for stable releases:\n* ~\u003e 3.x for Rails 5.x and 6.x (etc until there is a proven need to split off another branch),\n* ~\u003e 2.x for Rails 4.x,\n* ~\u003e 1.7 for Rails 3.x,\n* ~\u003e 1.6.3 for Rails 2.3\n\nNote: it is best to pin to a specific commit if using a development branch as sometimes tests break.\n\nhealth_check provides various monitoring URIs, for example:\n\n    curl localhost:3000/health_check\n    success\n\n    curl localhost:3000/health_check/all.json\n    {\"healthy\":true,\"message\":\"success\"}\n\n    curl localhost:3000/health_check/database_cache_migration.xml\n    \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n    \u003chash\u003e\n      \u003chealthy type=\"boolean\"\u003etrue\u003c/healthy\u003e\n      \u003cmessage\u003esuccess\u003c/message\u003e\n    \u003c/hash\u003e\n\nYou may also issue POST calls instead of GET to these urls.\n\nOn failure (detected by health_check) a 500 http status is returned with a simple explanation of the failure\n(if include_error_in_response_body is true)\n\n    curl localhost:3000/health_check/fail\n    health_check failed: invalid argument to health_test.\n\nThe health_check controller disables sessions for versions that eagerly load sessions.\n\n== Checks\n\n* standard (default) - site, database and migrations checks are run plus email if ActionMailer is defined and it is not using the default configuration\n* all / full - all checks are run (can be overriden in config block)\n* cache - checks that a value can be written to the cache\n* custom - runs checks added via config.add_custom_check\n* database - checks that the current migration level can be read from the database\n* email - basic check of email - :test returns true, :sendmail checks file is present and executable, :smtp sends HELO command to server and checks response\n* migration - checks that the database migration level matches that in db/migrations\n* rabbitmq - RabbitMQ Health Check\n* redis / redis-if-present - checks Redis connectivity\n* resque-redis / resque-redis-if-present - checks Resque connectivity to Redis\n* s3 / s3-if-present - checks proper permissions to s3 buckets\n* sidekiq-redis / sidekiq-redis-if-present - checks Sidekiq connectivity to Redis\n* elasticsearch / elasticsearch-if-present - checks Elasticsearch connectivity\n* site - checks rails is running sufficiently to render text\n\nSome checks have a *-if-present form, which only runs the check if the corresponding library has been required.\n\nThe email gateway is not checked unless the smtp settings have been changed.\nSpecify full or include email in the list of checks to verify the smtp settings\n(eg use 127.0.0.1 instead of localhost).\n\nNote: rails also checks migrations by default in development mode and throws an ActiveRecord::PendingMigrationError exception (http error 500) if there is an error\n\n== Installation\n\nAdd the following line to Gemfile (after the rails gems are listed)\n\n    gem 'health_check'\n\nAnd then execute\n\n    bundle\n\nOr install it yourself as:\n\n    gem install health_check\n\n== Configuration\n\nTo change the configuration of health_check, create a file `config/initializers/health_check.rb` and add a configuration block like:\n\n    HealthCheck.setup do |config|\n\n      # uri prefix (no leading slash)\n      config.uri = 'health_check'\n\n      # Text output upon success\n      config.success = 'success'\n\n      # Text output upon failure\n      config.failure = 'health_check failed'\n\n      # Disable the error message to prevent /health_check from leaking\n      # sensitive information\n      config.include_error_in_response_body = false\n\n      # Log level (success or failure message with error details is sent to rails log unless this is set to nil)\n      config.log_level = 'info'\n\n      # Timeout in seconds used when checking smtp server\n      config.smtp_timeout = 30.0\n\n      # http status code used when plain text error message is output\n      # Set to 200 if you want your want to distinguish between partial (text does not include success) and\n      # total failure of rails application (http status of 500 etc)\n\n      config.http_status_for_error_text = 500\n\n      # http status code used when an error object is output (json or xml)\n      # Set to 200 if you want to distinguish between partial (healthy property == false) and\n      # total failure of rails application (http status of 500 etc)\n\n      config.http_status_for_error_object = 500\n\n      # bucket names to test connectivity - required only if s3 check used, access permissions can be mixed\n      config.buckets = {'bucket_name' =\u003e [:R, :W, :D]}\n\n      # You can customize which checks happen on a standard health check, eg to set an explicit list use:\n      config.standard_checks = [ 'database', 'migrations', 'custom' ]\n\n      # Or to exclude one check:\n      config.standard_checks -= [ 'emailconf' ]\n\n      # You can set what tests are run with the 'full' or 'all' parameter\n      config.full_checks = ['database', 'migrations', 'custom', 'email', 'cache', 'redis', 'resque-redis', 'sidekiq-redis', 's3']\n\n      # Add one or more custom checks that return a blank string if ok, or an error message if there is an error\n      config.add_custom_check do\n        CustomHealthCheck.perform_check # any code that returns blank on success and non blank string upon failure\n      end\n\n      # Add another custom check with a name, so you can call just specific custom checks. This can also be run using\n      # the standard 'custom' check.\n      # You can define multiple tests under the same name - they will be run one after the other.\n      config.add_custom_check('sometest') do\n        CustomHealthCheck.perform_another_check # any code that returns blank on success and non blank string upon failure\n      end\n\n      # max-age of response in seconds\n      # cache-control is public when max_age \u003e 1 and basic_auth_username is not set\n      # You can force private without authentication for longer max_age by\n      # setting basic_auth_username but not basic_auth_password\n      config.max_age = 1\n\n      # Protect health endpoints with basic auth\n      # These default to nil and the endpoint is not protected\n      config.basic_auth_username = 'my_username'\n      config.basic_auth_password = 'my_password'\n\n      # Whitelist requesting IPs by a list of IP and/or CIDR ranges, either IPv4 or IPv6 (uses IPAddr.include? method to check)\n      # Defaults to blank which allows any IP\n      config.origin_ip_whitelist = %w(123.123.123.123 10.11.12.0/24 2400:cb00::/32)\n\n      # Use ActionDispatch::Request's remote_ip method when behind a proxy to pick up the real remote IP for origin_ip_whitelist check\n      # Otherwise uses Rack::Request's ip method (the default, and always used by Middleware), which is more susceptable to spoofing\n      # See https://stackoverflow.com/questions/10997005/whats-the-difference-between-request-remote-ip-and-request-ip-in-rails\n      config.accept_proxied_requests = false\n\n      # http status code used when the ip is not allowed for the request\n      config.http_status_for_ip_whitelist_error = 403\n\n      # rabbitmq\n      config.rabbitmq_config = {}\n\n      # When redis url/password is non-standard\n      config.redis_url = 'redis_url' # default ENV['REDIS_URL']\n      # Only included if set, as url can optionally include passwords as well\n      config.redis_password = 'redis_password' # default ENV['REDIS_PASSWORD']\n\n      # Failure Hooks to do something more ...\n      # checks lists the checks requested\n      config.on_failure do |checks, msg|\n        # log msg somewhere\n      end\n    \n      config.on_success do |checks|\n        # flag that everything is well\n      end\n  \n\n    end\n\nYou may call add_custom_check multiple times with different tests. These tests will be included in the default list (\"standard\").\n\nIf you have a catchall route then add the following line above the catch all route (in `config/routes.rb`):\n   health_check_routes\n\n=== Installing As Middleware\n\nInstall health_check as middleware if you want to sometimes ignore exceptions from later parts of the Rails middleware stack,\neg DB connection errors from QueryCache. The \"middleware\" check will fail if you have not installed health_check as middleware.\n\nTo install health_check as middleware add the following line to the config/application.rb:\n    config.middleware.insert_after Rails::Rack::Logger, HealthCheck::MiddlewareHealthcheck\n\nNote: health_check is installed as a full rails engine even if it has been installed as middleware. This is so the\nremaining checks continue to run through the complete rails stack.\n\nYou can also adjust what checks are run from middleware, eg if you want to exclude the checking of the database etc, then set\n  config.middleware_checks = ['middleware', 'standard', 'custom']\n  config.standard_checks = ['middleware', 'custom']\n\nMiddleware checks are run first, and then full stack checks.\nWhen installed as middleware, exceptions thrown when running the full stack tests are formatted in the standard way.\n\n== Uptime Monitoring\n\nUse a website monitoring service to check the url regularly for the word \"success\" (without the quotes) rather than just a 200 http status so\nthat any substitution of a different server or generic information page should also be reported as an error.\n\nIf an error is encounted, the text \"health_check failed: some error message/s\" will be returned and the http status will be 500.\n\nSee\n\n* Pingdom Website Monitoring - https://www.pingdom.com\n* NewRelic Availability Monitoring - http://newrelic.com/docs/features/availability-monitoring-faq\n* Engine Yard's guide - https://support.cloud.engineyard.com/entries/20996821-monitor-application-uptime (although the guide is based on fitter_happier plugin it will also work with this gem)\n* Nagios check_http (with -s success) - https://www.nagios-plugins.org/doc/man/check_http.html\n* Any other montoring service that can be set to check for the word success in the text returned from a url\n\n=== Requesting Json and XML responses\n\nHealth_check will respond with an encoded hash object if json or xml is requested.\nEither set the HTTP Accept header or append .json or .xml to the url.\n\nThe hash contains two keys:\n* healthy - true if requested checks pass (boolean)\n* message - text message (\"success\" or error message)\n\nThe following commands\n\n  curl -v localhost:3000/health_check.json\n  curl -v localhost:3000/health_check/email.json\n  curl -v -H \"Accept: application/json\" localhost:3000/health_check\n\nWill return a result with Content-Type: application/json and body like:\n\n  {\"healthy\":true,\"message\":\"success\"}\n\nThese following commands\n\n  curl -v localhost:3000/health_check.xml\n  curl -v localhost:3000/health_check/migration_cache.xml\n  curl -v -H \"Accept: text/xml\" localhost:3000/health_check/cache\n\nWill return a result with Content-Type: application/xml and body like:\n\n  \u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n  \u003chash\u003e\n    \u003chealthy type=\"boolean\"\u003etrue\u003c/healthy\u003e\n    \u003cmessage\u003esuccess\u003c/message\u003e\n  \u003c/hash\u003e\n\nSee https://github.com/ianheggie/health_check/wiki/Ajax-Example for an Ajax example\n\n== Silencing log output\n\nIt is recomended that you use silencer, lograge or one of the other log filtering gems.\n\nFor example, with lograge use the following to exclude health_check from being logged:\n\n    config.lograge.ignore_actions = [\"HealthCheck::HealthCheckController#index\"]\n\nLikewise you will probably want to exclude health_check from monitoring systems like newrelic.\n\n== Caching\n\nCache-control is set with\n* public if max_age is \u003e 1 and basic_auth_username is not set (otherwise private)\n* no-cache\n* must-revalidate\n* max-age (default 1)\n\nLast-modified is set to the current time (rounded down to a multiple of max_age when max_age \u003e 1)\n\n== Known Issues\n\n* See https://github.com/ianheggie/health_check/issues\n* No inline documentation for methods\n* \u003cb\u003ervm gemsets breaks the test\u003c/b\u003e - specifically \u003ctt\u003ervm use 1.9.3\u003c/tt\u003e works but \u003ctt\u003ervm gemset use ruby-1.9.3-p385@health_check --create\u003c/tt\u003e triggers a \"Could not find gem 'coffee-rails (~\u003e 3.2.1) ruby' in the gems available on this machine.\" error in the last call to bundle (installing health_check as a gem via a path into the temp railsapp)\n\n== Similar projects\n\n* fitter_happier plugin by atmos - plugin with similar goals, but not compatible with uptime, and does not check email gateway\n* HealthBit - inspired by this gem but with a fresh start as a simpler rack only application, no travis CI tests (yet?) but looks interesting.\n\n== Testing\n\n=== Automated testing and other checks\n\n* {\u003cimg src=\"https://badge.fury.io/rb/health_check.svg\" alt=\"Gem Version\" /\u003e}[http://badge.fury.io/rb/health_check] - Latest Gem\n* {\u003cimg src=\"https://travis-ci.org/ianheggie/health_check.svg\"\u003e}[https://travis-ci.org/ianheggie/health_check]  - Travis CI\n* {\u003cimg src=\"https://codeclimate.com/github/ianheggie/health_check.svg\" /\u003e}[https://codeclimate.com/github/ianheggie/health_check] - Code quality\n* {\u003cimg src=\"https://gemnasium.com/ianheggie/health_check.svg\"\u003e}[https://gemnasium.com/ianheggie/health_check] - Gem dependencies\n\n=== Manual testing\n\nThe instructions have been changed to using a vagrant virtual box for consistent results.\n\nInstall vagrant 1.9.7 or later and virtual_box or other local virtual machine provider.  Add the vagrant plugin called vbguest.\n\n    vagrant plugin install vagrant-vbguest\n\nCreate a temp directory for throw away testing, and clone the health_check gem into it\n\n    mkdir -p ~/tmp\n    cd ~/tmp\n    git clone https://github.com/ianheggie/health_check.git ~/tmp/health_check\n\nThe Vagrantfile includes provisioning rules to install chruby (ruby version control),\nruby-build will also be installed and run to build various rubies under /opt/rubies.\n\nUse \u003ctt\u003evagrant ssh\u003c/tt\u003e to connect to the virtual box and run tests.\n\nThe test script will package up and install the gem under a temporary path, create a dummy rails app configured for sqlite,\ninstall the gem, and then run up tests against the server.\nThis will require TCP port 3456 to be free.\n\nCd to the checked out health_check directory and then run the test as follows:\n\n    cd ~/tmp/health_check\n\n    vagrant up   # this will also run vagrant provision and take some time\n                 # chruby and various ruby versions will be installed\n\n    vagrant ssh\n\n    cd /vagrant  # the current directory on your host is mounted here on the virtual machine\n\n    chruby 2.2.2 # or some other ruby version (run chruby with no arguments to see the current list)\n\n    test/test_with_railsapp\n\n    exit        # from virtual machine when finished\n\nThe script will first call `test/setup_railsapp` to setup a rails app with health_check installed and then\nrun up the rails server and perform veraious tests.\n\nThe script `test/setup_railsapp` will prompt you for which gemfile under test you wish to use to install the appropriate rails version, and then\nsetup tmp/railsapp accordingly.\n\nThe command `rake test` will also launch these tests, except it cannot install the bundler and rake gems if they are missing first (unlike test/test_with_railsapp)\n\n== Copyright\n\nCopyright (c) 2010-2021 Ian Heggie, released under the MIT license.\nSee MIT-LICENSE for details.\n\n== Contributors\n\nThanks go to the various people who have given feedback and suggestions via the issues list and pull requests.\n\n=== Contributing\n\nUse gem versions for stable releases, or github branch / commits for development versions:\n* for Rails 5.x and 6.x use feature branched off master {master}[https://github.com/ianheggie/health_check/tree/master] for development;\n* for Rails 4.x use feature branches off the {rails4}[https://github.com/ianheggie/health_check/tree/rails4] stable branch for development;\n* for Rails 3.x use feature branches off the {rails3}[https://github.com/ianheggie/health_check/tree/rails3] stable branch for development;\n* for Rails 2.3 use feature branches off the {rails2.3}[https://github.com/ianheggie/health_check/tree/rails2.3] stable branch for development;\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Create a test that confirms your changes work\n4. Update README.rdoc to explain enhancements, or add succinct comment in code when fixing bugs\n5. Commit your changes (`git commit -am 'Add some feature'`)\n6. Push to the branch (`git push origin my-new-feature`)\n7. Create new Pull Request (Code with BDD tests and documentation are highly favoured)\n\n\u003cem\u003eFeedback welcome! Especially with suggested replacement code, tests and documentation\u003c/em\u003e\n","funding_links":[],"readme_doi_urls":[],"works":{},"citation_counts":{},"total_citations":0,"keywords_from_contributors":["activerecord","crash-reporting","activejob","mvc","sidekiq","sinatra","rspec","error-monitoring","error-handler","ruby-gem"],"project_url":"https://ruby.ecosyste.ms/api/v1/projects/347","html_url":"https://ruby.ecosyste.ms/projects/347"}