New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

rails-monitoring

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rails-monitoring

  • 0.3.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

rails-monitoring

Rails engine that provides a JSON API which serves Sidekiq and Whenever status information from a HTTP-auth protected endpoint. This status information is gathered by scheduling a frequently running job that saves timestamps in Redis.

Installation

Add gem to your project:

gem 'rails-monitoring'

Mount engine in routes.rb:

Rails.application.routes.draw do
  mount Rails::Monitoring::Engine => '/monitoring'
end

Schedule job in whenever's schedule.rb:

every 5.minutes do
  runner 'Rails::Monitoring::Status.refresh'
end

Be sure that your parent app provides HTTP basic authentication credentials using an initializer

# app/config/initializers/monitoring.rb
Rails::Monitoring.http_auth_name = 'user'
Rails::Monitoring.http_auth_password = 'password'

This engine's controller inherits from ApplicationController by default. You can change this using the parent_controller option

Rails::Monitoring.parent_controller = 'SomeOtherController'

Usage

Navigate to /monitoring/status and receive Sidekiq status information:

{
  "timestamps": {
    "whenever_ran": "2018-01-23 15:05:02",
    "sidekiq_performed": "2018-01-23 15:05:02",
    "requested": "2018-01-23 15:08:28"
  },
  "sidekiq": {
    "active_workers": 0,
    "queue_sizes": {
      "mailers": 0,
      "default": 0,
      "scheduled": 0,
      "retries": 0,
      "dead": 0
    },
    "recent_history": {
      "processed": {
        "2018-01-23": 18,
        "2018-01-22": 0,
        "2018-01-21": 0,
        "2018-01-20": 0,
        "2018-01-19": 0
      },
      "failed": {
        "2018-01-23": 0,
        "2018-01-22": 0,
        "2018-01-21": 0,
        "2018-01-20": 0,
        "2018-01-19": 0
      }
    },
    "totals": {
      "processed": 18,
      "failed": 0
    }
  }
}

Development

Run tests with

bundle exec rake test

FAQs

Package last updated on 11 May 2021

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