oboe 2.7.8.1-java → 2.7.9.6-java

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: 62cd3db82e213327668a85173155c2a26f7283ec
4
- data.tar.gz: e5c55906ad783742b8af7d35aa0e008eea6c4f38
3
+ metadata.gz: 8ed9e41f9666afe02baa1c1052e552478ebc7b69
4
+ data.tar.gz: d48538a8be6ce71406a22c9cf749342c68d3e9d3
5
5
  SHA512:
6
- metadata.gz: 4a54753774a6c4ca87119e5dba44a7bb0f71c78358477fe084e0b40327e297074039e471cf85e6678c787c54d608af24f5278350d5de68394d3960db59ff6b96
7
- data.tar.gz: bf1813f9ff669b8744bc3633df3d5457c5d72660b44b3215d1c3a7262c01903bb809c7bb668b95d2ac450594cd5824f5a4661b14833d4110fa17f2f9345e0578
6
+ metadata.gz: 42b5479c04c6c057f3f670b1419ca6ca93b2f2d8af9d8ff81fac0fb5082b6e48090c175579c136c09e4fef581fdae8249d61187a2a74b44b7433337fcf4778c8
7
+ data.tar.gz: 5d0dc460872f60977390181bba08a242fcf71d4ed1d25e17fb13dfd509330605732652bd5ceaef7565183ca0595e434d881d5e704b972a8edf8b3cfd933ff59b
@@ -21,7 +21,8 @@ rvm:
21
21
  # Attempt Travis/Cassandra fix re: https://github.com/travis-ci/travis-ci/issues/1484
22
22
  # Updated Cassandra: https://github.com/travis-ci/travis-ci/issues/1650
23
23
  before_install:
24
- - gem update --system 2.1.11
24
+ - gem update --system
25
+ - gem update bundler
25
26
  - gem --version
26
27
  - sudo sh -c "echo 'JVM_OPTS=\"\${JVM_OPTS} -Djava.net.preferIPv4Stack=false\"' >> /usr/local/cassandra/conf/cassandra-env.sh"
27
28
  - echo "127.0.0.1 localhost" | sudo tee /etc/hosts
data/Gemfile CHANGED
@@ -10,11 +10,11 @@ end
10
10
  group :development do
11
11
  gem 'ruby-debug', :platforms => [ :mri_18, :jruby ]
12
12
  gem 'debugger', :platform => :mri_19
13
- gem 'byebug', :platforms => [ :mri_20, :mri_21 ]
13
+ gem 'byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
14
14
  # gem 'perftools.rb', :platforms => [ :mri_20, :mri_21 ], :require => 'perftools'
15
15
  if RUBY_VERSION > '1.8.7'
16
16
  gem 'pry'
17
- gem 'pry-byebug', :platforms => [ :mri_20, :mri_21 ]
17
+ gem 'pry-byebug', :platforms => [ :mri_20, :mri_21, :mri_22 ]
18
18
  else
19
19
  gem 'pry', '0.9.12.4'
20
20
  end
@@ -82,7 +82,7 @@ module Oboe_metal
82
82
  # Only report __Init from here if we are not instrumenting a framework.
83
83
  # Otherwise, frameworks will handle reporting __Init after full initialization
84
84
  unless defined?(::Rails) || defined?(::Sinatra) || defined?(::Padrino) || defined?(::Grape)
85
- Oboe::API.report_init
85
+ Oboe::API.report_init unless ENV.key?('OBOE_GEM_TEST')
86
86
  end
87
87
  end
88
88
 
@@ -46,7 +46,7 @@ module Oboe
46
46
  return if !Oboe.loaded || exn.instance_variable_get(:@oboe_logged)
47
47
 
48
48
  kvs = { :ErrorClass => exn.class.name,
49
- :Message => exn.message,
49
+ :ErrorMsg => exn.message,
50
50
  :Backtrace => exn.backtrace.join("\r\n") }
51
51
 
52
52
  exn.instance_variable_set(:@oboe_logged, true)
@@ -52,38 +52,36 @@ module Oboe
52
52
  report_kvs = {}
53
53
  report_kvs[:URL] = URI.unescape(req.path)
54
54
 
55
- # Under JRuby, JOboe may have already started a trace. Make note of this
56
- # if so and don't clear context on log_end (see oboe/api/logging.rb)
57
- Oboe.has_incoming_context = Oboe.tracing?
58
-
59
55
  # Check for and validate X-Trace request header to pick up tracing context
60
56
  xtrace = env.is_a?(Hash) ? env['HTTP_X_TRACE'] : nil
61
57
  xtrace_header = xtrace if xtrace && Oboe::XTrace.valid?(xtrace)
62
- Oboe.has_xtrace_header = xtrace_header
63
58
 
