Skip to content

Instantly share code, notes, and snippets.

@henrypoydar
Created December 11, 2012 14:41
Show Gist options
  • Save henrypoydar/4259025 to your computer and use it in GitHub Desktop.
Save henrypoydar/4259025 to your computer and use it in GitHub Desktop.
New Relic setup for Rails app in Torquebox
...
gem "newrelic_rpm", "~> 3.5.3.25", :require => false
...
# config/initializers/newrelic.rb
require 'newrelic_rpm'
NewRelic::Agent.manual_start
# app/jobs/update_widgets.rb
# Example background job with New Relic instrumentation
class UpdateWidgets
include ::NewRelic::Agent::Instrumentation::ControllerInstrumentation
def run
# Widget updating here
end
add_transaction_tracer :run, {:category => :task, :name => 'UpdateWidgets'}
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment