newrelic_rpm 3.4.2 → 3.4.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of newrelic_rpm might be problematic. Click here for more details.

data/CHANGELOG CHANGED
@@ -1,21 +1,37 @@
1
-
1
+
2
2
  # New Relic Ruby Agent Release Notes #
3
3
 
4
+ ### Next Up ###
5
+ ## v3.4.3 ##
6
+
4
7
  ### current version ###
8
+ ## v3.4.2.1 ##
9
+
10
+ * Fix issue when app_name is nil
11
+
12
+ If the app_name setting ends up being nil an exception got generated and the application
13
+ wouldn't run. This would notably occur when running a Heroku app locally without the
14
+ NEW_RELIC_APP_NAME environment variable set. A nil app_name is now detected and an
15
+ error logged specifying remediation.
16
+
17
+ ### previous versions ###
5
18
  ## v3.4.2 ##
6
19
 
7
- * The RUM NRAGENT tk value gets sanitized to prevent potential XSS vulnerabilities
20
+ * The RUM NRAGENT tk value gets more robustly sanitized to prevent potential XSS vulnerabilities
8
21
 
9
- There was the potential for malicious code to be inserted into the token used
10
- in Real User Monitoring and have it echoed back to a browser as an XSS exploit.
11
- The token now gets scrubbed to remove this potential problem.
22
+ The code that scrubes the token used in Real User Monitoring has been enhanced to be
23
+ more robust.
24
+
25
+ * Support for Apdex T in server side configuration
26
+
27
+ For those using server side configuration the Ruby Agent now supports setting
28
+ the Apdex T value via the New Relic UI.
12
29
 
13
30
  * Refactoring of agent config code
14
31
 
15
32
  The code that reads the configuration information and confirgures the agent
16
33
  got substantially reorganized, consolidated, simplified, and made more robust.
17
-
18
- ### previous versions ###
34
+
19
35
  ## v3.4.1 ##
20
36
  #### Bug Fixes ####
21
37
  * Fix edge case in RUM auto instrumentation where X-UA-Compatible meta tag is
@@ -55,7 +71,6 @@
55
71
  is only a problem if GC could happen *between* transactions, as in, for
56
72
  example, out-of-band GC in Unicorn. fixed.
57
73
 
58
-
59
74
  v3.4.0.1
60
75
  * Prevent the agent from resolving the collector address when disabled.
61
76
  * Fix for error collector configuration that was introduced during beta.
data/LICENSE CHANGED
@@ -25,7 +25,7 @@ See https://github.com/jquery/jquery/blob/master/MIT-LICENSE.txt
25
25
 
26
26
 
27
27
  All other components of this product are
28
- Copyright (c) 2008-2011 New Relic, Inc. All rights reserved.
28
+ Copyright (c) 2008-2012 New Relic, Inc. All rights reserved.
29
29
 
30
30
  Certain inventions disclosed in this file may be claimed within
31
31
  patents owned or patent applications filed by New Relic, Inc. or third
@@ -315,7 +315,12 @@ module NewRelic
315
315
 
316
316
  # Logs the configured application names
317
317
  def log_app_names
318
- log.info "Application: #{Agent.config.app_names.join(", ")}"
318
+ names = Agent.config.app_names
319
+ if names.respond_to?(:any?) && names.any?
320
+ log.info "Application: #{names.join(", ")}"
321
+ else
322
+ log.error 'Unable to determine application name. Please set the application name in your newrelic.yml or in a NEW_RELIC_APP_NAME environment variable.'
323
+ end
319
324
  end
320
325
 
321
326
  # Connecting in the foreground blocks further startup of the
@@ -9,6 +9,11 @@ module NewRelic
9
9
  def config
10
10
  @@manager ||= Manager.new
11
11
  end
12
+
13
+ # for testing
14
+ def reset_config
15
+ @@manager = Manager.new
16
+ end
12
17
  end
13
18
 
14
19
  class DottedHash < ::Hash
@@ -89,6 +89,7 @@ module NewRelic
89
89
  case self[:app_name]
90
90
  when Array then self[:app_name]
91
91
  when String then self[:app_name].split(';')
92
+ else []
92
93
  end
93
94
  end
94
95
 
@@ -4,7 +4,7 @@ module NewRelic
4
4
  MAJOR = 3
5
5
  MINOR = 4
6
6
  TINY = 2
7
- BUILD = nil # Set to nil for a release, 'beta1', 'alpha', etc for prerelease builds
7
+ BUILD = 1 # Set to nil for a release, 'beta1', 'alpha', etc for prerelease builds
8
8
  STRING = [MAJOR, MINOR, TINY, BUILD].compact.join('.')
9
9
  end
10
10
 
@@ -5,10 +5,10 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = "newrelic_rpm"
8
- s.version = "3.4.2"
8
+ s.version = "3.4.2.1"
9
9
 
