From 16b42ce05e92e6616b75244d8b8bf5f05e0fe91b Mon Sep 17 00:00:00 2001 From: Dan Barber Date: Wed, 19 Dec 2012 22:09:57 +0000 Subject: [PATCH] Upgrade Rails and add New Relic. --- Gemfile | 6 +- Gemfile.lock | 96 ++++++++++---------- config/newrelic.yml | 216 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 269 insertions(+), 49 deletions(-) create mode 100644 config/newrelic.yml diff --git a/Gemfile b/Gemfile index 7c7029a..884f07b 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,6 @@ source 'http://rubygems.org' -gem 'rails', '3.1.1' +gem 'rails', '~> 3.1.1' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' @@ -40,6 +40,8 @@ group :development do gem 'powder' end +gem "newrelic_rpm" + gem 'sass-rails', "~> 3.1.0" gem "exception_notification", :git => "git://github.com/rails/exception_notification", :require => 'exception_notifier' gem 'pg' @@ -52,4 +54,4 @@ gem 'rdiscount' gem 'paperclip' gem 'acts_as_markup' gem 'yaml_db' -gem 'haml' \ No newline at end of file +gem 'haml' diff --git a/Gemfile.lock b/Gemfile.lock index 5452a41..a317717 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -8,47 +8,47 @@ GEM remote: http://rubygems.org/ specs: RedCloth (4.2.8) - actionmailer (3.1.1) - actionpack (= 3.1.1) - mail (~> 2.3.0) - actionpack (3.1.1) - activemodel (= 3.1.1) - activesupport (= 3.1.1) + actionmailer (3.1.8) + actionpack (= 3.1.8) + mail (~> 2.3.3) + actionpack (3.1.8) + activemodel (= 3.1.8) + activesupport (= 3.1.8) builder (~> 3.0.0) erubis (~> 2.7.0) i18n (~> 0.6) - rack (~> 1.3.2) - rack-cache (~> 1.1) + rack (~> 1.3.6) + rack-cache (~> 1.2) rack-mount (~> 0.8.2) rack-test (~> 0.6.1) - sprockets (~> 2.0.2) - activemodel (3.1.1) - activesupport (= 3.1.1) + sprockets (~> 2.0.4) + activemodel (3.1.8) + activesupport (= 3.1.8) builder (~> 3.0.0) i18n (~> 0.6) - activerecord (3.1.1) - activemodel (= 3.1.1) - activesupport (= 3.1.1) - arel (~> 2.2.1) + activerecord (3.1.8) + activemodel (= 3.1.8) + activesupport (= 3.1.8) + arel (~> 2.2.3) tzinfo (~> 0.3.29) - activeresource (3.1.1) - activemodel (= 3.1.1) - activesupport (= 3.1.1) - activesupport (3.1.1) - multi_json (~> 1.0) + activeresource (3.1.8) + activemodel (= 3.1.8) + activesupport (= 3.1.8) + activesupport (3.1.8) + multi_json (>= 1.0, < 1.3) acts_as_markup (1.3.4) RedCloth (~> 4.2) activerecord (>= 2.3.2) activesupport (>= 2.3.2) rdiscount (~> 1.3) wikitext (~> 2.0) - arel (2.2.1) + arel (2.2.3) aws-s3 (0.6.2) builder mime-types xml-simple bcrypt-ruby (3.0.1) - builder (3.0.0) + builder (3.0.4) cocaine (0.2.0) coffee-rails (3.1.1) coffee-script (>= 2.2.0) @@ -69,17 +69,18 @@ GEM haml (3.1.3) hike (1.2.1) hpricot (0.8.4) - i18n (0.6.0) + i18n (0.6.1) jquery-rails (1.0.16) railties (~> 3.0) thor (~> 0.14) - json (1.6.1) - mail (2.3.0) + json (1.7.5) + mail (2.3.3) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.17.2) - multi_json (1.0.3) + mime-types (1.19) + multi_json (1.2.0) + newrelic_rpm (3.5.4.33) orm_adapter (0.0.5) paperclip (2.4.5) activerecord (>= 2.3.0) @@ -89,36 +90,36 @@ GEM pg (0.11.0) polyamorous (0.5.0) activerecord (~> 3.0) - polyglot (0.3.2) + polyglot (0.3.3) powder (0.1.6) thor (>= 0.11.5) - rack (1.3.5) - rack-cache (1.1) + rack (1.3.6) + rack-cache (1.2) rack (>= 0.4) rack-mount (0.8.3) rack (>= 1.0.0) rack-ssl (1.3.2) rack - rack-test (0.6.1) + rack-test (0.6.2) rack (>= 1.0) - rails (3.1.1) - actionmailer (= 3.1.1) - actionpack (= 3.1.1) - activerecord (= 3.1.1) - activeresource (= 3.1.1) - activesupport (= 3.1.1) + rails (3.1.8) + actionmailer (= 3.1.8) + actionpack (= 3.1.8) + activerecord (= 3.1.8) + activeresource (= 3.1.8) + activesupport (= 3.1.8) bundler (~> 1.0) - railties (= 3.1.1) - railties (3.1.1) - actionpack (= 3.1.1) - activesupport (= 3.1.1) + railties (= 3.1.8) + railties (3.1.8) + actionpack (= 3.1.8) + activesupport (= 3.1.8) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (~> 0.14.6) - rake (0.9.2.2) + rake (10.0.3) rdiscount (1.6.8) - rdoc (3.11) + rdoc (3.12) json (~> 1.4) ruby_parser (2.3.1) sexp_processor (~> 3.0) @@ -130,7 +131,7 @@ GEM sprockets (~> 2.0.0) tilt (~> 1.3.2) sexp_processor (3.0.7) - sprockets (2.0.3) + sprockets (2.0.4) hike (~> 1.2) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) @@ -143,10 +144,10 @@ GEM polyamorous (~> 0.5.0) thor (0.14.6) tilt (1.3.3) - treetop (1.4.10) + treetop (1.4.12) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.30) + tzinfo (0.3.35) uglifier (1.0.4) execjs (>= 0.3.0) multi_json (>= 1.0.2) @@ -170,10 +171,11 @@ DEPENDENCIES haml hpricot jquery-rails + newrelic_rpm paperclip pg powder - rails (= 3.1.1) + rails (~> 3.1.1) rdiscount ruby_parser sass-rails (~> 3.1.0) diff --git a/config/newrelic.yml b/config/newrelic.yml new file mode 100644 index 0000000..6b16528 --- /dev/null +++ b/config/newrelic.yml @@ -0,0 +1,216 @@ +# +# This file configures the New Relic Agent. New Relic monitors +# Ruby, Java, .NET, PHP, and Python applications with deep visibility and low overhead. +# For more information, visit www.newrelic.com. +# +# Generated December 19, 2012 +# +# This configuration file is custom generated for Pixelhum + +# Here are the settings that are common to all environments: +common: &default_settings + # ============================== LICENSE KEY =============================== + + # You must specify the license key associated with your New Relic + # account. This key binds your Agent's data to your account in the + # New Relic service. + license_key: '900421c1caebcc2c678645d7493a92f833722de4' + + # Agent Enabled (Ruby/Rails Only) + # Use this setting to force the agent to run or not run. + # Default is 'auto' which means the agent will install and run only + # if a valid dispatcher such as Mongrel is running. This prevents + # it from running with Rake or the console. Set to false to + # completely turn the agent off regardless of the other settings. + # Valid values are true, false and auto. + # agent_enabled: auto + + # Application Name + # Set this to be the name of your application as you'd like it show + # up in New Relic. New Relic will then auto-map instances of your application + # into a New Relic "application" on your home dashboard page. If you want + # to map this instance into multiple apps, like "AJAX Requests" and + # "All UI" then specify a semicolon-separated list of up to three + # distinct names. If you comment this out, it defaults to the + # capitalized RAILS_ENV (i.e., Production, Staging, etc) + app_name: Dan Barber Photo + + # When "true", the agent collects performance data about your + # application and reports this data to the New Relic service at + # newrelic.com. This global switch is normally overridden for each + # environment below. (formerly called 'enabled') + monitor_mode: true + + # Developer mode should be off in every environment but + # development as it has very high overhead in memory. + developer_mode: false + + # The newrelic agent generates its own log file to keep its logging + # information separate from that of your application. Specify its + # log level here. + log_level: info + + # The newrelic agent communicates with the New Relic service via http by + # default. If you want to communicate via https to increase + # security, then turn on SSL by setting this value to true. Note, + # this will result in increased CPU overhead to perform the + # encryption involved in SSL communication, but this work is done + # asynchronously to the threads that process your application code, + # so it should not impact response times. + ssl: false + + # EXPERIMENTAL: enable verification of the SSL certificate sent by + # the server. This setting has no effect unless SSL is enabled + # above. This may block your application. Only enable it if the data + # you send us needs end-to-end verified certificates. + # + # This means we cannot cache the DNS lookup, so each request to the + # New Relic service will perform a lookup. It also means that we cannot + # use a non-blocking lookup, so in a worst case, if you have DNS + # problems, your app may block indefinitely. + # verify_certificate: true + + # Proxy settings for connecting to the New Relic server. + # + # If a proxy is used, the host setting is required. Other settings + # are optional. Default port is 8080. + # + # proxy_host: hostname + # proxy_port: 8080 + # proxy_user: + # proxy_pass: + + # Tells transaction tracer and error collector (when enabled) + # whether or not to capture HTTP params. When true, frameworks can + # exclude HTTP parameters from being captured. + # Rails: the RoR filter_parameter_logging excludes parameters + # Java: create a config setting called "ignored_params" and set it to + # a comma separated list of HTTP parameter names. + # ex: ignored_params: credit_card, ssn, password + capture_params: false + + # Transaction tracer captures deep information about slow + # transactions and sends this to the New Relic service once a + # minute. Included in the transaction is the exact call sequence of + # the transactions including any SQL statements issued. + transaction_tracer: + + # Transaction tracer is enabled by default. Set this to false to + # turn it off. This feature is only available at the Professional + # product level. + enabled: true + + # Threshold in seconds for when to collect a transaction + # trace. When the response time of a controller action exceeds + # this threshold, a transaction trace will be recorded and sent to + # New Relic. Valid values are any float value, or (default) "apdex_f", + # which will use the threshold for an dissatisfying Apdex + # controller action - four times the Apdex T value. + transaction_threshold: apdex_f + + # When transaction tracer is on, SQL statements can optionally be + # recorded. The recorder has three modes, "off" which sends no + # SQL, "raw" which sends the SQL statement in its original form, + # and "obfuscated", which strips out numeric and string literals. + record_sql: obfuscated + + # Threshold in seconds for when to collect stack trace for a SQL + # call. In other words, when SQL statements exceed this threshold, + # then capture and send to New Relic the current stack trace. This is + # helpful for pinpointing where long SQL calls originate from. + stack_trace_threshold: 0.500 + + # Determines whether the agent will capture query plans for slow + # SQL queries. Only supported in mysql and postgres. Should be + # set to false when using other adapters. + # explain_enabled: true + + # Threshold for query execution time below which query plans will not + # not be captured. Relevant only when `explain_enabled` is true. + # explain_threshold: 0.5 + + # Error collector captures information about uncaught exceptions and + # sends them to New Relic for viewing + error_collector: + + # Error collector is enabled by default. Set this to false to turn + # it off. This feature is only available at the Professional + # product level. + enabled: true + + # Rails Only - tells error collector whether or not to capture a + # source snippet around the place of the error when errors are View + # related. + capture_source: true + + # To stop specific errors from reporting to New Relic, set this property + # to comma-separated values. Default is to ignore routing errors, + # which are how 404's get triggered. + ignore_errors: ActionController::RoutingError + + # (Advanced) Uncomment this to ensure the CPU and memory samplers + # won't run. Useful when you are using the agent to monitor an + # external resource + # disable_samplers: true + + # If you aren't interested in visibility in these areas, you can + # disable the instrumentation to reduce overhead. + # + # disable_view_instrumentation: true + # disable_activerecord_instrumentation: true + # disable_memcache_instrumentation: true + # disable_dj: true + + # Certain types of instrumentation such as GC stats will not work if + # you are running multi-threaded. Please let us know. + # multi_threaded = false + +# Application Environments +# ------------------------------------------ +# Environment-specific settings are in this section. +# For Rails applications, RAILS_ENV is used to determine the environment. +# For Java applications, pass -Dnewrelic.environment to set +# the environment. + +# NOTE if your application has other named environments, you should +# provide newrelic configuration settings for these environments here. + +development: + <<: *default_settings + # Turn off communication to New Relic service in development mode (also + # 'enabled'). + # NOTE: for initial evaluation purposes, you may want to temporarily + # turn agent communication on in development mode. + monitor_mode: false + + # Rails Only - when running in Developer Mode, the New Relic Agent will + # present performance information on the last 100 transactions you have + # executed since starting the app server. + # NOTE: There is substantial overhead when running in developer mode. + # Do not use for production or load testing. + developer_mode: true + + # Enable textmate links + # textmate: true + +test: + <<: *default_settings + # It almost never makes sense to turn on the agent when running + # unit, functional or integration tests or the like. + monitor_mode: false + +# Turn on the agent in production for 24x7 monitoring. New Relic +# testing shows an average performance impact of < 5 ms per +# transaction, so you can leave this on all the time without +# incurring any user-visible performance degradation. +production: + <<: *default_settings + monitor_mode: true + +# Many applications have a staging environment which behaves +# identically to production. Support for that environment is provided +# here. By default, the staging environment has the agent turned on. +staging: + <<: *default_settings + monitor_mode: true + app_name: My Application (Staging)