oboe 2.7.2.2 → 2.7.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5fddd1f71997ecae38b7f1888f90c6c59ff69a3c
4
- data.tar.gz: 4e54002f173056d3058f1f3c48d59369ed1482c5
3
+ metadata.gz: fbc50cdddd9e7790092bf3e84cca5d8988ee9633
4
+ data.tar.gz: 160f3513d1a91a51de4d8bdccfe303fd330aa0f7
5
5
  SHA512:
6
- metadata.gz: d043f5e6b8604946a71aaa2d10ec05f48f24390c10935614f4a33c3771a0fa7fb73e193f8ad2f87eb4802de5c113200bcf4783ea1af4f1f0f1cb8a5620e0faa9
7
- data.tar.gz: a14372dc589567fe7f3781f7f51d0ea64dbd0b5dd06ef3408f22c41118cca44ff2c26464baedc6b85183f6279e761cec55e9abb333308686ded122a910e7d53a
6
+ metadata.gz: c23d3238a1c61373284bccb94b3d4cd1e142698f4b56eb1c5733d0ad85ab582fb033a6fbec4fbe2c17d9cd32e34e77ead98c60c090a479723cdc10527aea43ea
7
+ data.tar.gz: 7227d4cae655da310878116c8226984e8c1cae232b69972c62f06085b99d438f036314311e9af5a5d053a2871000797dce0ae291c4d26ffc3f8c2d10ed93d90a
data/Rakefile CHANGED
@@ -97,8 +97,7 @@ desc "Rebuild the gem's c extension"
97
97
  task :recompile => [ :distclean, :compile ]
98
98
 
99
99
  task :console do
100
- require 'pry'
101
- require 'oboe'
100
+ Bundler.require(:default, :development)
102
101
  ARGV.clear
103
102
  Pry.start
104
103
  end
@@ -7,6 +7,7 @@ begin
7
7
  require 'oboe/logger'
8
8
  require 'oboe/util'
9
9
  require 'oboe/xtrace'
10
+ require 'oboe/support'
10
11
 
11
12
  # If OboeHeroku is already defined then we are in a PaaS environment
12
13
  # with an alternate metal (see the oboe-heroku gem)
@@ -18,8 +19,8 @@ begin
18
19
  require '/usr/local/tracelytics/tracelyticsagent.jar'
19
20
  require 'joboe_metal'
20
21
  else
21
- require 'oboe_metal.so'
22
- require 'oboe_metal'
22
+ require "oboe_metal.so"
23
+ require "oboe_metal.rb"
23
24
  end
24
25
  rescue LoadError
25
26
  Oboe.loaded = false
@@ -51,6 +52,6 @@ begin
51
52
  # it will load all of the Ruby instrumentation
52
53
  require 'oboe/ruby'
53
54
  rescue => e
54
- $stderr.puts '[oboe/error] Problem loading: #{e.inspect}'
55
+ $stderr.puts "[oboe/error] Problem loading: #{e.inspect}"
55
56
  $stderr.puts e.backtrace
56
57
  end
@@ -17,70 +17,7 @@ module Oboe
17
17
  # Don't send __Init if the c-extension hasn't loaded
18
18
  return unless Oboe.loaded
19
19
 