59
+ # Under JRuby, JOboe may have already started a trace. Make note of this
60
+ # if so and don't clear context on log_end (see oboe/api/logging.rb)
61
+ Oboe.has_incoming_context = Oboe.tracing?
62
+ Oboe.has_xtrace_header = xtrace_header
64
63
  Oboe.is_continued_trace = Oboe.has_incoming_context or Oboe.has_xtrace_header
65
64
 
66
- # The actual block of work to instrument
67
- result, xtrace = Oboe::API.start_trace('rack', xtrace_header, report_kvs) do
68
- status, headers, response = @app.call(env)
65
+ Oboe::API.log_start('rack', xtrace_header, report_kvs)
66
+ report_kvs = collect(req, env) if Oboe.tracing?
69
67
 
70
- if Oboe.tracing?
71
- report_kvs = collect(req, env)
72
- Oboe::API.log(nil, 'info', report_kvs.merge!(:Status => status))
73
- end
68
+ status, headers, response = @app.call(env)
74
69
 
75
- [status, headers, response]
70
+ if Oboe.tracing?
71
+ xtrace = Oboe::API.log_end('rack', report_kvs.merge!(:Status => status))
76
72
  end
73
+
74
+ [status, headers, response]
77
75
  rescue Exception => e
78
- xtrace = e.instance_variable_get(:@xtrace)
76
+ Oboe::API.log_exception('rack', e)
77
+ xtrace = Oboe::API.log_end('rack', report_kvs.merge!(:Status => 500))
79
78
  raise
80
79
  ensure
81
- if result && Oboe::XTrace.valid?(xtrace)
80
+ if headers && Oboe::XTrace.valid?(xtrace)
82
81
  unless defined?(JRUBY_VERSION) && Oboe.is_continued_trace?
83
- result[1]['X-Trace'] = xtrace
82
+ headers['X-Trace'] = xtrace if headers.is_a?(Hash)
84
83
  end
85
84
  end
86
- return result
87
85
  end
88
86
  end
89
87
  end
@@ -28,10 +28,6 @@ module Oboe
28
28
  kvs[:HTTPStatus] = response.code
29
29
  kvs['Backtrace'] = Oboe::API.backtrace if Oboe::Config[:typhoeus][:collect_backtraces]
30
30
 
31
- # Avoid cross host tracing for blacklisted domains
32
- # Conditionally add the X-Trace header to the outgoing request
33
- response.headers['X-Trace'] = context unless blacklisted
34
-
35
31
  uri = URI(response.effective_url)
36
32
  kvs['IsService'] = 1
37
33
  kvs['RemoteProtocol'] = uri.scheme
@@ -8,8 +8,8 @@ module Oboe
8
8
  module Version
9
9
  MAJOR = 2
10
10
  MINOR = 7
11
- PATCH = 8
12
- BUILD = 1
11
+ PATCH = 9
12
+ BUILD = 6
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
15
15
  end
@@ -27,7 +27,7 @@ module Oboe
27
27
  # Only report __Init from here if we are not instrumenting a framework.
28
28
  # Otherwise, frameworks will handle reporting __Init after full initialization
29
29
  unless defined?(::Rails) || defined?(::Sinatra) || defined?(::Padrino) || defined?(::Grape)
30
- Oboe::API.report_init
30
+ Oboe::API.report_init unless ENV.key?('OBOE_GEM_TEST')
31
31
  end
32
32
 
33
33
  rescue => e
@@ -1,9 +1,20 @@
1
1
  require 'grape'
2
2
 
3
3
  class GrapeSimple < Grape::API
4
+ rescue_from :all do |e|
5
+ error_response({ message: "rescued from #{e.class.name}" })
6
+ end
4
7
 
5
8
  get '/json_endpoint' do
6
9
  present({ :test => true })
7
10
  end
11
+
12
+ get "/break" do
13
+ raise Exception.new("This should have http status code 500!")
14
+ end
15
+
16
+ get "/breakstring" do
17
+ raise "This should have http status code 500!"
18
+ end
8
19
  end
9
20
 
@@ -27,6 +27,10 @@ SimpleDemo.controllers do
27
27
  get "/render" do
28
28
  render :erb, "This is an erb render"
29
29
  end
30
+
31
+ get "/break" do
32
+ raise "This is a controller exception!"
33
+ end
30
34
  end
31
35
 
32
36
  ## If you want use this as a standalone app uncomment:
@@ -14,6 +14,10 @@ class SinatraSimple < Sinatra::Base
14
14
  get "/render" do
15
15
  render :erb, "This is an erb render"
16
16
  end
17
+
18
+ get "/break" do
19
+ raise "This is a controller exception!"
20
+ end
17
21
  end
18
22
 
19
23
  use SinatraSimple
