Permalink
Browse files

allow custom app_name prefixes for newrelic

  • Loading branch information...
1 parent abd8fb1 commit e461956a971b389af97134824a8543f6897d8992 @maxwell maxwell committed Jan 20, 2012
Showing with 6 additions and 2 deletions.
  1. +4 −0 app/models/app_config.rb
  2. +1 −1 config/application.yml.example
  3. +1 −1 config/newrelic.yml
View
@@ -94,6 +94,10 @@ def self.have_old_config_file?
File.exists?(File.join(Rails.root, "config", "app.yml")) || (File.exists?(File.join(Rails.root, "config", "app_config.yml")))
end
+ def self.new_relic_app_name
+ self[:new_relic_app_name] || self[:pod_uri].host
+ end
+
def self.normalize_pod_url
unless self[:pod_url] =~ /^(https?:\/\/)/ # starts with http:// or https://
self[:pod_url] = "http://#{self[:pod_url]}"
@@ -114,7 +114,7 @@ defaults: &defaults
# Miscellaneous
NEW_RELIC_LICENSE_KEY: ''
-
+ new_relic_app_name: ''
# If set to true Diaspora will work with just the appserver, thin by default,
# running, however this makes it quite slow as all the time intensive jobs
View
@@ -33,7 +33,7 @@ common: &default_settings
# "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: <%= AppConfig[:pod_uri].host%>
+ app_name: <%= AppConfig.new_relic_app_name %>
# When "true", the agent collects performance data about your
# application and reports this data to the New Relic service at

0 comments on commit e461956

Please sign in to comment.