Skip to content

Commit

Permalink
Add airbrake and newrelic
Browse files Browse the repository at this point in the history
  • Loading branch information
Tray Torrance committed Jan 29, 2012
1 parent c020048 commit 5120482
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 6 deletions.
6 changes: 6 additions & 0 deletions Gemfile
Expand Up @@ -39,6 +39,12 @@ gem 'unicorn', '~> 4.1.1', :require => false
# Use Pry as the Rails Console
gem 'pry-rails', '~> 0.1.1'

# Airbrake error reporting (optional bundler group)
gem 'airbrake', :group => :airbrake

# NewRelic monitoring (optional bundler group)
gem 'newrelic_rpm', :group => :newrelic

# Gems used only for assets and not required
# in production environments by default.
group :assets do
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Expand Up @@ -38,6 +38,9 @@ GEM
activesupport (>= 3.0.0)
rack (>= 1.1.0)
addressable (2.2.6)
airbrake (3.0.9)
activesupport
builder
arel (2.2.1)
bcrypt-ruby (3.0.1)
beanstalk-client (1.1.1)
Expand Down Expand Up @@ -173,6 +176,7 @@ GEM
net-ssh (2.3.0)
net-ssh-gateway (1.1.0)
net-ssh (>= 1.99.1)
newrelic_rpm (3.3.1)
nokogiri (1.5.0)
open4 (1.3.0)
polyglot (0.3.3)
Expand Down Expand Up @@ -271,6 +275,7 @@ PLATFORMS
DEPENDENCIES
actionmailer
acts_as_api (~> 0.3.11)
airbrake
bcrypt-ruby (~> 3.0.0)
bson_ext (~> 1.5.2)
bundler (>= 1.0.0)
Expand All @@ -297,6 +302,7 @@ DEPENDENCIES
less-rails (~> 2.1.2)
libnotify
mongoid (~> 2.4.1)
newrelic_rpm
nokogiri (~> 1.5.0)
pry-rails (~> 0.1.1)
rails (= 3.1.3)
Expand Down
14 changes: 8 additions & 6 deletions config/deploy.rb
Expand Up @@ -9,22 +9,24 @@
set :application, 'MongoStalker'

# General Deploy Info
set :repository, Settings.deploy_config['repository']
set :deploy_to, Settings.deploy_config['deploy_to']
set :keep_releases, Settings.deploy_config['keep_releases']
set :repository, Settings.deploy_config[:repository]
set :deploy_to, Settings.deploy_config[:deploy_to]
set :keep_releases, Settings.deploy_config[:keep_releases]

# Deploy User information
set :user, Settings.deploy_config['user']
set :use_sudo, Settings.deploy_config['sudo']
set :user, Settings.deploy_config[:user]
set :use_sudo, Settings.deploy_config[:sudo]

# SCM Settings
set :scm, :git
set :deploy_via, :remote_cache
set :git_enable_submodules, 1

# Servers
server Settings.deploy_config['server'], :app, :web
server Settings.deploy_config[:server], :app, :web

# Hooks
after 'deploy:update', 'deploy:cleanup'

# Optional Airbrake support
require 'airbrake/capistrano' if Settings.deploy_config[:notify_airbrake]
6 changes: 6 additions & 0 deletions config/initializers/airbrake.rb
@@ -0,0 +1,6 @@
if Settings.external_services.airbrake_config[:api_key].present?
::Airbrake.configure do |config|
config.api_key = Settings.external_services.airbrake_config[:api_key]
end
end

38 changes: 38 additions & 0 deletions config/newrelic.yml
@@ -0,0 +1,38 @@
common: &common
monitor_mode: true
ssl: true
developer_mode: false
agent_enabled: auto
log_level: info
capture_params: false
license_key: <%= Settings.external_services.new_relic_config[:license_key] %>
app_name: <%= Settings.external_services.new_relic_config[:app_name] %>
# Page load threshold
appdex_t: 0.5
# Error collector settings
error_collector:
capture_source: true
enabled: true
ignore_errors: ActionController::RoutingError
# Transaction tracer settings
transaction_tracer:
record_sql: obfuscated
enabled: true
stack_trace_threshold: 0.5
transaction_threshold: apdex_f

development:
<<: *common
monitor_mode: false
developer_mode: true

test:
<<: *common
monitor_mode: false

production:
<<: *common

heroku:
<<: *common

0 comments on commit 5120482

Please sign in to comment.