appoptics_apm 4.0.3 → 4.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile_test +6 -7
  3. data/README.md +3 -3
  4. data/Rakefile +3 -2
  5. data/appoptics_apm.gemspec +2 -2
  6. data/docker-compose.yml +0 -22
  7. data/ext/oboe_metal/extconf.rb +4 -0
  8. data/lib/appoptics_apm/config.rb +11 -6
  9. data/lib/appoptics_apm/version.rb +1 -1
  10. metadata +3 -202
  11. data/gemfiles/delayed_job.gemfile +0 -36
  12. data/gemfiles/frameworks.gemfile +0 -44
  13. data/gemfiles/instrumentation_mocked.gemfile +0 -29
  14. data/gemfiles/libraries.gemfile +0 -85
  15. data/gemfiles/noop.gemfile +0 -17
  16. data/gemfiles/rails23.gemfile +0 -39
  17. data/gemfiles/rails30.gemfile +0 -42
  18. data/gemfiles/rails31.gemfile +0 -44
  19. data/gemfiles/rails32.gemfile +0 -54
  20. data/gemfiles/rails40.gemfile +0 -27
  21. data/gemfiles/rails41.gemfile +0 -27
  22. data/gemfiles/rails42.gemfile +0 -35
  23. data/gemfiles/rails50.gemfile +0 -44
  24. data/gemfiles/rails51.gemfile +0 -44
  25. data/test/benchmark/README.md +0 -65
  26. data/test/benchmark/logging_bench.rb +0 -54
  27. data/test/benchmark/with_libraries_gemfile/bunny_bench.rb +0 -69
  28. data/test/benchmark/with_rails5x_gemfile/action_controller5x_bench.rb +0 -43
  29. data/test/frameworks/apps/grape_nested.rb +0 -33
  30. data/test/frameworks/apps/grape_simple.rb +0 -80
  31. data/test/frameworks/apps/padrino_simple.rb +0 -80
  32. data/test/frameworks/apps/sinatra_simple.rb +0 -55
  33. data/test/frameworks/grape_test.rb +0 -286
  34. data/test/frameworks/padrino_test.rb +0 -222
  35. data/test/frameworks/rails3x_test.rb +0 -554
  36. data/test/frameworks/rails4x_test.rb +0 -570
  37. data/test/frameworks/rails5x_api_test.rb +0 -210
  38. data/test/frameworks/rails5x_test.rb +0 -376
  39. data/test/frameworks/rails_shared_tests.rb +0 -172
  40. data/test/frameworks/sinatra_test.rb +0 -140
  41. data/test/instrumentation/bunny_client_test.rb +0 -276
  42. data/test/instrumentation/bunny_consumer_test.rb +0 -204
  43. data/test/instrumentation/curb_test.rb +0 -398
  44. data/test/instrumentation/dalli_test.rb +0 -177
  45. data/test/instrumentation/em_http_request_test.rb +0 -89
  46. data/test/instrumentation/excon_test.rb +0 -231
  47. data/test/instrumentation/faraday_test.rb +0 -228
  48. data/test/instrumentation/http_test.rb +0 -143
  49. data/test/instrumentation/httpclient_test.rb +0 -304
  50. data/test/instrumentation/memcache_test.rb +0 -260
  51. data/test/instrumentation/memcached_test.rb +0 -229
  52. data/test/instrumentation/mongo_v1_test.rb +0 -479
  53. data/test/instrumentation/mongo_v2_index_test.rb +0 -124
  54. data/test/instrumentation/mongo_v2_test.rb +0 -584
  55. data/test/instrumentation/mongo_v2_view_test.rb +0 -435
  56. data/test/instrumentation/moped_test.rb +0 -517
  57. data/test/instrumentation/rack_test.rb +0 -165
  58. data/test/instrumentation/redis_hashes_test.rb +0 -268
  59. data/test/instrumentation/redis_keys_test.rb +0 -321
  60. data/test/instrumentation/redis_lists_test.rb +0 -310
  61. data/test/instrumentation/redis_misc_test.rb +0 -163
  62. data/test/instrumentation/redis_sets_test.rb +0 -296
  63. data/test/instrumentation/redis_sortedsets_test.rb +0 -328
  64. data/test/instrumentation/redis_strings_test.rb +0 -349
  65. data/test/instrumentation/resque_test.rb +0 -185
  66. data/test/instrumentation/rest-client_test.rb +0 -288
  67. data/test/instrumentation/sequel_mysql2_test.rb +0 -353
  68. data/test/instrumentation/sequel_mysql_test.rb +0 -334
  69. data/test/instrumentation/sequel_pg_test.rb +0 -336
  70. data/test/instrumentation/sidekiq-client_test.rb +0 -159
  71. data/test/instrumentation/sidekiq-worker_test.rb +0 -180
  72. data/test/instrumentation/twitter-cassandra_test.rb +0 -424
  73. data/test/instrumentation/typhoeus_test.rb +0 -284
  74. data/test/jobs/delayed_job/db_worker_job.rb +0 -29
  75. data/test/jobs/delayed_job/error_worker_job.rb +0 -10
  76. data/test/jobs/delayed_job/remote_call_worker_job.rb +0 -20
  77. data/test/jobs/resque/db_worker_job.rb +0 -29
  78. data/test/jobs/resque/error_worker_job.rb +0 -10
  79. data/test/jobs/resque/remote_call_worker_job.rb +0 -20
  80. data/test/jobs/sidekiq/db_worker_job.rb +0 -29
  81. data/test/jobs/sidekiq/error_worker_job.rb +0 -10
  82. data/test/jobs/sidekiq/remote_call_worker_job.rb +0 -20
  83. data/test/minitest_helper.rb +0 -277
  84. data/test/mocked/curb_mocked_test.rb +0 -324
  85. data/test/mocked/excon_mocked_test.rb +0 -174
  86. data/test/mocked/faraday_mocked_test.rb +0 -97
  87. data/test/mocked/http_mocked_test.rb +0 -135
  88. data/test/mocked/httpclient_mocked_test.rb +0 -258
  89. data/test/mocked/rest_client_mocked_test.rb +0 -109
  90. data/test/mocked/typhoeus_mocked_test.rb +0 -207
  91. data/test/models/widget.rb +0 -36
  92. data/test/noop/noop_test.rb +0 -145
  93. data/test/profiling/legacy_method_profiling_test.rb +0 -201
  94. data/test/profiling/method_profiling_test.rb +0 -631
  95. data/test/queues/delayed_job-client_test.rb +0 -95
  96. data/test/queues/delayed_job-worker_test.rb +0 -91
  97. data/test/reporter/reporter_test.rb +0 -14
  98. data/test/servers/delayed_job.rb +0 -107
  99. data/test/servers/rackapp_8101.rb +0 -29
  100. data/test/servers/rails3x_8140.rb +0 -96
  101. data/test/servers/rails4x_8140.rb +0 -96
  102. data/test/servers/rails5x_8140.rb +0 -95
  103. data/test/servers/rails5x_api_8150.rb +0 -78
  104. data/test/servers/sidekiq.rb +0 -29
  105. data/test/servers/sidekiq.yml +0 -7
  106. data/test/servers/sidekiq_initializer.rb +0 -25
  107. data/test/settings +0 -0
  108. data/test/support/auto_tracing_test.rb +0 -50
  109. data/test/support/backcompat_test.rb +0 -276
  110. data/test/support/config_test.rb +0 -149
  111. data/test/support/dnt_test.rb +0 -98
  112. data/test/support/init_report_test.rb +0 -25
  113. data/test/support/liboboe_settings_test.rb +0 -110
  114. data/test/support/logging_test.rb +0 -130
  115. data/test/support/sql_sanitize_test.rb +0 -55
  116. data/test/support/tracing_mode_test.rb +0 -33
  117. data/test/support/tvalias_test.rb +0 -15
  118. data/test/support/xtrace_test.rb +0 -41
