oboe 2.7.2.2-java → 2.7.3.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +1 -2
- data/lib/oboe.rb +4 -3
- data/lib/oboe/api/layerinit.rb +1 -64
- data/lib/oboe/base.rb +7 -3
- data/lib/oboe/inst/faraday.rb +21 -20
- data/lib/oboe/support.rb +94 -0
- data/lib/oboe/util.rb +78 -0
- data/lib/oboe/version.rb +2 -2
- data/test/instrumentation/faraday_test.rb +46 -12
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5cbf087aedb2075090b9967a318e927be291486d
|
4
|
+
data.tar.gz: f8ac9ed51ad6707a7b504cb31b12330d04a83dfe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a19e0aa37533a546609c179e07d65c8b4edcb4293a82e6b07fbebc089091cbad420345ce804e54c2eed76adf871b579e643070c723c01efacb1789b88310f70b
|
7
|
+
data.tar.gz: 08433952d8d5a6097bbd0847781a3159fed8d93ebc1d441eb6a9221667d368f6e7347245294ad9ce4ae89d94d8572f7011ae1a1e2ae1c4e8f6bfc399256c5aaa
|
data/Rakefile
CHANGED
data/lib/oboe.rb
CHANGED
@@ -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
|
22
|
-
require
|
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
|
55
|
+
$stderr.puts "[oboe/error] Problem loading: #{e.inspect}"
|
55
56
|
$stderr.puts e.backtrace
|
56
57
|
end
|
data/lib/oboe/api/layerinit.rb
CHANGED
@@ -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 =
|
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
|
|
data/lib/oboe/base.rb
CHANGED
@@ -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
|
-
|
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
|
-
|
102
|
+
ENV.key?('TRACEVIEW_URL')
|
99
103
|
end
|
100
104
|
|
101
105
|
##
|
data/lib/oboe/inst/faraday.rb
CHANGED
@@ -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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
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
|
-
|
43
|
+
if Oboe::XTrace.valid?(xtrace) && Oboe.tracing?
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
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',
|
55
|
+
Oboe::API.log('faraday', 'info', kvs)
|
55
56
|
result
|
56
57
|
rescue => e
|
57
58
|
Oboe::API.log_exception('faraday', e)
|
data/lib/oboe/support.rb
ADDED
@@ -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
|
data/lib/oboe/util.rb
CHANGED
@@ -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
|
data/lib/oboe/version.rb
CHANGED
@@ -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
|
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[
|
51
|
-
traces[
|
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.
|
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
|
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.
|
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 '
|
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[
|
102
|
-
traces[
|
103
|
-
traces[
|
104
|
-
traces[
|
105
|
-
traces[
|
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.
|
4
|
+
version: 2.7.3.1
|
5
5
|
platform: java
|
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-
|
12
|
+
date: 2014-10-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|
@@ -114,6 +114,7 @@ files:
|
|
114
114
|
- lib/oboe/logger.rb
|
115
115
|
- lib/oboe/method_profiling.rb
|
116
116
|
- lib/oboe/ruby.rb
|
117
|
+
- lib/oboe/support.rb
|
117
118
|
- lib/oboe/thread_local.rb
|
118
119
|
- lib/oboe/util.rb
|
119
120
|
- lib/oboe/version.rb
|
@@ -172,7 +173,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
172
173
|
version: '0'
|
173
174
|
requirements: []
|
174
175
|
rubyforge_project:
|
175
|
-
rubygems_version: 2.
|
176
|
+
rubygems_version: 2.1.9
|
176
177
|
signing_key:
|
177
178
|
specification_version: 4
|
178
179
|
summary: AppNeta TraceView performance instrumentation gem for Ruby
|