newrelic_rpm 3.9.5.251 → 3.9.6.257

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. data.tar.gz.sig +0 -0
  2. data/CHANGELOG +74 -3
  3. data/GUIDELINES_FOR_CONTRIBUTING.md +19 -15
  4. data/README.md +1 -1
  5. data/Rakefile +22 -1
  6. data/lib/new_relic/agent/agent.rb +17 -5
  7. data/lib/new_relic/agent/agent_logger.rb +4 -0
  8. data/lib/new_relic/agent/configuration/default_source.rb +45 -1
  9. data/lib/new_relic/agent/configuration/manager.rb +43 -7
  10. data/lib/new_relic/agent/cross_app_monitor.rb +0 -3
  11. data/lib/new_relic/agent/cross_app_tracing.rb +8 -5
  12. data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +4 -1
  13. data/lib/new_relic/agent/instrumentation/active_job.rb +93 -0
  14. data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -1
  15. data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +2 -2
  16. data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -2
  17. data/lib/new_relic/agent/new_relic_service.rb +1 -1
  18. data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +20 -1
  19. data/lib/new_relic/agent/new_relic_service/pruby_marshaller.rb +5 -1
  20. data/lib/new_relic/agent/pipe_channel_manager.rb +32 -11
  21. data/lib/new_relic/agent/threading/agent_thread.rb +1 -1
  22. data/lib/new_relic/agent/threading/backtrace_node.rb +4 -3
  23. data/lib/new_relic/agent/transaction.rb +27 -6
  24. data/lib/new_relic/agent/transaction_state.rb +3 -3
  25. data/lib/new_relic/agent/vm/mri_vm.rb +3 -3
  26. data/lib/new_relic/control/frameworks/rails3.rb +1 -16
  27. data/lib/new_relic/control/instance_methods.rb +2 -0
  28. data/lib/new_relic/json_wrapper.rb +18 -3
  29. data/lib/new_relic/rack/browser_monitoring.rb +7 -5
  30. data/lib/new_relic/rack/developer_mode.rb +2 -0
  31. data/lib/new_relic/rack/error_collector.rb +12 -51
  32. data/lib/new_relic/transaction_sample.rb +0 -4
  33. data/lib/new_relic/transaction_sample/segment.rb +0 -4
  34. data/lib/new_relic/version.rb +1 -1
  35. data/newrelic_rpm.gemspec +3 -2
  36. data/test/agent_helper.rb +1 -1
  37. data/test/config/test.cert.crt +16 -12
  38. data/test/config/test.cert.key +13 -13
  39. data/test/environments/lib/environments/runner.rb +3 -0
  40. data/test/environments/rails30/Gemfile +2 -2
  41. data/test/environments/rails31/Gemfile +2 -2
  42. data/test/environments/rails32/Gemfile +2 -2
  43. data/test/environments/rails40/Gemfile +2 -4
  44. data/test/environments/rails41/Gemfile +2 -4
  45. data/test/environments/rails42/Gemfile +2 -4
  46. data/test/fixtures/cross_agent_tests/attribute_configuration.json +349 -0
  47. data/test/fixtures/cross_agent_tests/labels.json +31 -2
  48. data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/README.md +16 -0
  49. data/test/fixtures/cross_agent_tests/rum_client_config.json +9 -9
  50. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/empty_head +4 -0
  51. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_end_header.html +6 -0
  52. data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_multiple_tags.html +12 -0
  53. data/test/multiverse/lib/multiverse/runner.rb +33 -1
  54. data/test/multiverse/lib/multiverse/suite.rb +79 -7
  55. data/test/multiverse/suites/active_record/Envfile +1 -1
  56. data/test/multiverse/suites/agent_only/encoding_handling_test.rb +1 -1
  57. data/test/multiverse/suites/agent_only/labels_test.rb +2 -1
  58. data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +2 -3
  59. data/test/multiverse/suites/agent_only/thread_profiling_test.rb +6 -6
  60. data/test/multiverse/suites/capistrano/Envfile +2 -2
  61. data/test/multiverse/suites/capistrano2/Envfile +4 -0
  62. data/test/multiverse/suites/curb/Envfile +4 -0
  63. data/test/multiverse/suites/high_security/config/newrelic.yml +5 -2
  64. data/test/multiverse/suites/high_security/high_security_test.rb +10 -8
  65. data/test/multiverse/suites/json/Envfile +23 -0
  66. data/test/multiverse/suites/json/config/newrelic.yml +22 -0
  67. data/test/multiverse/suites/json/json_test.rb +17 -0
  68. data/test/multiverse/suites/marshalling/marshalling_test.rb +2 -45
  69. data/test/multiverse/suites/rails/Envfile +3 -3
  70. data/test/multiverse/suites/rails/activejob_test.rb +137 -0
  71. data/test/multiverse/suites/rails/error_tracing_test.rb +15 -8
  72. data/test/multiverse/suites/rails/parameter_capture_test.rb +39 -19
  73. data/test/multiverse/suites/sequel/Envfile +5 -5
  74. data/test/multiverse/suites/sidekiq/Envfile +2 -2
  75. data/test/multiverse/suites/sinatra/Envfile +2 -1
  76. data/test/multiverse/suites/yajl/Envfile +13 -0
  77. data/test/multiverse/suites/yajl/config/newrelic.yml +21 -0
  78. data/test/multiverse/suites/yajl/yajl_test.rb +19 -0
  79. data/test/new_relic/agent/agent_logger_test.rb +10 -0
  80. data/test/new_relic/agent/agent_test.rb +7 -1
  81. data/test/new_relic/agent/configuration/default_source_test.rb +24 -0
  82. data/test/new_relic/agent/configuration/manager_test.rb +60 -2
  83. data/test/new_relic/agent/configuration/orphan_configuration_test.rb +25 -13
  84. data/test/new_relic/agent/cross_app_tracing_test.rb +10 -1
  85. data/test/new_relic/agent/instrumentation/active_job_test.rb +20 -0
  86. data/test/new_relic/agent/instrumentation/active_record_test.rb +10 -17
  87. data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +15 -0
  88. data/test/new_relic/agent/instrumentation/sinatra_test.rb +1 -1
  89. data/test/new_relic/agent/new_relic_service_test.rb +24 -0
  90. data/test/new_relic/agent/pipe_channel_manager_test.rb +44 -2
  91. data/test/new_relic/agent/threading/agent_thread_test.rb +1 -2
  92. data/test/new_relic/agent/threading/backtrace_node_test.rb +12 -0
  93. data/test/new_relic/agent/transaction_state_test.rb +3 -6
  94. data/test/new_relic/agent/transaction_test.rb +163 -0
  95. data/test/new_relic/agent_test.rb +13 -1
  96. data/test/new_relic/fake_collector.rb +5 -5
  97. data/test/new_relic/fake_server.rb +5 -3
  98. data/test/new_relic/http_client_test_cases.rb +0 -4
  99. data/test/new_relic/marshalling_test_cases.rb +54 -0
  100. data/test/new_relic/multiverse_helpers.rb +2 -2
  101. data/test/new_relic/rack/browser_monitoring_test.rb +6 -0
  102. data/test/new_relic/rack/developer_mode_test.rb +8 -0
  103. data/test/new_relic/rack/error_collector_test.rb +0 -41
  104. data/test/new_relic/transaction_sample/segment_test.rb +0 -13
  105. data/test/new_relic/transaction_sample_test.rb +1 -11
  106. data/test/performance/lib/performance/instrumentation/perf_tools.rb +1 -1
  107. data/test/performance/lib/performance/runner.rb +1 -1
  108. data/test/performance/script/runner +2 -1
  109. data/test/performance/suites/rum_autoinsertion.rb +12 -2
  110. metadata +24 -11
  111. metadata.gz.sig +0 -0
  112. data/test/config/test.cert.csr +0 -11
  113. data/test/config/testing-privkey.pem +0 -18
