Configuration
Options to finetune RoRvsWild to your needs
Ignore requests, jobs, exceptions and plugins
From the configuration file config/rorvswild.yml
, you can tell RorVsWild to skip monitoring some requests, jobs, exceptions and plugins.
# config/rorvswild.yml
production:
api_key: API_KEY
ignore_requests:
- HeartbeatController#show
- !ruby/regexp /SecretController/ # Ignore the entire controller
ignore_jobs:
- SecretJob
- !ruby/regexp /Secret::/ # Ignore the entire Secret namespace
ignore_exceptions:
- ActionController::RoutingError # Ignore by default any 404
- ZeroDivisionError
- !ruby/regexp /Secret::/ # Ignore all secret errors
ignore_plugins:
- Sidekiq # If you don't want to monitor your Sidekiq jobs
Here is the equivalent if you prefer initialising RorVsWild manually.
# config/initializers/rorvswild.rb
RorVsWild.start(
api_key: "API_KEY",
ignore_requests: ["ApplicationController#heartbeat", /SecretController/],
ignore_jobs: ["SecretJob", /Secret::/],
ignore_exceptions: ["ActionController::RoutingError", "ZeroDivisionError", /Secret::/],
ignore_plugins: ["Sidekiq"])
Supported plugins
ignore_plugins:
works with the following plugins:
- ActionController
- ActionMailer
- ActionView
- ActiveJob
- ActiveRecord
- DelayedJob
- Elasticsearch
- Mongo
- NetHttp
- Redis
- Resque
- Sidekiq
Sample
If your application handles a lot of trafic, you can sample jobs and requests to lower your monitoring bill. You may miss relevant information, though. (version >= 1.7.0)
# config/rorvswild.yml
production:
api_key: API_KEY
job_sampling_rate: 0.5 # 50% of jobs are sent
request_sampling_rate: 0.25 # 25% of requests are sent
Change logger
By default RoRvsWild uses Rails.logger
or standard output. However in some cases you want to isolate RoRvsWild’s logs. To do that, you have to specifiy the log destination via the logger option:
# config/rorvswild.yml
production:
api_key: API_KEY
logger: log/rorvswild.yml
Here is the equivalent if you prefer initialising RoRvsWild manually:
# config/initializers/rorvswild.rb
RorVsWild.start(api_key: "API_KEY", logger: "log/rorvswild.log")
In the case you want a custom logger such as Syslog, you can only do it by initialising it manually:
# config/initializers/rorvswild.rb
RorVsWild.start(api_key: "API_KEY", logger: Logger::Syslog.new)