20
- platform_info = { '__Init' => 1 }
21
-
22
- begin
23
- platform_info['Force'] = true
24
- platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
25
- platform_info['Ruby.Version'] = RUBY_VERSION
26
- platform_info['Ruby.Oboe.Version'] = ::Oboe::Version::STRING
27
- platform_info['RubyHeroku.Oboe.Version'] = ::OboeHeroku::Version::STRING if defined?(::OboeHeroku)
28
-
29
- # Report the framework in use
30
- platform_info['Ruby.Rails.Version'] = "Rails-#{::Rails.version}" if defined?(::Rails)
31
- platform_info['Ruby.Grape.Version'] = "Grape-#{::Grape::VERSION}" if defined?(::Grape)
32
- platform_info['Ruby.Cramp.Version'] = "Cramp-#{::Cramp::VERSION}" if defined?(::Cramp)
33
-
34
- if defined?(::Padrino)
35
- platform_info['Ruby.Padrino.Version'] = "Padrino-#{::Padrino::VERSION}"
36
- elsif defined?(::Sinatra)
37
- platform_info['Ruby.Sinatra.Version'] = "Sinatra-#{::Sinatra::VERSION}"
38
- end
39
-
40
- # Report the instrumented libraries
41
- platform_info['Ruby.Cassandra.Version'] = "Cassandra-#{::Cassandra.VERSION}" if defined?(::Cassandra)
42
- platform_info['Ruby.Dalli.Version'] = "Dalli-#{::Dalli::VERSION}" if defined?(::Dalli)
43
- platform_info['Ruby.MemCache.Version'] = "MemCache-#{::MemCache::VERSION}" if defined?(::MemCache)
44
- platform_info['Ruby.Moped.Version'] = "Moped-#{::Moped::VERSION}" if defined?(::Moped)
45
- platform_info['Ruby.Redis.Version'] = "Redis-#{::Redis::VERSION}" if defined?(::Redis)
46
- platform_info['Ruby.Resque.Version'] = "Resque-#{::Resque::VERSION}" if defined?(::Resque)
47
-
48
- # Special case since the Mongo 1.x driver doesn't embed the version number in the gem directly
49
- if ::Gem.loaded_specs.key?('mongo')
50
- platform_info['Ruby.Mongo.Version'] = "Mongo-#{::Gem.loaded_specs['mongo'].version}"
51
- end
52
-
53
- # Report the server in use (if possible)
54
- if defined?(::Unicorn)
55
- platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
56
- elsif defined?(::Puma)
57
- platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
58
- elsif defined?(::PhusionPassenger)
59
- platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
60
- elsif defined?(::Thin)
61
- platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
62
- elsif defined?(::Mongrel)
63
- platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
64
- elsif defined?(::Mongrel2)
65
- platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
66
- elsif defined?(::Trinidad)
67
- platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
68
- elsif defined?(::WEBrick)
69
- platform_info['Ruby.AppContainer.Version'] = "WEBrick-#{::WEBrick::VERSION}"
70
- else
71
- platform_info['Ruby.AppContainer.Version'] = File.basename($PROGRAM_NAME)
72
- end
73
-
74
- rescue StandardError, ScriptError => e
75
- # Also rescue ScriptError (aka SyntaxError) in case one of the expected
76
- # version defines don't exist
77
-
78
- platform_info['Error'] = "Error in layerinit: #{e.message}"
79
-
80
- Oboe.logger.debug "Error in layerinit: #{e.message}"
81
- Oboe.logger.debug e.backtrace
82
- end
83
-
20
+ platform_info = Oboe::Util.build_init_report
84
21
  start_trace(layer, nil, platform_info.merge('Force' => true)) {}
85
22
  end
86
23
 
@@ -35,8 +35,12 @@ module OboeBase
35
35
  attr_accessor :sample_rate
36
36
  thread_local :layer_op
37
37
 
38
- def self.included(_)
39
- self.loaded = true
38
+ def self.included(cls)
39
+ cls.loaded = true
40
+ end
41
+
42
+ def self.extended(cls)
43
+ cls.loaded = true
40
44
  end
41
45
 
42
46
  def tracing_layer_op?(operation)
@@ -95,7 +99,7 @@ module OboeBase
95
99
  end
96
100
 
97
101
  def heroku?
98
- false
102
+ ENV.key?('TRACEVIEW_URL')
99
103
  end
100
104
 
101
105
  ##
@@ -5,14 +5,18 @@ module Oboe
5
5
  ::Oboe::Util.method_alias(klass, :run_request, ::Faraday::Connection)
6
6
  end
7
7
 