@@ -1,12 +1,12 @@
1
1
  if RUBY_VERSION >= '1.9.3'
2
2
  gemfile <<-RB
3
- gem 'rails', '~>4.2.0.beta1'
3
+ gem 'rails', '~>4.2.0.beta2'
4
4
  gem 'haml', :require => false
5
5
  gem 'minitest', '5.2.3'
6
6
  RB
7
7
 
8
8
  gemfile <<-RB
9
- gem 'rails', '~>4.1.0'
9
+ gem 'rails', '~>4.1.6'
10
10
  # Multiverse has an incompatibility with Minitest 5.3.0, so lock here for
11
11
  # now
12
12
  gem 'minitest', '5.2.3'
@@ -16,7 +16,7 @@ if RUBY_VERSION >= '1.9.3'
16
16
  RB
17
17
 
18
18
  gemfile <<-RB
19
- gem 'rails', '~>4.0.4'
19
+ gem 'rails', '~>4.0.10'
20
20
  gem 'haml', '4.0.2' # Getting load issues with haml 4.0.3
21
21
  RB
22
22
  end
@@ -0,0 +1,137 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
+
5
+ require 'multiverse_helpers'
6
+ require File.expand_path(File.join(__FILE__, '..', 'app'))
7
+
8
+ require 'logger'
9
+ require 'stringio'
10
+
11
+ # ActiveJob is in Rails 4.2+, so make sure we're on an allowed version before
12
+ # we try to load. Previously just tried to require it, but that had load issues
13
+ # on Rubinius.
14
+ if Rails::VERSION::STRING >= "4.2.0"
15
+
16
+ require 'active_job'
17
+
18
+ ActiveJob::Base.queue_adapter = :inline
19
+
20
+ class MyJob < ActiveJob::Base
21
+ def perform
22
+ # Nothing needed!
23
+ end
24
+ end
25
+
26
+ class MyJobWithAlternateQueue < ActiveJob::Base
27
+ queue_as :my_jobs
28
+
29
+ def perform
30
+ end
31
+ end
32
+
33
+ class MyJobWithParams < ActiveJob::Base
34
+ def self.last_params
35
+ @@last_params
36
+ end
37
+
38
+ def perform(first, last)
39
+ @@last_params = [first, last]
40
+ end
41
+ end
42
+
43
+ class ActiveJobTest < Minitest::Test
44
+
45
+ include MultiverseHelpers
46
+
47
+ setup_and_teardown_agent do
48
+ @log = StringIO.new
49
+ ActiveJob::Base.logger = ::Logger.new(@log)
50
+ end
51
+
52
+ def after_teardown
53
+ unless passed?
54
+ @log.rewind
55
+ puts @log.read
56
+ end
57
+ end
58
+
59
+ ENQUEUE_PREFIX = "MessageBroker/ActiveJob::Inline/Queue/Produce/Named"
60
+ PERFORM_PREFIX = "MessageBroker/ActiveJob::Inline/Queue/Consume/Named"
61
+
62
+ PERFORM_TRANSACTION_NAME = 'OtherTransaction/ActiveJob::Inline/MyJob/execute'
63
+ PERFORM_TRANSACTION_ROLLUP = 'OtherTransaction/ActiveJob::Inline/all'
64
+
65
+ def test_record_enqueue_metrics
66
+ in_web_transaction do
67
+ MyJob.perform_later
68
+ end
69
+
70
+ assert_metrics_recorded("#{ENQUEUE_PREFIX}/default")
71
+ end
72
+
73
+ def test_record_enqueue_metrics_with_alternate_queue
74
+ in_web_transaction do
75
+ MyJobWithAlternateQueue.perform_later
76
+ end
77
+
78
+ assert_metrics_recorded("#{ENQUEUE_PREFIX}/my_jobs")
79
+ end
80
+
81
+ def test_record_perform_metrics_in_web
82
+ in_web_transaction do
83
+ MyJob.perform_later
84
+ end
85
+
86
+ assert_metrics_recorded("#{PERFORM_PREFIX}/default")
87
+ end
88
+
89
+ def test_record_perform_metrics_with_alternate_queue_in_web
90
+ in_web_transaction do
91
+ MyJobWithAlternateQueue.perform_later
92
+ end
93
+
94
+ assert_metrics_recorded("#{PERFORM_PREFIX}/my_jobs")
95
+ end
96
+
97
+ def test_doesnt_record_perform_metrics_from_background
98
+ in_background_transaction do
99
+ MyJob.perform_later
100
+ end
101
+
102
+ assert_metrics_not_recorded("#{PERFORM_PREFIX}/default")
103
+ end
104
+
105
+ def test_starts_transaction_if_there_isnt_one
106
+ MyJob.perform_later
107
+ assert_metrics_recorded([PERFORM_TRANSACTION_ROLLUP,
108
+ PERFORM_TRANSACTION_NAME])
109
+ end
110
+
111
+ def test_nests_other_transaction_if_already_running
112
+ in_background_transaction do
113
+ MyJob.perform_later
114
+ end
115
+
116
+ assert_metrics_recorded([PERFORM_TRANSACTION_ROLLUP,
117
+ PERFORM_TRANSACTION_NAME])
118
+ end
119
+
120
+ # If running tasks inline, either in a dev environment or from
121
+ # misconfiguration we shouldn't accidentally rename our web transaction
122
+ def test_doesnt_nest_transactions_if_in_web
123
+ in_web_transaction do
124
+ MyJob.perform_later
125
+ end
126
+
127
+ assert_metrics_not_recorded([PERFORM_TRANSACTION_ROLLUP,
128
+ PERFORM_TRANSACTION_NAME])
129
+ end
130
+
131
+ def test_doesnt_interfere_with_params_on_job
132
+ MyJobWithParams.perform_later("1", "2")
133
+ assert_equal(["1", "2"], MyJobWithParams.last_params)
134
+ end
135
+ end
136
+
137
+ end
@@ -94,7 +94,6 @@ class ErrorsWithoutSSCTest < RailsMultiverseTest
94
94
  assert NewRelic::Agent.config[:agent_enabled]
