Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

katalyst-healthcheck

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

katalyst-healthcheck

  • 0.5.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Katalyst::Healthcheck

Rails application and background task health monitoring.

Installation

Add this line to your application's Gemfile:

gem 'katalyst-healthcheck'

And then execute:

$ bundle

Or install it yourself as:

$ gem install katalyst-healthcheck

Usage

Configuration:

Redis URL will automatically be set from Rails configuration, but can be configured manually in an initializer, e.g.

Katalyst::Healthcheck.configure do |config|
  config.store.redis.options.url = "redis://hostname:port"
end

Add to routes:

get '/healthcheck', to: Katalyst::Healthcheck::Route.static(200, "OK")
get '/healthcheck/status', to: Katalyst::Healthcheck::Route.from_tasks
get '/healthcheck/dashboard', to: Katalyst::Healthcheck::Route.from_tasks(detail: true)

With the above configuration, the following routes will be available:

/healthcheck

A basic check that tests that the rails application is up and running.

/healthcheck/status

Tests that all application background tasks are running as expected.

All background tasks to be monitored must register successful completion of their work using the Katalyst::Healthcheck::Monitored concern's healthy! and unhealthy methods, e.g.

include Katalyst::Healthcheck::Monitored

define_healthcheck_task :my_task, "My task description", interval: 1.day

def do_task
  ... task code here ...
  healthy!(:my_task)
rescue Exception => e
  unhealthy!(:my_task, e.message)
end

Call healthy! at successful completion of a task to mark the task as healthy. Optionally, calling unhealthy! immediately marks that task as unhealthy. If a task is not marked as healthy! within a predefined interval, that task is considered unhealthy.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 19 Apr 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc