Skip to content

Commit

Permalink
[codeforamerica#13] Default installation of rollbar
Browse files Browse the repository at this point in the history
  • Loading branch information
hale committed Aug 24, 2013
1 parent 548a0c0 commit 02d72f2
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,6 @@ KISSMETRICS_API_KEY="[KEY]"

# Google Analytics key goes here
GOOGLE_ANALYTICS_KEY="[KEY]"

# Rollbar exception monitoring SaaS
ROLLBAR_ACCESS_TOKEN=""
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ gem 'facets', :require => false # Some extra methods for ruby
gem 'seed_dump' # Adds a rake task which constructs a db/seeds.rb file based on the current database state. Super useful!
gem 'jquery-ui-rails' # Package jQuery for the Rails 3.1+ asset pipeline
gem 'ruby-prof', '~>0.12.2' # ruby profiler

gem 'rollbar' # SaaS to track exceptions
## SEO
gem 'meta-tags', :require => 'meta_tags' # Search Engine Optimization (SEO) plugin for Ruby on Rails applications.

Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,8 @@ GEM
ref (1.0.2)
responders (0.9.3)
railties (~> 3.1)
rollbar (0.10.11)
multi_json (~> 1.5)
rspec (2.12.0)
rspec-core (~> 2.12.0)
rspec-expectations (~> 2.12.0)
Expand Down Expand Up @@ -354,6 +356,7 @@ DEPENDENCIES
progressbar
rails (= 3.2.14)
rails-erd
rollbar
rspec-rails (>= 2.10.1)
ruby-prof (~> 0.12.2)
sass-rails (~> 3.2.5)
Expand Down
44 changes: 44 additions & 0 deletions config/initializers/rollbar.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
require 'rollbar/rails'
Rollbar.configure do |config|
config.access_token = ENV['ROLLBAR_ACCESS_TOKEN']

# Without configuration, Rollbar is enabled by in all environments.
# To disable in specific environments, set config.enabled=false.
# Here we'll disable in 'test':
if Rails.env.test?
config.enabled = false
end

# By default, Rollbar will try to call the `current_user` controller method
# to fetch the logged-in user object, and then call that object's `id`,
# `username`, and `email` methods to fetch those properties. To customize:
# config.person_method = "my_current_user"
# config.person_id_method = "my_id"
# config.person_username_method = "my_username"
# config.person_email_method = "my_email"

# If you want to attach custom data to all exception and message reports,
# provide a lambda like the following. It should return a hash.
# config.custom_data_method = lambda { {:some_key => "some_value" } }

# Add exception class names to the exception_level_filters hash to
# change the level that exception is reported at. Note that if an exception
# has already been reported and logged the level will need to be changed
# via the rollbar interface.
# Valid levels: 'critical', 'error', 'warning', 'info', 'debug', 'ignore'
# 'ignore' will cause the exception to not be reported at all.
# config.exception_level_filters.merge!('MyCriticalException' => 'critical')

# Enable asynchronous reporting (uses girl_friday or Threading if girl_friday
# is not installed)
# config.use_async = true
# Supply your own async handler:
# config.async_handler = Proc.new { |payload|
# Thread.new { Rollbar.process_payload(payload) }
# }

# Enable delayed reporting (using Sidekiq)
# config.use_sidekiq = true
# You can supply custom Sidekiq options:
# config.use_sidekiq = { 'queue' => 'my_queue' }
end

0 comments on commit 02d72f2

Please sign in to comment.