@@ -1,177 +0,0 @@
1
- # Copyright (c) 2016 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- if RUBY_VERSION > '1.8.7'
5
-
6
- require 'minitest_helper'
7
-
8
- describe "Dalli" do
9
- before do
10
- clear_all_traces
11
- @dc = Dalli::Client.new
12
- @collect_backtraces = AppOpticsAPM::Config[:dalli][:collect_backtraces]
13
- end
14
-
15
- after do
16
- AppOpticsAPM::Config[:dalli][:collect_backtraces] = @collect_backtraces
17
- end
18
-
19
- it 'Stock Dalli should be loaded, defined and ready' do
20
- defined?(::Dalli).wont_match nil
21
- defined?(::Dalli::Client).wont_match nil
22
- end
23
-
24
- it 'should have appoptics_apm methods defined' do
25
- [ :perform_with_appoptics, :get_multi_with_appoptics].each do |m|
26
- ::Dalli::Client.method_defined?(m).must_equal true
27
- end
28
- end
29
-
30
- it 'should trace set' do
31
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
32
- @dc.set('some_key', 1234)
33
- end
34
-
35
- traces = get_all_traces
36
- traces.count.must_equal 4
37
-
38
- validate_outer_layers(traces, 'dalli_test')
39
-
40
- traces[1].has_key?("KVOp").must_equal true
41
- traces[1].has_key?("KVKey").must_equal true
42
- traces[1]['Layer'].must_equal "memcache"
43
- traces[1]['KVKey'].must_equal "some_key"
44
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
45
- end
46
-
47
- it 'should trace get' do
48
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
49
- @dc.get('some_key')
50
- end
51
-
52
- traces = get_all_traces
53
- traces.count.must_equal 5
54
-
55
- validate_outer_layers(traces, 'dalli_test')
56
-
57
- traces[1]['KVOp'].must_equal "get"
58
- traces[1]['KVKey'].must_equal "some_key"
59
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
60
- traces[2]['Label'].must_equal "info"
61
- traces[2].has_key?('KVHit').must_equal true
62
- traces[3]['Label'].must_equal "exit"
63
- end
64
-
65
- it 'should trace get_multi' do
66
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
67
- @dc.get_multi([:one, :two, :three, :four, :five, :six])
68
- end
69
-
70
- traces = get_all_traces
71
- traces.count.must_equal 5
72
-
73
- validate_outer_layers(traces, 'dalli_test')
74
-
75
- traces[1]['KVOp'].must_equal "get_multi"
76
- traces[2]['Label'].must_equal "info"
77
- traces[2]['RemoteHost'].must_equal "127.0.0.1:11211"
78
- traces[2].has_key?('KVKeyCount').must_equal true
79
- traces[2].has_key?('KVHitCount').must_equal true
80
- traces[3]['Label'].must_equal "exit"
81
- end
82
-
83
- it "should trace increment" do
84
- @dc.incr("dalli_key_counter", 1, nil, 0)
85
-
86
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
87
- @dc.incr("dalli_key_counter")
88
- end
89
-
90
- traces = get_all_traces
91
- traces.count.must_equal 4
92
-
93
- validate_outer_layers(traces, 'dalli_test')
94
-
95
- traces[1]['KVOp'].must_equal "incr"
96
- traces[1]['KVKey'].must_equal "dalli_key_counter"
97
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
98
- traces[2]['Label'].must_equal "exit"
99
- end
100
-
101
- it "should trace decrement" do
102
- @dc.incr("dalli_key_counter", 1, nil, 0)
103
-
104
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
105
- @dc.decr("dalli_key_counter")
106
- end
107
-
108
- traces = get_all_traces
109
- traces.count.must_equal 4
110
-
111
- validate_outer_layers(traces, 'dalli_test')
112
-
113
- traces[1]['KVOp'].must_equal "decr"
114
- traces[1]['KVKey'].must_equal "dalli_key_counter"
115
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
116
- traces[2]['Label'].must_equal "exit"
117
- end
118
-
119
- it "should trace replace" do
120
- @dc.set('some_key', 1)
121
-
122
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
123
- @dc.replace("some_key", "woop")
124
- end
125
-
126
- traces = get_all_traces
127
- traces.count.must_equal 4
128
-
129
- validate_outer_layers(traces, 'dalli_test')
130
-
131
- traces[1]['KVOp'].must_equal "replace"
132
- traces[1]['KVKey'].must_equal "some_key"
133
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
134
- traces[2]['Label'].must_equal "exit"
135
- end
136
-
137
- it "should trace delete" do
138
- @dc.set('some_key', 1)
139
-
140
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
141
- @dc.delete("some_key")
142
- end
143
-
144
- traces = get_all_traces
145
- traces.count.must_equal 4
146
-
147
- validate_outer_layers(traces, 'dalli_test')
148
-
149
- traces[1]['KVOp'].must_equal "delete"
150
- traces[1]['KVKey'].must_equal "some_key"
151
- traces[1]['RemoteHost'].must_equal "127.0.0.1:11211"
152
- end
153
-
154
- it "should obey :collect_backtraces setting when true" do
155
- @dc.set('some_key', 1)
156
- AppOpticsAPM::Config[:dalli][:collect_backtraces] = true
157
-
158
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
159
- @dc.get('some_key')
160
- end
161
-
162
- traces = get_all_traces
163
- layer_has_key(traces, 'memcache', 'Backtrace')
164
- end
165
-
166
- it "should obey :collect_backtraces setting when false" do
167
- AppOpticsAPM::Config[:dalli][:collect_backtraces] = false
168
-
169
- AppOpticsAPM::API.start_trace('dalli_test', '', {}) do
170
- @dc.get('some_key')
171
- end
172
-
173
- traces = get_all_traces
174
- layer_doesnt_have_key(traces, 'memcache', 'Backtrace')
175
- end
176
- end
177
- end
@@ -1,89 +0,0 @@
1
- # Copyright (c) 2016 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- require 'minitest_helper'
5
-
6
- # Disable this test on JRuby until we can investigate
7
- # "SOCKET: SET COMM INACTIVITY UNIMPLEMENTED 10"
8
- # https://travis-ci.org/tracelytics/ruby-appoptics_apm/jobs/33745752
9
- if RUBY_VERSION >= '1.9' and AppOpticsAPM::Config[:em_http_request][:enabled] and not defined?(JRUBY_VERSION)
10
-
11
- describe "EventMachine" do
12
- before do
13
- clear_all_traces
14
- @collect_backtraces = AppOpticsAPM::Config[:em_http_request][:collect_backtraces]
15
- end
16
-
17
- after do
18
- AppOpticsAPM::Config[:em_http_request][:collect_backtraces] = @collect_backtraces
19
- end
20
-
21
- it 'EventMachine::HttpConnection should be loaded, defined and ready' do
22
- defined?(::EventMachine::HttpConnection).wont_match nil
23
- end
24
-
25
- it 'should have appoptics_apm methods defined' do
26
- ::EventMachine::HttpConnection.method_defined?("setup_request_with_appoptics").must_equal true
27
- end
28
-
29
- it 'should trace request' do
30
- AppOpticsAPM::API.start_trace('em-http-request_test', '', {}) do
31
- EventMachine.run do
32
- http = EventMachine::HttpRequest.new('http://appneta.com/').get
33
- http.callback do
34
- EventMachine.stop
35
- end
36
- end
37
- end
38
-
39
- traces = get_all_traces
40
-
41
- traces.count.must_equal 4
42
- validate_outer_layers(traces, 'em-http-request_test')
43
-
44
- traces[1]["Layer"].must_equal "em-http-request"
45
- traces[1]["Label"].must_equal "entry"
46
- traces[1]["IsService"].must_equal "1"
47
- traces[1]["RemoteURL"].must_equal "http://appneta.com/"
48
- traces[1].has_key?('Backtrace').must_equal AppOpticsAPM::Config[:em_http_request][:collect_backtraces]
49
-
50
- traces[2]["Layer"].must_equal "em-http-request"
51
- traces[2]["Label"].must_equal "exit"
52
- traces[2]["Async"].must_equal "1"
53
- traces[2].has_key?('Backtrace').must_equal AppOpticsAPM::Config[:em_http_request][:collect_backtraces]
54
- end
55
-
56
- it "should obey :collect_backtraces setting when true" do
57
- AppOpticsAPM::Config[:em_http_request][:collect_backtraces] = true
58
-
59
- AppOpticsAPM::API.start_trace('em-http-request_test', '', {}) do
60
- EventMachine.run do
61
- http = EventMachine::HttpRequest.new('http://appneta.com/').get
62
- http.callback do
63
- EventMachine.stop
64
- end
65
- end
66
- end
67
-
68
- traces = get_all_traces
69
- layer_has_key(traces, 'em-http-request', 'Backtrace')
70
- end
71
-
72
- it "should obey :collect_backtraces setting when false" do
73
- AppOpticsAPM::Config[:em_http_request][:collect_backtraces] = false
74
-
75
- AppOpticsAPM::API.start_trace('em-http-request_test', '', {}) do
76
- EventMachine.run do
77
- http = EventMachine::HttpRequest.new('http://appneta.com/').get
78
- http.callback do
79
- EventMachine.stop
80
- end
81
- end
82
- end
83
-
84
- traces = get_all_traces
85
- layer_doesnt_have_key(traces, 'em-http-request', 'Backtrace')
86
- end
87
- end
88
-
89
- end # unless defined?(JRUBY_VERSION)
@@ -1,231 +0,0 @@
1
- # Copyright (c) 2016 SolarWinds, LLC.
2
- # All rights reserved.
3
-
4
- require 'minitest_helper'
5
- require 'appoptics_apm/inst/rack'
6
- require File.expand_path(File.dirname(__FILE__) + '../../frameworks/apps/sinatra_simple')
7
-
8
- class ExconTest < Minitest::Test
9
- include Rack::Test::Methods
10
-
11
- def app
12
- SinatraSimple
13
- end
14
-
15
- def test_must_return_xtrace_header
16
- skip if defined?(JRUBY_VERSION)
17
-
18
- clear_all_traces
19
- get "/"
20
- xtrace = last_response['X-Trace']
21
-
22
- # Rack response header management under JRUBY.
23
- assert xtrace
24
- assert AppOpticsAPM::XTrace.valid?(xtrace)
25
- end
26
-
27
- def test_reports_version_init
28
- init_kvs = ::AppOpticsAPM::Util.build_init_report
29
- assert_equal ::Excon::VERSION, init_kvs['Ruby.excon.Version']
30
- end
31
-
32
- def test_class_get_request
33
- clear_all_traces
34
-
35
- AppOpticsAPM::API.start_trace('excon_tests') do
36
- Excon.get('http://127.0.0.1:8101/')
37
- end
38
-
39
- traces = get_all_traces
40
- assert_equal traces.count, 7
41
- validate_outer_layers(traces, "excon_tests")
42
- assert valid_edges?(traces), "Invalid edge in traces"
43
-
44
- assert_equal 1, traces[1]['IsService']
45
- assert_equal '127.0.0.1', traces[1]['RemoteHost']
46
- assert_equal 'HTTP', traces[1]['RemoteProtocol']
47
- assert_equal '/', traces[1]['ServiceArg']
48
- assert_equal 'GET', traces[1]['HTTPMethod']
49
- assert traces[1].key?('Backtrace')
50
-
51
- assert_equal 'excon', traces[5]['Layer']
52
- assert_equal 'exit', traces[5]['Label']
53
- assert_equal 200, traces[5]['HTTPStatus']
54
- end
55
-
56
- def test_cross_app_tracing
57
- clear_all_traces
58
-
59
- AppOpticsAPM::API.start_trace('excon_tests') do
60
- response = Excon.get('http://127.0.0.1:8101/?blah=1')
61
- xtrace = response.headers['X-Trace']
62
-
63
- assert xtrace
64
- assert AppOpticsAPM::XTrace.valid?(xtrace)
65
- end
66
-
67
- traces = get_all_traces
68
- assert_equal 7, traces.count
69
- validate_outer_layers(traces, "excon_tests")
70
- assert valid_edges?(traces), "Invalid edge in traces"
71
-
72
- assert_equal 1, traces[1]['IsService']
73
- assert_equal '127.0.0.1', traces[1]['RemoteHost']
74
- assert_equal 'HTTP', traces[1]['RemoteProtocol']
75
- assert_equal '/?blah=1', traces[1]['ServiceArg']
76
- assert_equal 'GET', traces[1]['HTTPMethod']
77
- assert_equal 200, traces[5]['HTTPStatus']
78
- assert traces[1].key?('Backtrace')
79
- end
80
-
81
- def test_persistent_requests
82
- # Persistence was adding in 0.31.0
83
- skip if Excon::VERSION < '0.31.0'
84
-
85
- clear_all_traces
86
-
87
- AppOpticsAPM::API.start_trace('excon_tests') do
88
- connection = Excon.new('http://127.0.0.1:8101/') # non-persistent by default
89
- connection.get # socket established, then closed
90
- connection.get(:persistent => true) # socket established, left open
91
- connection.get # socket reused, then closed
92
- end
93
-
94
- traces = get_all_traces
95
- assert_equal traces.count, 17
96
- validate_outer_layers(traces, "excon_tests")
97
- assert valid_edges?(traces), "Invalid edge in traces"
98
-
99
- assert_equal 1, traces[1]['IsService']
100
- assert_equal '127.0.0.1', traces[1]['RemoteHost']
101
- assert_equal 'HTTP', traces[1]['RemoteProtocol']
102
- assert_equal '/', traces[1]['ServiceArg']
103
- assert_equal 'GET', traces[1]['HTTPMethod']
104
- assert_equal 200, traces[5]['HTTPStatus']
105
- assert traces[1].key?('Backtrace')
106
-
107
- assert_equal 1, traces[6]['IsService']
108
- assert_equal '127.0.0.1', traces[6]['RemoteHost']
109
- assert_equal 'HTTP', traces[6]['RemoteProtocol']
110
- assert_equal '/', traces[6]['ServiceArg']
111
- assert_equal 'GET', traces[6]['HTTPMethod']
112
- assert_equal 200, traces[10]['HTTPStatus']
113
- assert traces[6].key?('Backtrace')
114
-
115
- assert_equal 1, traces[11]['IsService']
116
- assert_equal '127.0.0.1', traces[11]['RemoteHost']
117
- assert_equal 'HTTP', traces[11]['RemoteProtocol']
118
- assert_equal '/', traces[11]['ServiceArg']
119
- assert_equal 'GET', traces[11]['HTTPMethod']
120
- assert_equal 200, traces[15]['HTTPStatus']
121
- assert traces[11].key?('Backtrace')
122
- end
123
-
124
- def test_pipelined_requests
125
- skip if Excon::VERSION <= '0.17.0'
126
-
127
- clear_all_traces
128
-
129
- AppOpticsAPM::API.start_trace('excon_tests') do
130
- connection = Excon.new('http://127.0.0.1:8101/')
131
- connection.requests([{:method => :get}, {:method => :put}])
132
- end
133
-
134
- traces = get_all_traces
135
- assert_equal 10, traces.count
136
- validate_outer_layers(traces, "excon_tests")
137
- assert valid_edges?(traces), "Invalid edge in traces"
138
-
139
- assert_equal 1, traces[1]['IsService']
140
- assert_equal '127.0.0.1', traces[1]['RemoteHost']
141
- assert_equal 'HTTP', traces[1]['RemoteProtocol']
142
- assert_equal '/', traces[1]['ServiceArg']
143
- assert_equal 'true', traces[1]['Pipeline']
144
- assert_equal 'GET, PUT', traces[1]['HTTPMethods']
145
- assert traces[1].key?('Backtrace')
146
- end
147
-
148
- def test_requests_with_errors
149
- clear_all_traces
150
-
151
- begin
152
- AppOpticsAPM::API.start_trace('excon_tests') do
153
- Excon.get('http://asfjalkfjlajfljkaljf/')
154
- end
155
- rescue
156
- end
157
-
158
- traces = get_all_traces
159
- assert_equal traces.count, 5
160
- validate_outer_layers(traces, "excon_tests")
161
- assert valid_edges?(traces), "Invalid edge in traces"
162
-
163
- assert_equal 1, traces[1]['IsService']
164
- assert_equal 'asfjalkfjlajfljkaljf', traces[1]['RemoteHost']
165
- assert_equal 'HTTP', traces[1]['RemoteProtocol']
166
- assert_equal '/', traces[1]['ServiceArg']
167
- assert_equal 'GET', traces[1]['HTTPMethod']
168
- assert traces[1].key?('Backtrace')
169
-
170
- assert_equal 'excon', traces[2]['Layer']
171
- assert_equal 'error', traces[2]['Label']
172
- assert_equal "Excon::Error::Socket", traces[2]['ErrorClass']
173
- assert traces[2].key?('ErrorMsg')
174
- assert traces[2].key?('Backtrace')
175
-
176
- assert_equal 'excon', traces[3]['Layer']
177
- assert_equal 'exit', traces[3]['Label']
178
- end
179
-
180
- def test_obey_log_args_when_false
181
- @log_args = AppOpticsAPM::Config[:excon][:log_args]
182
- clear_all_traces
183
-
184
- AppOpticsAPM::Config[:excon][:log_args] = false
185
-
186
- AppOpticsAPM::API.start_trace('excon_tests') do
187
- Excon.get('http://127.0.0.1:8101/?blah=1')
188
- end
189
-
190
- traces = get_all_traces
191
- assert_equal 7, traces.count
192
- assert_equal '/', traces[1]['ServiceArg']
193
-
194
- AppOpticsAPM::Config[:excon][:log_args] = @log_args
195
- end
196
-
197
- def test_obey_log_args_when_true
198
- @log_args = AppOpticsAPM::Config[:excon][:log_args]
199
- clear_all_traces
200
-
201
- AppOpticsAPM::Config[:excon][:log_args] = true
202
-
203
- AppOpticsAPM::API.start_trace('excon_tests') do
204
- Excon.get('http://127.0.0.1:8101/?blah=1')
205
- end
206
-
207
- traces = get_all_traces
208
- assert_equal 7, traces.count
209
- assert_equal '/?blah=1', traces[1]['ServiceArg']
210
-
211
- AppOpticsAPM::Config[:excon][:log_args] = @log_args
212
- end
213
-
214
- def test_obey_log_args_when_true_and_using_hash
215
- @log_args = AppOpticsAPM::Config[:excon][:log_args]
216
- clear_all_traces
217
-
218
- AppOpticsAPM::Config[:excon][:log_args] = true
219
-
220
- AppOpticsAPM::API.start_trace('excon_tests') do
221
- Excon.get('http://127.0.0.1:8101/?', :query => { :blah => 1 })
222
- end
223
-
224
- traces = get_all_traces
225
- assert_equal 7, traces.count
226
- assert_equal '/?blah=1', traces[1]['ServiceArg']
227
-
228
- AppOpticsAPM::Config[:excon][:log_args] = @log_args
229
- end
230
- end
231
-