oboe 2.7.10.1-java → 2.7.11.1-java

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1fcc957b05aaa4db312a9c3489c0afa9db8e7abc
4
- data.tar.gz: 66c1e08d4e7a5347e639d5331fe18befd3ea65df
3
+ metadata.gz: 6ea03cbd768290331cc9dec4262a693ab0f03af9
4
+ data.tar.gz: e4beeb8182a6f97e2e3c4757c94ab3fd547e987d
5
5
  SHA512:
6
- metadata.gz: 05e988b3c4820b76ac96cbaecda16b08d443449c444b8c083545f4b8fc5d27d3c35439eb2c9e56ac09d5970ed7652e0c7f7a4f71fb92e480ede3ecf12eb3e9cc
7
- data.tar.gz: ca9686165ac5240eac0c4d706a73f16317362682c4a00e4108dc133c21fc24848373bfa152b1ecb7bd5ec8356215599070b6520f10cadbe274032c9fc6649261
6
+ metadata.gz: 9939bce4fb0589265e15cc4eb2eaff2fe0bf79cdf5910d02975c45a1d8bd603181c8a11d1f86604986bf6a5de9f51d1a3fe2bff9ee92c35ab395f01bcbadfc3e
7
+ data.tar.gz: f3133e33b5430c585b43285e8588283f6942e396bc0887ffe57f7aaf30ea3dc3bf3c82a8fc2cf18d71acfeda7e35a7e3148a7680f98544168174d8bc9095e3cc
data/CHANGELOG.md CHANGED
@@ -4,6 +4,41 @@ https://github.com/appneta/oboe-ruby/releases
4
4
 
5
5
  Dates in this file are in the format MM/DD/YYYY.
6
6
 
7
+ # oboe 2.7.11.1
8
+
9
+ This patch release includes:
10
+
11
+ * Grape instrumentation fixes and improvements: #102
12
+ * Report Sequel and Typhoeus versions in __Init: #101
13
+
14
+ Pushed to Rubygems:
15
+
16
+ https://rubygems.org/gems/oboe/versions/2.7.11.1
17
+ https://rubygems.org/gems/oboe/versions/2.7.11.1-java
18
+
19
+ # oboe 2.7.10.1
20
+
21
+ This patch release includes:
22
+
23
+ * Add the ability to configure the do not trace list: #100
24
+
25
+ Pushed to Rubygems:
26
+
27
+ https://rubygems.org/gems/oboe/versions/2.7.10.1
28
+ https://rubygems.org/gems/oboe/versions/2.7.10.1-java
29
+
30
+ # oboe 2.7.9.6
31
+
32
+ This patch release includes:
33
+
34
+ * Better, faster, stronger Rack instrumentation: #99
35
+ * A Typhoeus instrumentation fix for cross-app tracing: #97
36
+
37
+ Pushed to Rubygems:
38
+
39
+ https://rubygems.org/gems/oboe/versions/2.7.9.6
40
+ https://rubygems.org/gems/oboe/versions/2.7.9.6-java
41
+
7
42
  # oboe 2.7.8.1
8
43
 
9
44
  This patch release includes:
data/lib/oboe/config.rb CHANGED
@@ -12,8 +12,9 @@ module Oboe
12
12
  @@config = {}
13
13
 
14
14
  @@instrumentation = [:action_controller, :action_view, :active_record,
15
- :cassandra, :dalli, :em_http_request, :faraday, :nethttp, :memcached,
16
- :memcache, :mongo, :moped, :rack, :redis, :resque, :sequel, :typhoeus]
15
+ :cassandra, :dalli, :em_http_request, :faraday, :grape, :nethttp,
16
+ :memcached, :memcache, :mongo, :moped, :rack, :redis, :resque,
17
+ :sequel, :typhoeus]
17
18
  ##
18
19
  # Return the raw nested hash.
19
20
  #
@@ -40,6 +41,7 @@ module Oboe
40
41
  Oboe::Config[:cassandra][:collect_backtraces] = true
41
42
  Oboe::Config[:dalli][:collect_backtraces] = false
42
43
  Oboe::Config[:faraday][:collect_backtraces] = false
44
+ Oboe::Config[:grape][:collect_backtraces] = true
43
45
  Oboe::Config[:em_http_request][:collect_backtraces] = false
44
46
  Oboe::Config[:memcache][:collect_backtraces] = false
45
47
  Oboe::Config[:memcached][:collect_backtraces] = false
@@ -47,12 +47,35 @@ module Oboe
47
47
  module Middleware
48
48
  module Error
49
49
  def self.included(klass)
50
- ::Oboe::Util.method_alias(klass, :call, ::Grape::Middleware::Error)
50
+ ::Oboe::Util.method_alias(klass, :error_response, ::Grape::Middleware::Error)
51
51
  end