8
- def run_request_with_oboe(method, url, body, headers)
9
- kvs = {}
10
- kvs['Middleware'] = @builder.handlers
11
- kvs['Backtrace'] = Oboe::API.backtrace if Oboe::Config[:faraday][:collect_backtraces]
12
-
8
+ def run_request_with_oboe(method, url, body, headers, &block)
13
9
  # Only send service KVs if we're not using the Net::HTTP adapter
14
10
  # Otherwise, the Net::HTTP instrumentation will send the service KVs
15
11
  handle_service = !@builder.handlers.include?(Faraday::Adapter::NetHttp)
12
+ Oboe::API.log_entry('faraday')
13
+
14
+ result = run_request_without_oboe(method, url, body, headers, &block)
15
+
16
+ kvs = {}
17
+ kvs[:HTTPStatus] = result.status
18
+ kvs['Middleware'] = @builder.handlers
19
+ kvs['Backtrace'] = Oboe::API.backtrace if Oboe::Config[:faraday][:collect_backtraces]
16
20
 
17
21
  if handle_service
18
22
  blacklisted = Oboe::API.blacklisted?(@url_prefix.to_s)
@@ -30,28 +34,25 @@ module Oboe
30
34
  kvs['ServiceArg'] = url
31
35
  kvs['HTTPMethod'] = method
32
36
  kvs['Blacklisted'] = true if blacklisted
33
- end
34
-
35
- Oboe::API.log_entry('faraday', kvs)
36
- result = run_request_without_oboe(method, url, body, headers)
37
37
 
38
- # Re-attach net::http edge unless it's blacklisted or if we don't have a
39
- # valid X-Trace header
40
- if handle_service && !blacklisted
41
- xtrace = result.headers['X-Trace']
38
+ # Re-attach net::http edge unless it's blacklisted or if we don't have a
39
+ # valid X-Trace header
40
+ unless blacklisted
41
+ xtrace = result.headers['X-Trace']
42
42
 
43
- if Oboe::XTrace.valid?(xtrace) && Oboe.tracing?
43
+ if Oboe::XTrace.valid?(xtrace) && Oboe.tracing?
44
44
 
45
- # Assure that we received back a valid X-Trace with the same task_id
46
- if task_id == Oboe::XTrace.task_id(xtrace)
47
- Oboe::Context.fromString(xtrace)
48
- else
49
- Oboe.logger.debug "Mismatched returned X-Trace ID: #{xtrace}"
45
+ # Assure that we received back a valid X-Trace with the same task_id
46
+ if task_id == Oboe::XTrace.task_id(xtrace)
47
+ Oboe::Context.fromString(xtrace)
48
+ else
49
+ Oboe.logger.debug "Mismatched returned X-Trace ID: #{xtrace}"
50
+ end
50
51
  end
51
52
  end
52
53
  end
53
54
 
54
- Oboe::API.log('faraday', 'info', :HTTPStatus => result.status) if handle_service
55
+ Oboe::API.log('faraday', 'info', kvs)
55
56
  result
56
57
  rescue => e
57
58
  Oboe::API.log_exception('faraday', e)