95
95
  assert NewRelic::Agent.config[:'error_collector.enabled']
96
96
  assert @error_collector.enabled?
97
- assert Rails.application.config.middleware.include?(NewRelic::Rack::ErrorCollector)
98
97
  end
99
98
 
100
99
  def test_should_capture_routing_error
@@ -113,9 +112,17 @@ class ErrorsWithoutSSCTest < RailsMultiverseTest
113
112
  end
114
113
 
115
114
  def test_should_capture_request_uri_and_params
116
- get '/bad_route?eat=static'
117
- assert_equal('/bad_route', last_error.params[:request_uri])
118
- assert_equal({'eat' => 'static'}, last_error.params[:request_params])
115
+ get '/error/controller_error?eat=static'
116
+ assert_equal('/error/controller_error', last_error.params[:request_uri])
117
+
118
+ expected_params = { 'eat' => 'static' }
119
+
120
+ if Rails::VERSION::MAJOR == 3
121
+ expected_params['action'] = 'controller_error'
122
+ expected_params['controller'] = 'error'
123
+ end
124
+
125
+ assert_equal(expected_params, last_error.params[:request_params])
119
126
  end
120
127
  end
121
128
 
@@ -179,7 +186,7 @@ class ErrorsWithoutSSCTest < RailsMultiverseTest
179
186
  assert_equal('whatever', params['other'])