@@ -12,6 +12,32 @@ if RUBY_VERSION >= '1.9.3'
12
12
 
13
13
  r = get "/json_endpoint"
14
14
 
15
+ traces = get_all_traces
16
+ traces.count.must_equal 4
17
+
18
+ validate_outer_layers(traces, 'rack')
19
+
20
+ traces[1]['Layer'].must_equal "grape"
21
+ traces[2]['Layer'].must_equal "grape"
22
+ traces[2].has_key?('Controller').must_equal true
23
+ traces[2].has_key?('Action').must_equal true
24
+ traces[3]['Label'].must_equal "exit"
25
+
26
+ # Validate the existence of the response header
27
+ r.headers.key?('X-Trace').must_equal true
28
+ r.headers['X-Trace'].must_equal traces[3]['X-Trace']
29
+ end
30
+
31
+ it "should trace a request with an error" do
32
+ @app = GrapeSimple
33
+
34
+ begin
35
+ r = get "/break"
36
+ rescue Exception => e
37
+ # Do not handle/raise this error so
38
+ # we can continue to test
39
+ end
40
+
15
41
  traces = get_all_traces
16
42
  traces.count.must_equal 5
17
43
 
@@ -21,7 +47,10 @@ if RUBY_VERSION >= '1.9.3'
21
47
  traces[2]['Layer'].must_equal "grape"
22
48
  traces[2].has_key?('Controller').must_equal true
23
49
  traces[2].has_key?('Action').must_equal true
24
- traces[3]['Label'].must_equal "info"
50
+ traces[3]['Label'].must_equal "error"
51
+ traces[3]['ErrorClass'].must_equal "Exception"
52
+ traces[3]['ErrorMsg'].must_equal "This should have http status code 500!"
53
+ traces[4]['Label'].must_equal "exit"
25
54
  end
26
55
  end
27
56
  end
@@ -13,13 +13,17 @@ if RUBY_VERSION >= '1.9.3'
13
13
  r = get "/render"
14
14
 
15
15
  traces = get_all_traces
16
- traces.count.must_equal 9
16
+ traces.count.must_equal 8
17
17
 
18
18
  validate_outer_layers(traces, 'rack')
19
19
 
20
20
  traces[1]['Layer'].must_equal "padrino"
21
21
  traces[6]['Controller'].must_equal "SimpleDemo"
22
- traces[7]['Label'].must_equal "info"
22
+ traces[7]['Label'].must_equal "exit"
23
+
24
+ # Validate the existence of the response header
25
+ r.headers.key?('X-Trace').must_equal true
26
+ r.headers['X-Trace'].must_equal traces[7]['X-Trace']
23
27
  end
24
28
  end
25
29
  end
@@ -12,14 +12,18 @@ describe Sinatra do
12
12
  r = get "/render"
13
13
 
14
14
  traces = get_all_traces
15
- traces.count.must_equal 9
15
+ traces.count.must_equal 8
16
16
 
17
17
  validate_outer_layers(traces, 'rack')
18
18
 
19
19
  traces[1]['Layer'].must_equal "sinatra"
20
20
  traces[3]['Label'].must_equal "profile_entry"
21
21
  traces[6]['Controller'].must_equal "SinatraSimple"
22
- traces[7]['Label'].must_equal "info"
22
+ traces[7]['Label'].must_equal "exit"
23
+
24
+ # Validate the existence of the response header
25
+ r.headers.key?('X-Trace').must_equal true
26
+ r.headers['X-Trace'].must_equal traces[7]['X-Trace']
23
27
  end
24
28
  end
25
29
 
@@ -111,7 +111,7 @@ if RUBY_VERSION < '2.0' and not defined?(JRUBY_VERSION)
111
111
  traces[1]['KVKey'].must_equal "testKey"
112
112
 
113
113
  traces[2]['ErrorClass'].must_equal "Memcached::NotStored"
114
- traces[2]['Message'].must_equal "Memcached::NotStored"
114
+ traces[2]['ErrorMsg'].must_equal "Memcached::NotStored"
115
115
  end
116
116
 
117
117
  it "should trace append" do
@@ -24,7 +24,7 @@ class RackTestApp < Minitest::Test
24
24
  get "/lobster"
25
25
 
26
26
  traces = get_all_traces
27
- traces.count.must_equal 3
27
+ traces.count.must_equal 2
28
28
 
29
29
  validate_outer_layers(traces, 'rack')
30
30
 
@@ -33,7 +33,7 @@ class RackTestApp < Minitest::Test
33
33
  validate_event_keys(traces[0], kvs)
34
34
 
35
35
  kvs.clear
36
- kvs["Label"] = "info"
36
+ kvs["Label"] = "exit"
37
37
  kvs["Status"] = "200"
