Skip to content

Instantly share code, notes, and snippets.

@wrburgess
Created March 19, 2012 00:20
Show Gist options
  • Star 15 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save wrburgess/2086949 to your computer and use it in GitHub Desktop.
Save wrburgess/2086949 to your computer and use it in GitHub Desktop.
Setting up New Relic for Sinatra on Heroku #newrelic #sinatra #heroku

references

instructions

In terminal:

heroku addons:add newrelic:standard

Add this gem to your Gemfile:

gem 'newrelic_rpm'

Create config/newrelic.yml with this script:

 ---
 <%= ENV["RACK_ENV"] %>:
   error_collector:
     capture_source: true
     enabled: true
     ignore_errors: ActionController::RoutingError
   apdex_t: 0.5
   ssl: false
   monitor_mode: true
   license_key: <%= ENV["NEW_RELIC_LICENSE_KEY"] %>
   developer_mode: false
   app_name: <%= ENV["NEW_RELIC_APP_NAME"] %>
   transaction_tracer:
     record_sql: obfuscated
     enabled: true
     stack_trace_threshold: 0.5
     transaction_threshold: apdex_f
   capture_params: false
   log_level: info

Add to your root .rb file:

configure :production do
  require 'newrelic_rpm'
end

Terminal command:

heroku config:add RACK_ENV=production

@henrik
Copy link

henrik commented Aug 14, 2012

Thanks a lot! One remark: at least Cedar apps seem to come with RACK_ENV=production out of the box.

@chaitanyakuber
Copy link

doesn't seem to work for me ... no errors in logs either :(

@padde
Copy link

padde commented May 11, 2013

@chaitanyakuber doesn't work for me either :( did you solve the problem, if so how?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment