Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bitcrowd/rails-monitoring
A rails engine to monitor sidekiq internals.
https://github.com/bitcrowd/rails-monitoring
Last synced: about 1 month ago
JSON representation
A rails engine to monitor sidekiq internals.
- Host: GitHub
- URL: https://github.com/bitcrowd/rails-monitoring
- Owner: bitcrowd
- License: mit
- Created: 2018-01-18T09:50:07.000Z (almost 7 years ago)
- Default Branch: main
- Last Pushed: 2023-04-24T20:38:14.000Z (over 1 year ago)
- Last Synced: 2024-11-08T21:45:49.363Z (about 2 months ago)
- Language: Ruby
- Size: 134 KB
- Stars: 12
- Watchers: 10
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# 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:
```ruby
gem 'rails-monitoring'
```Mount engine in `routes.rb`:
```ruby
Rails.application.routes.draw do
mount Rails::Monitoring::Engine => '/monitoring'
end
```Schedule job in `whenever`'s `schedule.rb`:
```ruby
every 5.minutes do
runner 'Rails::Monitoring::Status.refresh'
end
```Be sure that your parent app provides HTTP basic authentication credentials
using an initializer```ruby
# 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```ruby
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
```sh
bundle exec rake test
```