38
38
  kvs["HTTP-Host"] = "example.org"
39
39
  kvs["Port"] = "80"
@@ -1,4 +1,5 @@
1
1
  require 'minitest_helper'
2
+ require 'rack'
2
3
 
3
4
  describe Oboe::Inst::TyphoeusRequestOps do
4
5
  before do
@@ -48,7 +49,7 @@ describe Oboe::Inst::TyphoeusRequestOps do
48
49
 
49
50
  it 'should trace a typhoeus POST request' do
50
51
  Oboe::API.start_trace('typhoeus_test') do
51
- Typhoeus.post("https://internal.tv.appneta.com/api-v2/log_message",
52
+ Typhoeus.post("https://internal.tv.appneta.com/api-v2/log_message",
52
53
  :body => { :key => "oboe-ruby-fake", :content => "oboe-ruby repo test suite"})
53
54
  end
54
55
 
@@ -76,7 +77,7 @@ describe Oboe::Inst::TyphoeusRequestOps do
76
77
 
77
78
  it 'should trace a typhoeus PUT request' do
78
79
  Oboe::API.start_trace('typhoeus_test') do
79
- Typhoeus.put("https://internal.tv.appneta.com/api-v2/log_message",
80
+ Typhoeus.put("https://internal.tv.appneta.com/api-v2/log_message",
80
81
  :body => { :key => "oboe-ruby-fake", :content => "oboe-ruby repo test suite"})
81
82
  end
82
83
 
@@ -181,6 +182,58 @@ describe Oboe::Inst::TyphoeusRequestOps do
181
182
  traces[3]['Label'].must_equal 'exit'
182
183
  end
183
184
 
185
+ it 'should trace a typhoeus GET request to an internal app' do
186
+ # TODO: JRuby doesn't trace the inner rack app for some reason...
187
+ skip if defined?(JRUBY_VERSION)
188
+
189
+ Thread.new do
190
+ app = Rack::Builder.new {
191
+ use Oboe::Rack
192
+ run Proc.new { |env|
193
+ [200, {"Content-Type" => "text/html"}, ['Hello, world!']]
194
+ }
195
+ }
196
+
197
+ Rack::Handler::WEBrick.run(app, :Port => 8000)
198
+ end
199
+
200
+ sleep(1)
201
+
202
+ Oboe::API.start_trace('outer') do
203
+ res = Typhoeus.get("127.0.0.1:8000/")
204
+ end
205
+
206
+ traces = get_all_traces
207
+ traces.count.must_equal 7
208
+
209
+ validate_outer_layers(traces, 'outer')
210
+
211
+ traces[2]['Layer'].must_equal 'rack'
212
+ traces[2]['Label'].must_equal 'entry'
213
+ traces[3]['Layer'].must_equal 'rack'
214
+ traces[3]['Label'].must_equal 'exit'
215
+
216
+ # Verify typhoeus info edges to inner exit
217
+ traces[5]['Edge'].must_equal traces[4]['X-Trace'][42...58]
218
+
219
+ # Verify typhoeus events
220
+ traces[1]['Layer'].must_equal 'typhoeus'
221
+ traces[1].key?('Backtrace').must_equal Oboe::Config[:typhoeus][:collect_backtraces]
222
+
223
+ traces[4]['Layer'].must_equal 'typhoeus'
224
+ traces[4]['Label'].must_equal 'info'
225
+ traces[4]['IsService'].must_equal '1'
226
+ traces[4]['RemoteProtocol'].downcase.must_equal 'http'
227
+ traces[4]['RemoteHost'].must_equal '127.0.0.1'
228
+ traces[4]['RemotePort'].must_equal '8000'
229
+ traces[4]['ServiceArg'].must_equal '/'
230
+ traces[4]['HTTPMethod'].must_equal 'get'
231
+ traces[4]['HTTPStatus'].must_equal '200'
232
+
233
+ traces[5]['Layer'].must_equal 'typhoeus'
234
+ traces[5]['Label'].must_equal 'exit'
235
+ end
236
+
184
237
  it 'should trace a typhoeus GET request with DNS error' do
185
238
  Oboe::API.start_trace('typhoeus_test') do
186
239
  Typhoeus.get("thisdomaindoesntexisthopefully.asdf/products/traceview/")
@@ -32,7 +32,7 @@ unless defined?(JRUBY_VERSION)
32
32
  get "/lobster"
33
33
 
34
34
  traces = get_all_traces
35
- traces.count.must_equal 3
35
+ traces.count.must_equal 2
36
36
 
37
37
  validate_outer_layers(traces, 'rack')
38
38
 
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.8.1
4
+ version: 2.7.9.6
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: 2015-01-08 00:00:00.000000000 Z
12
+ date: 2015-01-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json