180
187
  end
181
188
 
182
- def test_should_apply_parameter_filtering_for_errors_captured_by_rack_error_collector
189
+ def test_should_apply_parameter_filtering_for_non_standard_errors
183
190
  get '/error/exception_error?secret=shouldnotbecaptured&other=whatever'
184
191
  params = last_error.params[:request_params]
185
192
  assert_equal('[FILTERED]', params['secret'])
@@ -198,11 +205,11 @@ class ErrorsWithoutSSCTest < RailsMultiverseTest
198
205
  'Noticed an error that should have been ignored')
199
206
  end
200
207
 
201
- def test_should_treat_apdex_as_success_when_ignored_error_class_noticed
208
+ def test_should_not_fail_apdex_for_ignored_error_class_noticed
202
209
  get '/error/ignored_error'
203
210
  assert_metrics_recorded({
204
- 'Apdex' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 0 },
205
- 'Apdex/error/ignored_error' => { :apdex_s => 1, :apdex_t => 0, :apdex_f => 0 }
211
+ 'Apdex' => { :apdex_f => 0 },
212
+ 'Apdex/error/ignored_error' => { :apdex_f => 0 }
206
213
  })
207
214
  end
208
215
 
@@ -47,6 +47,41 @@ class ParameterCaptureTest < RailsMultiverseTest
47
47
  assert_equal({}, last_transaction_trace_request_params)
48
48
  end
49
49
 
50
+ def test_uri_on_traced_errors_never_contains_query_string
51
+ with_config(:capture_params => false) do
52
+ get '/parameter_capture/error?other=1234&secret=4567'
53
+ end
54
+ assert_equal('/parameter_capture/error', last_traced_error.params[:request_uri])
55
+
56
+ with_config(:capture_params => true) do
57
+ get '/parameter_capture/error?other=1234&secret=4567'
58
+ end
59
+ assert_equal('/parameter_capture/error', last_traced_error.params[:request_uri])
60
+ end
61
+
62
+ def test_referrer_on_traced_errors_never_contains_query_string
63
+ with_config(:capture_params => false) do
64
+ get '/parameter_capture/error?other=1234&secret=4567', {}, { 'HTTP_REFERER' => '/foo/bar?other=123&secret=456' }
65
+ end
66
+ assert_equal('/foo/bar', last_traced_error.params[:request_referer])
67
+ with_config(:capture_params => true) do
68
+ get '/parameter_capture/error?other=1234&secret=4567', {}, { 'HTTP_REFERER' => '/foo/bar?other=123&secret=456' }
69
+ end
70
+ assert_equal('/foo/bar', last_traced_error.params[:request_referer])
71
+ end
72
+
73
+ def test_uri_on_tts_never_contains_query_string
74
+ with_config(:capture_params => false) do
75
+ get '/parameter_capture/transaction?other=1234&secret=4567'
76
+ end
77
+ assert_equal('/parameter_capture/transaction', last_transaction_trace.params[:uri])
78
+
79
+ with_config(:capture_params => true) do
80
+ get '/parameter_capture/transaction?other=1234&secret=4567'
81
+ end
82
+ assert_equal('/parameter_capture/transaction', last_transaction_trace.params[:uri])
83
+ end
84
+
50
85
  def test_filters_parameters_on_traced_errors
51
86
  with_config(:capture_params => true) do
52
87
  get '/parameter_capture/error?other=1234&secret=4567'
@@ -76,32 +111,17 @@ class ParameterCaptureTest < RailsMultiverseTest
76
111
  assert_equal({}, last_transaction_trace_request_params)
77
112
  end
78
113
 
79
- if Rails::VERSION::MAJOR.to_i >= 3
80
- # NewRelic::Rack::ErrorCollector grabs things out of the request so
81
- # we get the actual params even if we never got to a controller
82
- def test_sees_error_params_even_when_bailing_before_rails_if_enabled
83
- with_config(:capture_params => true) do
84
- get '/middleware_error/before?other=1234&secret=4567'
85
- end
86
-
87
- captured_params = last_traced_error_request_params
88
- assert_equal('[FILTERED]', captured_params['secret'])
89
- assert_equal('1234', captured_params['other'])
90
- end
91
- else
92
- def test_sees_error_params_even_when_bailing_before_rails_if_enabled
93
- with_config(:capture_params => true) do
94
- get '/middleware_error/before?other=1234&secret=4567'
95
- end
96
- assert_nil last_traced_error_request_params
114
+ def test_no_params_captured_on_error_when_bails_before_rails_even_when_enabled
115
+ with_config(:capture_params => true) do
116
+ get '/middleware_error/before?other=1234&secret=4567'
97
117
  end
118
+ assert_nil last_traced_error_request_params
98
119
  end
99
120
 
100
121
  def test_no_params_captured_on_tt_when_bails_before_rails_even_when_enabled
101
122
  with_config(:capture_params => true) do
102
123
  get '/middleware_error/before?other=1234&secret=4567'
103
124
  end
104
-
105
125
  assert_equal({}, last_transaction_trace_request_params)
106
126
  end
107
127
 
@@ -1,34 +1,34 @@
1
1
  gemfile <<-RB
2
2
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
3
3
  gem 'jdbc-sqlite3', '3.7.2', :platform => :jruby
4
- gem 'sqlite3', '1.3.7', :platform => :ruby
4
+ gem 'sqlite3', :platform => :ruby
5
5
  gem 'sequel', '2.9.0'
6
6
  RB
7
7
 
8
8
  gemfile <<-RB
9
9
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
10
10
  gem 'jdbc-sqlite3', '3.7.2', :platform => :jruby
11
- gem 'sqlite3', '1.3.7', :platform => :ruby
11
+ gem 'sqlite3', :platform => :ruby
12
12
  gem 'sequel', '3.34.0'
13
13
  RB
14
14
 
15
15
  gemfile <<-RB
16
16
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
17
17
  gem 'jdbc-sqlite3', '3.7.2', :platform => :jruby
18
- gem 'sqlite3', '1.3.7', :platform => :ruby
18
+ gem 'sqlite3', :platform => :ruby
19
19
  gem 'sequel', '3.36.1'
20
20
  RB
21
21
 
22
22
  gemfile <<-RB
23
23
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
24
24
  gem 'jdbc-sqlite3', '3.7.2', :platform => :jruby
25
- gem 'sqlite3', '1.3.7', :platform => :ruby
25
+ gem 'sqlite3', :platform => :ruby
26
26
  gem 'sequel', '3.47.0'
27
27
  RB
28
28
 
29
29
  gemfile <<-RB
30
30
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
31
31
  gem 'jdbc-sqlite3', '3.7.2', :platform => :jruby
32
- gem 'sqlite3', '1.3.7', :platform => :ruby
32
+ gem 'sqlite3', :platform => :ruby
33
33
  gem 'sequel', '4.0.0'
34
34
  RB
@@ -6,7 +6,7 @@ end
6
6
  if RUBY_VERSION >= '2.0.0' || (RUBY_PLATFORM == 'java')
7
7
  gemfile <<-RB
8
8
  gem 'json'
9
- gem 'sidekiq', '~> 3.0.0'
9
+ gem 'sidekiq', '~> 3.2.0'
10
10
  gem 'rack'
11
11
 
12
12
  # Work around for https://github.com/celluloid/celluloid/issues/457
@@ -18,7 +18,7 @@ end
18
18
 
19
19
  gemfile <<-RB
20
20
  gem 'json'
21
- gem 'sidekiq', '~> 2.17.7'
21
+ gem 'sidekiq', '~> 2.17.8'
22
22
  gem 'rack'
23
23
  gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
24
24
  RB
@@ -9,6 +9,7 @@ gemfile <<-RB
9
9
  RB
10
10
 
11
11
  gemfile <<-RB