52
52
 
53
- def call_with_oboe(boom)
54
- Oboe::API.log_exception(nil, boom) if Oboe.tracing?
55
- call_without_oboe(boom)
53
+ def error_response_with_oboe(error = {})
54
+ status, headers, body = error_response_without_oboe(error)
55
+
56
+ if Oboe.tracing?
57
+ # Since Grape uses throw/catch and not Exceptions, we manually log
58
+ # the error here.
59
+ kvs = {}
60
+ kvs[:ErrorClass] = 'GrapeError'
61
+ kvs[:ErrorMsg] = error[:message] ? error[:message] : "No message given."
62
+ kvs[:Backtrace] = ::Oboe::API.backtrace if Oboe::Config[:grape][:collect_backtraces]
63
+
64
+ ::Oboe::API.log(nil, 'error', kvs)
65
+
66
+ # Since calls to error() are handled similar to abort in Grape. We
67
+ # manually log the rack exit here since the original code won't
68
+ # be returned to
69
+ xtrace = Oboe::API.log_end('rack', :Status => status)
70
+
71
+ if headers && Oboe::XTrace.valid?(xtrace)
72
+ unless defined?(JRUBY_VERSION) && Oboe.is_continued_trace?
73
+ headers['X-Trace'] = xtrace if headers.is_a?(Hash)
74
+ end
75
+ end
76
+ end
77
+
78
+ [status, headers, body]
56
79
  end
57
80
  end
58
81
  end
data/lib/oboe/util.rb CHANGED
@@ -161,6 +161,7 @@ module Oboe
161
161
  platform_info['Ruby.Moped.Version'] = "Moped-#{::Moped::VERSION}" if defined?(::Moped)
162
162
  platform_info['Ruby.Redis.Version'] = "Redis-#{::Redis::VERSION}" if defined?(::Redis)
163
163
  platform_info['Ruby.Resque.Version'] = "Resque-#{::Resque::VERSION}" if defined?(::Resque)
164
+ platform_info['Ruby.Typhoeus.Version'] = "Typhoeus-#{::Typhoeus::VERSION}" if defined?(::Typhoeus::VERSION)
164
165
 
165
166
  # Special case since the Mongo 1.x driver doesn't embed the version number in the gem directly
166
167
  if ::Gem.loaded_specs.key?('mongo')
@@ -171,6 +172,7 @@ module Oboe
171
172
  platform_info['Ruby.Mysql.Version'] = Mysql::GemVersion::VERSION if defined?(Mysql::GemVersion::VERSION)
172
173
  platform_info['Ruby.PG.Version'] = PG::VERSION if defined?(PG::VERSION)
173
174
  platform_info['Ruby.Mysql2.Version'] = Mysql2::VERSION if defined?(Mysql2::VERSION)
175
+ platform_info['Ruby.Sequel.Version'] = ::Sequel::VERSION if defined?(::Sequel::VERSION)
174
176
 
175
177
  # Report the server in use (if possible)
176
178
  if defined?(::Unicorn)
data/lib/oboe/version.rb CHANGED
@@ -8,7 +8,7 @@ module Oboe
8
8
  module Version
9
9
  MAJOR = 2
10
10
  MINOR = 7
11
- PATCH = 10
11
+ PATCH = 11
12
12
  BUILD = 1
13
13
 
14
14
  STRING = [MAJOR, MINOR, PATCH, BUILD].compact.join('.')
@@ -40,6 +40,34 @@ if defined?(Oboe::Config)
40
40
  # avoid collecting and reporting query literals to TraceView.
41
41
  # Oboe::Config[:sanitize_sql] = false
42
42
 
43
+ # Do Not Trace
44
+ # These two values allow you to configure specific URL patterns to
45
+ # never be traced. By default, this is set to common static file
46
+ # extensions but you may want to customize this list for your needs.
47
+ #
48
+ # dnt_regexp and dnt_opts is passed to Regexp.new to create
49
+ # a regular expression object. That is then used to match against
50
+ # the incoming request path.
51
+ #
52
+ # The path string originates from the rack layer and is retrieved
53
+ # as follows:
54
+ #
55
+ # req = ::Rack::Request.new(env)
56
+ # path = URI.unescape(req.path)
57
+ #
58
+ # Usage:
59
+ # Oboe::Config[:dnt_regexp] = "lobster$"
60
+ # Oboe::Config[:dnt_opts] = Regexp::IGNORECASE
61
+ #
62
+ # This will ignore all requests that end with the string lobster
63
+ # regardless of case
64
+ #
65
+ # Requests with positive matches (non nil) will not be traced.
66
+ # See lib/oboe/util.rb: Oboe::Util.static_asset?
67
+ #
68
+ # Oboe::Config[:dnt_regexp] = "\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|rar|bz2|pdf|txt|tar|wav|bmp|rtf|js|flv|swf|ttf|woff|svg|less)$"
69
+ # Oboe::Config[:dnt_opts] = Regexp::IGNORECASE
70
+
43
71
  #
