Sidewatch
Sidewatch uploads Sidekiq metrics to AWS CloudWatch in regular intervals.
Installation
Add this line to your application's Gemfile:
gem 'sidewatch'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sidewatch
Usage
To start sidewatch as a daemon process in the background run
ruby bin/sidewatch start [--config <path to config file>]
To run sidewatch in the foreground, e.g. for testing, run
ruby bin/sidewatch run [--config <path to config file>]
Configuration
Using ENV variables
Sidewatch will use the same environment variables as Sidekiq to determine the Redis server to connect to, i.e. either REDIS_PROVIDER or REDIS_URL. Please refer to the Sidekiq wiki for more information.
Sidewatch uses the AWS SDK v2 to connect to CloudWatch. The SDK expects AWS credentials to be provided in one of these locations:
ENV['AWS_ACCESS_KEY_ID']andENV['AWS_SECRET_ACCESS_KEY']- The shared credentials ini file at
~/.aws/credentials - From an instance profile when running on EC2
Please refer to the SDK's documentation for more information.
Using the config file
When starting Sidewatch, you can pass a config file using the --config parameter. The config file should be in YAML format and supports the following keys:
logfile: "/var/log/sidewatch.log"
sidekiq:
namespace: "Sidekiq" # namespace used when uploading AWS CloudWatch metrics
redis:
url: "redis://localhost:6379/0"
namespace: "sidekiq" # Redis key namespace used by Sidekiq
cloudwatch:
region: "us-west-2"
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature) - Commit your changes (
git commit -am 'Add some feature') - Push to the branch (
git push origin my-new-feature) - Create new Pull Request