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.
- data.tar.gz.sig +0 -0
- data/CHANGELOG +74 -3
- data/GUIDELINES_FOR_CONTRIBUTING.md +19 -15
- data/README.md +1 -1
- data/Rakefile +22 -1
- data/lib/new_relic/agent/agent.rb +17 -5
- data/lib/new_relic/agent/agent_logger.rb +4 -0
- data/lib/new_relic/agent/configuration/default_source.rb +45 -1
- data/lib/new_relic/agent/configuration/manager.rb +43 -7
- data/lib/new_relic/agent/cross_app_monitor.rb +0 -3
- data/lib/new_relic/agent/cross_app_tracing.rb +8 -5
- data/lib/new_relic/agent/instrumentation/action_controller_subscriber.rb +4 -1
- data/lib/new_relic/agent/instrumentation/active_job.rb +93 -0
- data/lib/new_relic/agent/instrumentation/controller_instrumentation.rb +2 -1
- data/lib/new_relic/agent/instrumentation/middleware_tracing.rb +2 -2
- data/lib/new_relic/agent/instrumentation/sinatra.rb +1 -2
- data/lib/new_relic/agent/new_relic_service.rb +1 -1
- data/lib/new_relic/agent/new_relic_service/json_marshaller.rb +20 -1
- data/lib/new_relic/agent/new_relic_service/pruby_marshaller.rb +5 -1
- data/lib/new_relic/agent/pipe_channel_manager.rb +32 -11
- data/lib/new_relic/agent/threading/agent_thread.rb +1 -1
- data/lib/new_relic/agent/threading/backtrace_node.rb +4 -3
- data/lib/new_relic/agent/transaction.rb +27 -6
- data/lib/new_relic/agent/transaction_state.rb +3 -3
- data/lib/new_relic/agent/vm/mri_vm.rb +3 -3
- data/lib/new_relic/control/frameworks/rails3.rb +1 -16
- data/lib/new_relic/control/instance_methods.rb +2 -0
- data/lib/new_relic/json_wrapper.rb +18 -3
- data/lib/new_relic/rack/browser_monitoring.rb +7 -5
- data/lib/new_relic/rack/developer_mode.rb +2 -0
- data/lib/new_relic/rack/error_collector.rb +12 -51
- data/lib/new_relic/transaction_sample.rb +0 -4
- data/lib/new_relic/transaction_sample/segment.rb +0 -4
- data/lib/new_relic/version.rb +1 -1
- data/newrelic_rpm.gemspec +3 -2
- data/test/agent_helper.rb +1 -1
- data/test/config/test.cert.crt +16 -12
- data/test/config/test.cert.key +13 -13
- data/test/environments/lib/environments/runner.rb +3 -0
- data/test/environments/rails30/Gemfile +2 -2
- data/test/environments/rails31/Gemfile +2 -2
- data/test/environments/rails32/Gemfile +2 -2
- data/test/environments/rails40/Gemfile +2 -4
- data/test/environments/rails41/Gemfile +2 -4
- data/test/environments/rails42/Gemfile +2 -4
- data/test/fixtures/cross_agent_tests/attribute_configuration.json +349 -0
- data/test/fixtures/cross_agent_tests/labels.json +31 -2
- data/test/fixtures/cross_agent_tests/postgres_explain_obfuscation/README.md +16 -0
- data/test/fixtures/cross_agent_tests/rum_client_config.json +9 -9
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/empty_head +4 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/no_end_header.html +6 -0
- data/test/fixtures/cross_agent_tests/rum_loader_insertion_location/x_ua_meta_tag_multiple_tags.html +12 -0
- data/test/multiverse/lib/multiverse/runner.rb +33 -1
- data/test/multiverse/lib/multiverse/suite.rb +79 -7
- data/test/multiverse/suites/active_record/Envfile +1 -1
- data/test/multiverse/suites/agent_only/encoding_handling_test.rb +1 -1
- data/test/multiverse/suites/agent_only/labels_test.rb +2 -1
- data/test/multiverse/suites/agent_only/set_transaction_name_test.rb +2 -3
- data/test/multiverse/suites/agent_only/thread_profiling_test.rb +6 -6
- data/test/multiverse/suites/capistrano/Envfile +2 -2
- data/test/multiverse/suites/capistrano2/Envfile +4 -0
- data/test/multiverse/suites/curb/Envfile +4 -0
- data/test/multiverse/suites/high_security/config/newrelic.yml +5 -2
- data/test/multiverse/suites/high_security/high_security_test.rb +10 -8
- data/test/multiverse/suites/json/Envfile +23 -0
- data/test/multiverse/suites/json/config/newrelic.yml +22 -0
- data/test/multiverse/suites/json/json_test.rb +17 -0
- data/test/multiverse/suites/marshalling/marshalling_test.rb +2 -45
- data/test/multiverse/suites/rails/Envfile +3 -3
- data/test/multiverse/suites/rails/activejob_test.rb +137 -0
- data/test/multiverse/suites/rails/error_tracing_test.rb +15 -8
- data/test/multiverse/suites/rails/parameter_capture_test.rb +39 -19
- data/test/multiverse/suites/sequel/Envfile +5 -5
- data/test/multiverse/suites/sidekiq/Envfile +2 -2
- data/test/multiverse/suites/sinatra/Envfile +2 -1
- data/test/multiverse/suites/yajl/Envfile +13 -0
- data/test/multiverse/suites/yajl/config/newrelic.yml +21 -0
- data/test/multiverse/suites/yajl/yajl_test.rb +19 -0
- data/test/new_relic/agent/agent_logger_test.rb +10 -0
- data/test/new_relic/agent/agent_test.rb +7 -1
- data/test/new_relic/agent/configuration/default_source_test.rb +24 -0
- data/test/new_relic/agent/configuration/manager_test.rb +60 -2
- data/test/new_relic/agent/configuration/orphan_configuration_test.rb +25 -13
- data/test/new_relic/agent/cross_app_tracing_test.rb +10 -1
- data/test/new_relic/agent/instrumentation/active_job_test.rb +20 -0
- data/test/new_relic/agent/instrumentation/active_record_test.rb +10 -17
- data/test/new_relic/agent/instrumentation/controller_instrumentation_test.rb +15 -0
- data/test/new_relic/agent/instrumentation/sinatra_test.rb +1 -1
- data/test/new_relic/agent/new_relic_service_test.rb +24 -0
- data/test/new_relic/agent/pipe_channel_manager_test.rb +44 -2
- data/test/new_relic/agent/threading/agent_thread_test.rb +1 -2
- data/test/new_relic/agent/threading/backtrace_node_test.rb +12 -0
- data/test/new_relic/agent/transaction_state_test.rb +3 -6
- data/test/new_relic/agent/transaction_test.rb +163 -0
- data/test/new_relic/agent_test.rb +13 -1
- data/test/new_relic/fake_collector.rb +5 -5
- data/test/new_relic/fake_server.rb +5 -3
- data/test/new_relic/http_client_test_cases.rb +0 -4
- data/test/new_relic/marshalling_test_cases.rb +54 -0
- data/test/new_relic/multiverse_helpers.rb +2 -2
- data/test/new_relic/rack/browser_monitoring_test.rb +6 -0
- data/test/new_relic/rack/developer_mode_test.rb +8 -0
- data/test/new_relic/rack/error_collector_test.rb +0 -41
- data/test/new_relic/transaction_sample/segment_test.rb +0 -13
- data/test/new_relic/transaction_sample_test.rb +1 -11
- data/test/performance/lib/performance/instrumentation/perf_tools.rb +1 -1
- data/test/performance/lib/performance/runner.rb +1 -1
- data/test/performance/script/runner +2 -1
- data/test/performance/suites/rum_autoinsertion.rb +12 -2
- metadata +24 -11
- metadata.gz.sig +0 -0
- data/test/config/test.cert.csr +0 -11
- 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.
|
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.
|
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.
|
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 '/
|
117
|
-
assert_equal('/
|
118
|
-
|
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
|
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
|
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' => { :
|
205
|
-
'Apdex/error/ignored_error' => { :
|
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
|
-
|
80
|
-
|
81
|
-
|
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',
|
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',
|
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',
|
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',
|
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',
|
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.
|
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.
|
21
|
+
gem 'sidekiq', '~> 2.17.8'
|
22
22
|
gem 'rack'
|
23
23
|
gem 'newrelic_rpm', :require => false, :path => File.expand_path('../../../../')
|
24
24
|
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
|