gem install newrelic_rpm
# file: <app_root>/Gemfile source :rubygems gem 'newrelic_rpm'
This is something you'll have to a bit of research. For the most part, the default NewRelic configuration (as of 2012-06-16) is setup with Rails defaults. That said, for the most part it will work with your Sinatra app. Here's and example of what I would typically start with.
common: &default_settings license_key: '<your_newrelic_key>' app_name: My Application monitor_mode: true developer_mode: false log_level: info ssl: false apdex_t: 0.5 capture_params: false transaction_tracer: enabled: true transaction_threshold: apdex_f record_sql: obfuscated stack_trace_threshold: 0.500 error_collector: enabled: true capture_source: true ignore_errors: "NoMethodError" development: <<: *default_settings monitor_mode: false developer_mode: true log_level: debug test: <<: *default_settings monitor_mode: true app_name: My Application (Test) log_level: debug production: <<: *default_settings monitor_mode: true staging: <<: *default_settings monitor_mode: true app_name: My Application (Staging)
Some important things to note;
This is the part that I expected to be way more complicated then it actually was. The above is basically identical to Rails, aside from some slight tweaks to the configuration, so this is really the main divergence.
# file: <app_root>/config.ru $:.unshift File.expand_path(File.dirname(__FILE__)) require "app" require 'newrelic_rpm' NewRelic::Agent.after_fork(:force_reconnect => true) run App.new
That's pretty much it, start your app and enjoy!