@@ -0,0 +1,94 @@
1
+ # Copyright (c) 2014 AppNeta, Inc.
2
+ # All rights reserved.
3
+
4
+ module Oboe
5
+ ##
6
+ # This module is used to debug problematic setups and/or environments.
7
+ # Depending on the environment, output may be to stdout or the framework
8
+ # log file (e.g. log/production.log)
9
+
10
+ ##
11
+ # yesno
12
+ #
13
+ # Utility method to translate value/nil to "yes"/"no" strings
14
+ def self.yesno(x)
15
+ x ? "yes" : "no"
16
+ end
17
+
18
+ def self.support_report
19
+ Oboe.logger.warn "********************************************************"
20
+ Oboe.logger.warn "* BEGIN TraceView Support Report"
21
+ Oboe.logger.warn "* Please email the output of this report to traceviewsupport@appneta.com"
22
+ Oboe.logger.warn "********************************************************"
23
+ Oboe.logger.warn "Ruby: #{RUBY_DESCRIPTION}"
24
+ Oboe.logger.warn "$0: #{$0}"
25
+ Oboe.logger.warn "$1: #{$1}" unless $1.nil?
26
+ Oboe.logger.warn "$2: #{$2}" unless $2.nil?
27
+ Oboe.logger.warn "$3: #{$3}" unless $3.nil?
28
+ Oboe.logger.warn "$4: #{$4}" unless $4.nil?
29
+ Oboe.logger.warn "Oboe.loaded == #{Oboe.loaded}"
30
+
31
+ using_jruby = defined?(JRUBY_VERSION)
32
+ Oboe.logger.warn "Using JRuby?: #{yesno(using_jruby)}"
33
+ if using_jruby
34
+ Oboe.logger.warn "Joboe Agent Status: #{Java::ComTracelyticsAgent::Agent.getStatus}"
35
+ end
36
+
37
+ on_heroku = Oboe.heroku?
38
+ Oboe.logger.warn "On Heroku?: #{yesno(on_heroku)}"
39
+ if on_heroku
40
+ Oboe.logger.warn "TRACEVIEW_URL: #{ENV['TRACEVIEW_URL']}"
41
+ end
42
+
43
+ Oboe.logger.warn "Oboe::Ruby defined?: #{yesno(defined?(Oboe::Ruby))}"
44
+ Oboe.logger.warn "Oboe.reporter: #{Oboe.reporter}"
45
+
46
+ Oboe.logger.warn "********************************************************"
47
+ Oboe.logger.warn "* Frameworks"
48
+ Oboe.logger.warn "********************************************************"
49
+
50
+ using_rails = defined?(::Rails)
51
+ Oboe.logger.warn "Using Rails?: #{yesno(using_rails)}"
52
+ if using_rails
53
+ Oboe.logger.warn "Oboe::Rails loaded?: #{yesno(defined?(::Oboe::Rails))}"
54
+ end
55
+
56
+ using_sinatra = defined?(::Sinatra)
57
+ Oboe.logger.warn "Using Sinatra?: #{yesno(using_sinatra)}"
58
+
59
+ using_padrino = defined?(::Padrino)
60
+ Oboe.logger.warn "Using Padrino?: #{yesno(using_padrino)}"
61
+
62
+ using_grape = defined?(::Grape)
63
+ Oboe.logger.warn "Using Grape?: #{yesno(using_grape)}"
64
+
65
+ Oboe.logger.warn "********************************************************"
66
+ Oboe.logger.warn "* TraceView Libraries"
67
+ Oboe.logger.warn "********************************************************"
68
+ files = Dir.glob('/usr/lib/liboboe*')
69
+ if files.empty?
70
+ Oboe.logger.warn "Error: No liboboe libs!"
71
+ else
72
+ files.each { |f|
73
+ Oboe.logger.warn f
74
+ }
75
+ end
76
+
77
+ Oboe.logger.warn "********************************************************"
78
+ Oboe.logger.warn "* Raw __Init KVs"
79
+ Oboe.logger.warn "********************************************************"
80
+ platform_info = Oboe::Util.build_report
81
+ platform_info.each { |k,v|
82
+ Oboe.logger.warn "#{k}: #{v}"
83
+ }
84
+
85
+ Oboe.logger.warn "********************************************************"
86
+ Oboe.logger.warn "* END TraceView Support Report"
87
+ Oboe.logger.warn "* Support Email: traceviewsupport@appneta.com"
88
+ Oboe.logger.warn "* Support Portal: https://support.tv.appneta.com"
89
+ Oboe.logger.warn "* Freenode IRC: #appneta"
90
+ Oboe.logger.warn "* Github: https://github.com/appneta/oboe-ruby"
91
+ Oboe.logger.warn "********************************************************"
92
+ nil
93
+ end
94
+ end
@@ -120,6 +120,84 @@ module Oboe
120
120
  x.to_s
121
121
  end
122
122
  end
123
+
124
+ ##
125
+ # build_report
126
+ #
127
+ # Internal: Build a hash of KVs that reports on the status of the
128
+ # running environment. This is used on stack boot in __Init reporting
129
+ # and for Oboe.support_report.
130
+ def build_init_report
131
+ platform_info = { '__Init' => 1 }
132
+
133
+ begin
134
+ platform_info['Force'] = true
135
+ platform_info['Ruby.Platform.Version'] = RUBY_PLATFORM
136
+ platform_info['Ruby.Version'] = RUBY_VERSION
137
+ platform_info['Ruby.Oboe.Version'] = ::Oboe::Version::STRING
138
+ platform_info['RubyHeroku.Oboe.Version'] = ::OboeHeroku::Version::STRING if defined?(::OboeHeroku)
139
+
140
+ # Report the framework in use
141
+ if defined?(::RailsLts)
142
+ platform_info['Ruby.RailsLts.Version'] = "RailsLts-#{::RailsLts::VERSION}"
143
+ elsif defined?(::Rails)
144
+ platform_info['Ruby.Rails.Version'] = "Rails-#{::Rails.version}"
145
+ end
146
+ platform_info['Ruby.Grape.Version'] = "Grape-#{::Grape::VERSION}" if defined?(::Grape)
147
+ platform_info['Ruby.Cramp.Version'] = "Cramp-#{::Cramp::VERSION}" if defined?(::Cramp)
148
+
149
+ if defined?(::Padrino)
150
+ platform_info['Ruby.Padrino.Version'] = "Padrino-#{::Padrino::VERSION}"
151
+ elsif defined?(::Sinatra)
152
+ platform_info['Ruby.Sinatra.Version'] = "Sinatra-#{::Sinatra::VERSION}"
153
+ end
154
+
155
+ # Report the instrumented libraries
156
+ platform_info['Ruby.Cassandra.Version'] = "Cassandra-#{::Cassandra.VERSION}" if defined?(::Cassandra)
157
+ platform_info['Ruby.Dalli.Version'] = "Dalli-#{::Dalli::VERSION}" if defined?(::Dalli)
158
+ platform_info['Ruby.Faraday.Version'] = "Faraday-#{::Faraday::VERSION}" if defined?(::Faraday)
159
+ platform_info['Ruby.MemCache.Version'] = "MemCache-#{::MemCache::VERSION}" if defined?(::MemCache)
160
+ platform_info['Ruby.Moped.Version'] = "Moped-#{::Moped::VERSION}" if defined?(::Moped)
161
+ platform_info['Ruby.Redis.Version'] = "Redis-#{::Redis::VERSION}" if defined?(::Redis)
162
+ platform_info['Ruby.Resque.Version'] = "Resque-#{::Resque::VERSION}" if defined?(::Resque)
163
+
164
+ # Special case since the Mongo 1.x driver doesn't embed the version number in the gem directly
165
+ if ::Gem.loaded_specs.key?('mongo')
166
+ platform_info['Ruby.Mongo.Version'] = "Mongo-#{::Gem.loaded_specs['mongo'].version}"
167
+ end
168
+
169
+ # Report the server in use (if possible)
170
+ if defined?(::Unicorn)
171
+ platform_info['Ruby.AppContainer.Version'] = "Unicorn-#{::Unicorn::Const::UNICORN_VERSION}"
172
+ elsif defined?(::Puma)
173
+ platform_info['Ruby.AppContainer.Version'] = "Puma-#{::Puma::Const::PUMA_VERSION} (#{::Puma::Const::CODE_NAME})"
174
+ elsif defined?(::PhusionPassenger)
175
+ platform_info['Ruby.AppContainer.Version'] = "#{::PhusionPassenger::PACKAGE_NAME}-#{::PhusionPassenger::VERSION_STRING}"
176
+ elsif defined?(::Thin)
177
+ platform_info['Ruby.AppContainer.Version'] = "Thin-#{::Thin::VERSION::STRING} (#{::Thin::VERSION::CODENAME})"
178
+ elsif defined?(::Mongrel)
179
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel-#{::Mongrel::Const::MONGREL_VERSION}"
180
+ elsif defined?(::Mongrel2)
181
+ platform_info['Ruby.AppContainer.Version'] = "Mongrel2-#{::Mongrel2::VERSION}"
182
+ elsif defined?(::Trinidad)
183
+ platform_info['Ruby.AppContainer.Version'] = "Trinidad-#{::Trinidad::VERSION}"
184
+ elsif defined?(::WEBrick)
185
+ platform_info['Ruby.AppContainer.Version'] = "WEBrick-#{::WEBrick::VERSION}"
186
+ else
187
+ platform_info['Ruby.AppContainer.Version'] = File.basename($PROGRAM_NAME)
188
+ end
189
+
190
+ rescue StandardError, ScriptError => e
191
+ # Also rescue ScriptError (aka SyntaxError) in case one of the expected
192
+ # version defines don't exist
193
+
194
+ platform_info['Error'] = "Error in build_report: #{e.message}"
195
+
196
+ Oboe.logger.warn "[oboe/warn] Error in build_init_report: #{e.message}"
197
+ Oboe.logger.debug e.backtrace
198
+ end
199
+ platform_info
200
+ end
123
201
  end