10
10
  s.authors = ["Bill Kayser", "Jon Guymon", "Justin George", "Darin Swanson", "Rob Saul"]
11
- s.date = "2012-09-06"
11
+ s.date = "2012-09-12"
12
12
  s.description = "New Relic is a performance management system, developed by New Relic,\nInc (http://www.newrelic.com). New Relic provides you with deep\ninformation about the performance of your web application as it runs\nin production. The New Relic Ruby Agent is dual-purposed as a either a\nGem or plugin, hosted on\nhttp://github.com/newrelic/rpm/\n"
13
13
  s.email = "support@newrelic.com"
14
14
  s.executables = ["newrelic_cmd", "newrelic", "mongrel_rpm"]
@@ -3,6 +3,16 @@ class NewRelic::Agent::Agent::StartTest < Test::Unit::TestCase
3
3
  require 'new_relic/agent/agent'
4
4
  include NewRelic::Agent::Agent::Start
5
5
 
6
+ def setup
7
+ ENV['NEW_RELIC_APP_NAME'] = 'start_test'
8
+ NewRelic::Agent.reset_config
9
+ end
10
+
11
+ def teardown
12
+ ENV['NEW_RELIC_APP_NAME'] = nil
13
+ NewRelic::Agent.reset_config
14
+ end
15
+
6
16
  def test_already_started_positive
7
17
  control = mocked_control
8
18
  control.expects(:log!).with("Agent Started Already!", :error)
@@ -43,7 +53,7 @@ class NewRelic::Agent::Agent::StartTest < Test::Unit::TestCase
43
53
  end
44
54
  end
45
55
 
46
- def test_log_app_names
56
+ def test_log_app_names_string
47
57
  with_config(:app_name => 'zam;zam;zabam') do
48
58
  log = mocked_log
49
59
  log.expects(:info).with("Application: zam, zam, zabam")
@@ -51,6 +61,31 @@ class NewRelic::Agent::Agent::StartTest < Test::Unit::TestCase
51
61
  end
52
62
  end
53
63
 
64
+ def test_log_app_names_array
65
+ with_config(:app_name => ['zam', 'zam', 'zabam']) do
66
+ log = mocked_log
67
+ log.expects(:info).with("Application: zam, zam, zabam")
68
+ log_app_names
69
+ end
70
+ end
71
+
72
+ def test_log_app_names_with_env_var
73
+ # bad app name after env - used to cover the yaml config
74
+ with_config({:app_name => false}, 1) do
75
+ log = mocked_log
76
+ log.expects(:info).with("Application: start_test") # set in setup
77
+ log_app_names
78
+ end
79
+ end
80
+
81
+ def test_log_app_names_with_unknown
82
+ with_config(:app_name => false) do
83
+ log = mocked_log
84
+ log.expects(:error).with('Unable to determine application name. Please set the application name in your newrelic.yml or in a NEW_RELIC_APP_NAME environment variable.')
85
+ log_app_names
86
+ end
87
+ end
88
+
54
89
  def test_check_config_and_start_agent_disabled
55
90
  self.expects(:monitoring?).returns(false)
56
91
  check_config_and_start_agent
@@ -123,6 +123,23 @@ module NewRelic::Agent::Configuration
123
123
  .index(NewRelic::Agent::Configuration::ManualSource)
124
124
  end
125
125
 
126
+ def test_app_names_single
127
+ @manager.apply_config(:app_name => 'test')
128
+ assert_equal ['test'], @manager.app_names
129
+ end
130
+
131
+ def test_app_names_list
132
+ @manager.apply_config(:app_name => 'test0;test1;test2')
133
+ assert_equal ['test0', 'test1', 'test2'], @manager.app_names
134
+ end
135
+
136
+ def test_app_names_nil
137
+ # nil has special meaning, so we emulate with an object that
138
+ # will not respond as expected
139
+ @manager.apply_config(:app_name => Object.new)
140
+ assert_equal [], @manager.app_names
141
+ end
142
+
126
143
  class TestSource < ::Hash
127
144
  def test_config_accessor
128
145
  'some value'
metadata CHANGED
@@ -1,13 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: newrelic_rpm
3
3
  version: !ruby/object:Gem::Version
4
- hash: 19
4
+ hash: 85
5
5
  prerelease:
6
6
  segments:
7
7
  - 3
8
8
  - 4
9
9
  - 2
10
- version: 3.4.2
10
+ - 1
11
+ version: 3.4.2.1
11
12
  platform: ruby
12
13
  authors:
13
14
  - Bill Kayser
@@ -19,7 +20,7 @@ autorequire:
19
20
  bindir: bin
20
21
  cert_chain: []
21
22
 
22
- date: 2012-09-06 00:00:00 Z
23
+ date: 2012-09-12 00:00:00 Z
23
24
  dependencies:
24
25
  - !ruby/object:Gem::Dependency
25
26
  name: jeweler