12
- gem 'sinatra', '~> 1.2.9'
12
+ gem 'backports', '~> 3.6.1'
13
+ gem 'sinatra', '~> 1.2.9'
13
14
  gem 'rack-test', :require => 'rack/test'
14
15
  RB
@@ -0,0 +1,13 @@
1
+ suite_condition("Yajl not supported for JRuby") do
2
+ RUBY_PLATFORM != 'java'
3
+ end
4
+
5
+ gemfile <<-RB
6
+ gem 'rack'
7
+ gem 'yajl-ruby', '~> 1.2.1'
8
+ RB
9
+
10
+ gemfile <<-RB
11
+ gem 'rack'
12
+ gem 'yajl-ruby', '~> 1.1.0'
13
+ RB
@@ -0,0 +1,21 @@
1
+ ---
2
+ development:
3
+ error_collector:
4
+ enabled: true
5
+ apdex_t: 0.24
6
+ ssl: false
7
+ log_level: debug
8
+ monitor_mode: true
9
+ license_key: bootstrap_newrelic_admin_license_key_000
10
+ developer_mode: false
11
+ app_name: test
12
+ host: 127.0.0.1
13
+ api_host: 127.0.0.1
14
+ port: <%= $collector && $collector.port %>
15
+ transaction_tracer:
16
+ record_sql: obfuscated
17
+ enabled: true
18
+ stack_trace_threshold: 0.5
19
+ capture_params: false
20
+ browser_monitoring:
21
+ auto_instrument: true
@@ -0,0 +1,19 @@
1
+ # encoding: utf-8
2
+ # This file is distributed under New Relic's license terms.
3
+ # See https://github.com/newrelic/rpm/blob/master/LICENSE for complete details.
4
+
5
+ require 'multiverse_helpers'
6
+ require File.join(File.dirname(__FILE__), '..', '..', '..', 'new_relic', 'marshalling_test_cases')
7
+
8
+ # This is the problematic thing that overrides our JSON marshalling
9
+ require 'yajl/json_gem'
10
+
11
+ class YajlTest < Minitest::Test
12
+
13
+ include MultiverseHelpers
14
+ include MarshallingTestCases
15
+
16
+ setup_and_teardown_agent do
17
+ Yajl::Encoder.expects(:encode).never
18
+ end
19
+ end
@@ -348,6 +348,16 @@ class AgentLoggerTest < Minitest::Test
348
348
  assert_logged log_message.reverse
349
349
  end
350
350
 
351
+ def test_clear_already_logged
352
+ logger = create_basic_logger
353
+ logger.log_once(:warn, :clear_already_logged, "Kill me")
354
+
355
+ refute_empty logger.already_logged
356
+ logger.clear_already_logged
357
+
358
+ assert_empty logger.already_logged
359
+ end
360
+
351
361
  #
352
362
  # Helpers
353
363
  #
@@ -343,7 +343,6 @@ module NewRelic
343
343
  def test_connect_settings_includes_labels_from_semicolon_separated_config
344
344
  with_config(:labels => "Server:East;Server:West;") do
345
345
  expected = [
346
- {"label_type"=>"Server", "label_value"=>"East"},
347
346
  {"label_type"=>"Server", "label_value"=>"West"}
348
347
  ]
349
348
  assert_equal expected, @agent.connect_settings[:labels]
@@ -594,6 +593,13 @@ module NewRelic
594
593
  assert !config_classes.include?(NewRelic::Agent::Configuration::ManualSource)
595
594
  assert !config_classes.include?(NewRelic::Agent::Configuration::ServerSource)
596
595
  end
596
+
597
+ def test_log_ignore_url_regexes
598
+ with_config(:rules => { :ignore_url_regexes => ['foo', 'bar', 'baz'] }) do
599
+ expects_logging(:info, includes("/foo/, /bar/, /baz/"))
600
+ @agent.log_ignore_url_regexes
601
+ end
602
+ end
597
603
  end
598
604
 
599
605
  class AgentStartingTest < Minitest::Test