124
202
  end
125
203
  end
@@ -8,8 +8,8 @@ module Oboe
8
8
  module Version
9
9
  MAJOR = 2
10
10
  MINOR = 7
11
- PATCH = 2
12
- BUILD = 2
11
+ PATCH = 3
12
+ BUILD = 1
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
15
15
  end
@@ -29,7 +29,7 @@ describe Oboe::Inst::FaradayConnection do
29
29
  end
30
30
 
31
31
  traces = get_all_traces
32
- traces.count.must_equal 7
32
+ traces.count.must_equal 8
33
33
 
34
34
  validate_outer_layers(traces, 'faraday_test')
35
35
 
@@ -47,20 +47,20 @@ describe Oboe::Inst::FaradayConnection do
47
47
  traces[4]['Layer'].must_equal 'net-http'
48
48
  traces[4]['Label'].must_equal 'exit'
49
49
 
50
- traces[5]['Layer'].must_equal 'faraday'
51
- traces[5]['Label'].must_equal 'exit'
50
+ traces[6]['Layer'].must_equal 'faraday'
51
+ traces[6]['Label'].must_equal 'exit'
52
52
  end
53
53
 
54
54
  it 'should trace a Faraday request' do
55
55
  Oboe::API.start_trace('faraday_test') do
56
- conn = Faraday.new(:url => 'http://www.google.com') do |faraday|
56
+ conn = Faraday.new(:url => 'http://www.curlmyip.com') do |faraday|
57
57
  faraday.adapter Faraday.default_adapter # make requests with Net::HTTP
58
58
  end
59
59
  response = conn.get '/?q=ruby_test_suite'
60
60
  end
61
61
 
62
62
  traces = get_all_traces
63
- traces.count.must_equal 7
63
+ traces.count.must_equal 8
64
64
 
65
65
  validate_outer_layers(traces, 'faraday_test')
66
66
 
@@ -70,7 +70,7 @@ describe Oboe::Inst::FaradayConnection do
70
70
  traces[3]['Layer'].must_equal 'net-http'
71
71
  traces[3]['IsService'].must_equal '1'
72
72
  traces[3]['RemoteProtocol'].must_equal 'HTTP'
73
- traces[3]['RemoteHost'].must_equal 'www.google.com'
73
+ traces[3]['RemoteHost'].must_equal 'www.curlmyip.com'
74
74
  traces[3]['ServiceArg'].must_equal '/?q=ruby_test_suite'
75
75
  traces[3]['HTTPMethod'].must_equal 'GET'
76
76
  traces[3]['HTTPStatus'].must_equal '200'
@@ -79,7 +79,41 @@ describe Oboe::Inst::FaradayConnection do
79
79
  traces[4]['Label'].must_equal 'exit'
80
80
 
81
81
  traces[5]['Layer'].must_equal 'faraday'
82
- traces[5]['Label'].must_equal 'exit'
82
+ traces[5]['Label'].must_equal 'info'
83
+
84
+ traces[6]['Layer'].must_equal 'faraday'
85
+ traces[6]['Label'].must_equal 'exit'
86
+ end
87
+
88
+ it 'should trace a Faraday alternate request method' do
89
+ Oboe::API.start_trace('faraday_test') do
90
+ Faraday.get('http://www.curlmyip.com', {:a => 1})
91
+ end
92
+
93
+ traces = get_all_traces
94
+ traces.count.must_equal 8
95
+
96
+ validate_outer_layers(traces, 'faraday_test')
97
+
98
+ traces[1]['Layer'].must_equal 'faraday'
99
+ traces[1].key?('Backtrace').must_equal Oboe::Config[:faraday][:collect_backtraces]
100
+
101
+ traces[3]['Layer'].must_equal 'net-http'
102
+ traces[3]['IsService'].must_equal '1'
103
+ traces[3]['RemoteProtocol'].must_equal 'HTTP'
104
+ traces[3]['RemoteHost'].must_equal 'www.curlmyip.com'
105
+ traces[3]['ServiceArg'].must_equal '/?a=1'
106
+ traces[3]['HTTPMethod'].must_equal 'GET'
107
+ traces[3]['HTTPStatus'].must_equal '200'
108
+
109
+ traces[4]['Layer'].must_equal 'net-http'
110
+ traces[4]['Label'].must_equal 'exit'
111
+
112
+ traces[5]['Layer'].must_equal 'faraday'
113
+ traces[5]['Label'].must_equal 'info'
114
+
115
+ traces[6]['Layer'].must_equal 'faraday'
116
+ traces[6]['Label'].must_equal 'exit'
83
117
  end
84
118
 
85
119
  it 'should trace a Faraday with an alternate adapter' do
@@ -98,11 +132,11 @@ describe Oboe::Inst::FaradayConnection do
98
132
  traces[1]['Layer'].must_equal 'faraday'
99
133
  traces[1].key?('Backtrace').must_equal Oboe::Config[:faraday][:collect_backtraces]
100
134
 
101
- traces[1]['IsService'].must_equal '1'
102
- traces[1]['RemoteProtocol'].must_equal 'HTTP'
103
- traces[1]['RemoteHost'].must_equal 'www.google.com'
104
- traces[1]['ServiceArg'].must_equal '/?q=ruby_test_suite'
105
- traces[1]['HTTPMethod'].downcase.must_equal 'get'
135
+ traces[2]['IsService'].must_equal '1'
136
+ traces[2]['RemoteProtocol'].must_equal 'HTTP'
137
+ traces[2]['RemoteHost'].must_equal 'www.google.com'
138
+ traces[2]['ServiceArg'].must_equal '/?q=ruby_test_suite'
139
+ traces[2]['HTTPMethod'].downcase.must_equal 'get'
106
140
 
107
141
  traces[2]['Layer'].must_equal 'faraday'
108
142
  traces[2]['Label'].must_equal 'info'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oboe
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.2.2
4
+ version: 2.7.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Giacomo Lombardo
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-09-26 00:00:00.000000000 Z
12
+ date: 2014-10-15 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json
@@ -116,6 +116,7 @@ files:
116
116
  - lib/oboe/logger.rb
117
117
  - lib/oboe/method_profiling.rb
118
118
  - lib/oboe/ruby.rb
119
+ - lib/oboe/support.rb
119
120
  - lib/oboe/thread_local.rb
120
121
  - lib/oboe/util.rb
121
122
  - lib/oboe/version.rb