44
72
  # Enabling/Disabling Instrumentation
45
73
  #
@@ -13,6 +13,10 @@ class GrapeSimple < Grape::API
13
13
  raise Exception.new("This should have http status code 500!")
14
14
  end
15
15
 
16
+ get "/error" do
17
+ error!("This is a error with 'error'!")
18
+ end
19
+
16
20
  get "/breakstring" do
17
21
  raise "This should have http status code 500!"
18
22
  end
@@ -12,6 +12,9 @@ if RUBY_VERSION >= '1.9.3'
12
12
 
13
13
  r = get "/json_endpoint"
14
14
 
15
+ r.status.must_equal 200
16
+ r.headers.key?('X-Trace').must_equal true
17
+
15
18
  traces = get_all_traces
16
19
  traces.count.must_equal 4
17
20
 
@@ -28,7 +31,7 @@ if RUBY_VERSION >= '1.9.3'
28
31
  r.headers['X-Trace'].must_equal traces[3]['X-Trace']
29
32
  end
30
33
 
31
- it "should trace a request with an error" do
34
+ it "should trace a request with an exception" do
32
35
  @app = GrapeSimple
33
36
 
34
37
  begin
@@ -52,5 +55,31 @@ if RUBY_VERSION >= '1.9.3'
52
55
  traces[3]['ErrorMsg'].must_equal "This should have http status code 500!"
53
56
  traces[4]['Label'].must_equal "exit"
54
57
  end
58
+
59
+ it "should trace a request with an error" do
60
+ @app = GrapeSimple
61
+
62
+ r = get "/error"
63
+
64
+ traces = get_all_traces
65
+ traces.count.must_equal 5
66
+
67
+ r.status.must_equal 500
68
+ r.headers.key?('X-Trace').must_equal true
69
+
70
+ validate_outer_layers(traces, 'rack')
71
+
72
+ traces[0]['Layer'].must_equal "rack"
73
+ traces[1]['Layer'].must_equal "grape"
74
+ traces[2]['Layer'].must_equal "grape"
75
+ traces[2].has_key?('Controller').must_equal true
76
+ traces[2].has_key?('Action').must_equal true
77
+ traces[3]['Label'].must_equal "error"
78
+ traces[3]['ErrorClass'].must_equal "GrapeError"
79
+ traces[3]['ErrorMsg'].must_equal "This is a error with 'error'!"
80
+ traces[4]['Layer'].must_equal "rack"
81
+ traces[4]['Label'].must_equal "exit"
82
+ traces[4]['Status'].must_equal "500"
83
+ end
55
84
  end
56
85
  end
@@ -23,7 +23,7 @@ describe Oboe::Config do
23
23
  instrumentation = Oboe::Config.instrumentation_list
24
24
 
25
25
  # Verify the number of individual instrumentations
26
- instrumentation.count.must_equal 17
26
+ instrumentation.count.must_equal 18
27
27
 
28
28
  Oboe::Config[:action_controller][:enabled].must_equal true
29
29
  Oboe::Config[:action_view][:enabled].must_equal true
@@ -32,6 +32,7 @@ describe Oboe::Config do
32
32
  Oboe::Config[:dalli][:enabled].must_equal true
33
33
  Oboe::Config[:em_http_request][:enabled].must_equal false
34
34
  Oboe::Config[:faraday][:enabled].must_equal true
35
+ Oboe::Config[:grape][:enabled].must_equal true
35
36
  Oboe::Config[:nethttp][:enabled].must_equal true
36
37
  Oboe::Config[:memcached][:enabled].must_equal true
37
38
  Oboe::Config[:memcache][:enabled].must_equal true
@@ -48,6 +49,7 @@ describe Oboe::Config do
48
49
  Oboe::Config[:dalli][:log_args].must_equal true
49
50
  Oboe::Config[:em_http_request][:log_args].must_equal true
50
51
  Oboe::Config[:faraday][:log_args].must_equal true
52
+ Oboe::Config[:grape][:log_args].must_equal true
51
53
  Oboe::Config[:nethttp][:log_args].must_equal true
52
54
  Oboe::Config[:memcached][:log_args].must_equal true
53
55
  Oboe::Config[:memcache][:log_args].must_equal true
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.10.1
4
+ version: 2.7.11.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: 2015-02-02 00:00:00.000000000 Z
12
+ date: 2015-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: json