oboe 2.7.14.1-java → 2.7.15.1-java
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -0
- data/lib/oboe/config.rb +6 -0
- data/lib/oboe/frameworks/rails/inst/action_controller.rb +122 -28
- data/lib/oboe/version.rb +1 -1
- data/lib/rails/generators/oboe/templates/oboe_initializer.rb +31 -16
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3afed3934fb8e52bc451c74b37953f4298626e0
|
4
|
+
data.tar.gz: baf521941261128f4c8981ed13cb1f23e11c759e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5a848fd2ad12631d0fe146557c17c96a79bb1bb9ef362a328cf68adfd74ffe7cada93ad02e70c347666c774c47ebd6df72db8a7469f4ea6ce6c713a50d322688
|
7
|
+
data.tar.gz: d6befaa4cbcd6804109bf02192a3c148be4d8bc3d5786b457b4b26372a2e3834c5d25dc9f7de24920193baf88336ef0728ede0440954bcb75d2ef9f22e42ecb2
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,17 @@ 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.15.1
|
8
|
+
|
9
|
+
This patch release includes:
|
10
|
+
|
11
|
+
* Rails Instrumentation should respect top-level rescue handlers: #111
|
12
|
+
|
13
|
+
Pushed to Rubygems:
|
14
|
+
|
15
|
+
https://rubygems.org/gems/oboe/versions/2.7.15.1
|
16
|
+
https://rubygems.org/gems/oboe/versions/2.7.15/1-java
|
17
|
+
|
7
18
|
# oboe 2.7.14.1
|
8
19
|
|
9
20
|
This patch release includes:
|
data/lib/oboe/config.rb
CHANGED
@@ -101,6 +101,12 @@ module Oboe
|
|
101
101
|
@@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)$"
|
102
102
|
@@config[:dnt_opts] = Regexp::IGNORECASE
|
103
103
|
|
104
|
+
# In Rails, raised exceptions with rescue handlers via
|
105
|
+
# <tt>rescue_from</tt> are not reported to the TraceView
|
106
|
+
# dashboard by default. Setting this value to true will
|
107
|
+
# report all raised exception regardless.
|
108
|
+
@@config[:report_rescued_errors] = false
|
109
|
+
|
104
110
|
if ENV.key?('OPENSHIFT_TRACEVIEW_TLYZER_IP')
|
105
111
|
# We're running on OpenShift
|
106
112
|
@@config[:tracing_mode] = 'always'
|
@@ -3,7 +3,82 @@
|
|
3
3
|
|
4
4
|
module Oboe
|
5
5
|
module Inst
|
6
|
-
|
6
|
+
#
|
7
|
+
# RailsBase
|
8
|
+
#
|
9
|
+
# This module contains the instrumentation code common to
|
10
|
+
# many Rails versions.
|
11
|
+
#
|
12
|
+
module RailsBase
|
13
|
+
#
|
14
|
+
# has_handler?
|
15
|
+
#
|
16
|
+
# Determins if <tt>exception</tt> has a registered
|
17
|
+
# handler via <tt>rescue_from</tt>
|
18
|
+
#
|
19
|
+
def has_handler?(exception)
|
20
|
+
# Don't log exceptions if they have a rescue handler set
|
21
|
+
has_handler = false
|
22
|
+
rescue_handlers.detect { | klass_name, handler |
|
23
|
+
# Rescue handlers can be specified as strings or constant names
|
24
|
+
klass = self.class.const_get(klass_name) rescue nil
|
25
|
+
klass ||= klass_name.constantize rescue nil
|
26
|
+
has_handler = exception.is_a?(klass) if klass
|
27
|
+
}
|
28
|
+
has_handler
|
29
|
+
rescue => e
|
30
|
+
Oboe.logger.debug "[oboe/debug] Error searching Rails handlers: #{e.message}"
|
31
|
+
return false
|
32
|
+
end
|
33
|
+
|
34
|
+
#
|
35
|
+
# log_rails_error?
|
36
|
+
#
|
37
|
+
# Determins whether we should log a raised exception to the
|
38
|
+
# TraceView dashboard. This is determined by whether the exception
|
39
|
+
# has a rescue handler setup and the value of
|
40
|
+
# Oboe::Config[:report_rescued_errors]
|
41
|
+
#
|
42
|
+
def log_rails_error?(exception)
|
43
|
+
# As it's perculating up through the layers... make sure that
|
44
|
+
# we only report it once.
|
45
|
+
return false if exception.instance_variable_get(:@oboe_logged)
|
46
|
+
|
47
|
+
has_handler = has_handler?(exception)
|
48
|
+
|
49
|
+
if !has_handler || (has_handler && Oboe::Config[:report_rescued_errors])
|
50
|
+
return true
|
51
|
+
end
|
52
|
+
false
|
53
|
+
end
|
54
|
+
|
55
|
+
#
|
56
|
+
# render_with_oboe
|
57
|
+
#
|
58
|
+
# Our render wrapper that just times and conditionally
|
59
|
+
# reports raised exceptions
|
60
|
+
#
|
61
|
+
def render_with_oboe(*args)
|
62
|
+
Oboe::API.log_entry('actionview')
|
63
|
+
render_without_oboe(*args)
|
64
|
+
|
65
|
+
rescue Exception => e
|
66
|
+
Oboe::API.log_exception(nil, e) if log_rails_error?(e)
|
67
|
+
raise
|
68
|
+
ensure
|
69
|
+
Oboe::API.log_exit('actionview')
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
#
|
74
|
+
# ActionController3
|
75
|
+
#
|
76
|
+
# This modules contains the instrumentation code specific
|
77
|
+
# to Rails v3
|
78
|
+
#
|
79
|
+
module ActionController3
|
80
|
+
include ::Oboe::Inst::RailsBase
|
81
|
+
|
7
82
|
def self.included(base)
|
8
83
|
base.class_eval do
|
9
84
|
alias_method_chain :process, :oboe
|
@@ -13,9 +88,14 @@ module Oboe
|
|
13
88
|
end
|
14
89
|
|
15
90
|
def process_with_oboe(*args)
|
16
|
-
Oboe::API.
|
17
|
-
|
18
|
-
|
91
|
+
Oboe::API.log_entry('rails')
|
92
|
+
process_without_oboe *args
|
93
|
+
|
94
|
+
rescue Exception => e
|
95
|
+
Oboe::API.log_exception(nil, e) if log_rails_error?(e)
|
96
|
+
raise
|
97
|
+
ensure
|
98
|
+
Oboe::API.log_exit('rails')
|
19
99
|
end
|
20
100
|
|
21
101
|
def process_action_with_oboe(*args)
|
@@ -31,15 +111,17 @@ module Oboe
|
|
31
111
|
Oboe::API.log(nil, 'info', report_kvs)
|
32
112
|
raise
|
33
113
|
end
|
34
|
-
|
35
|
-
def render_with_oboe(*args)
|
36
|
-
Oboe::API.trace('actionview', {}) do
|
37
|
-
render_without_oboe *args
|
38
|
-
end
|
39
|
-
end
|
40
114
|
end
|
41
115
|
|
42
|
-
|
116
|
+
#
|
117
|
+
# ActionController4
|
118
|
+
#
|
119
|
+
# This modules contains the instrumentation code specific
|
120
|
+
# to Rails v4
|
121
|
+
#
|
122
|
+
module ActionController4
|
123
|
+
include ::Oboe::Inst::RailsBase
|
124
|
+
|
43
125
|
def self.included(base)
|
44
126
|
base.class_eval do
|
45
127
|
alias_method_chain :process_action, :oboe
|
@@ -55,15 +137,15 @@ module Oboe
|
|
55
137
|
:Controller => self.class.name,
|
56
138
|
:Action => self.action_name,
|
57
139
|
}
|
58
|
-
Oboe::API.trace('rails', report_kvs) do
|
59
|
-
process_action_without_oboe(method_name, *args)
|
60
|
-
end
|
61
|
-
end
|
62
140
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
141
|
+
Oboe::API.log_entry('rails')
|
142
|
+
process_action_without_oboe(method_name, *args)
|
143
|
+
|
144
|
+
rescue Exception => e
|
145
|
+
Oboe::API.log_exception(nil, e) if log_rails_error?(e)
|
146
|
+
raise
|
147
|
+
ensure
|
148
|
+
Oboe::API.log_exit('rails')
|
67
149
|
end
|
68
150
|
end
|
69
151
|
end
|
@@ -73,27 +155,34 @@ if defined?(ActionController::Base) && Oboe::Config[:action_controller][:enabled
|
|
73
155
|
if ::Rails::VERSION::MAJOR == 4
|
74
156
|
|
75
157
|
class ActionController::Base
|
76
|
-
include Oboe::Inst::
|
158
|
+
include Oboe::Inst::ActionController4
|
77
159
|
end
|
78
160
|
|
79
161
|
elsif ::Rails::VERSION::MAJOR == 3
|
80
162
|
|
81
163
|
class ActionController::Base
|
82
|
-
include Oboe::Inst::
|
164
|
+
include Oboe::Inst::ActionController3
|
83
165
|
end
|
84
166
|
|
85
167
|
elsif ::Rails::VERSION::MAJOR == 2
|
86
168
|
|
87
169
|
ActionController::Base.class_eval do
|
170
|
+
include ::Oboe::Inst::RailsBase
|
171
|
+
|
88
172
|
alias :perform_action_without_oboe :perform_action
|
89
173
|
alias :rescue_action_without_oboe :rescue_action
|
90
174
|
alias :process_without_oboe :process
|
91
175
|
alias :render_without_oboe :render
|
92
176
|
|
93
177
|
def process(*args)
|
94
|
-
Oboe::API.
|
95
|
-
|
96
|
-
|
178
|
+
Oboe::API.log_entry('rails')
|
179
|
+
process_without_oboe(*args)
|
180
|
+
|
181
|
+
rescue Exception => e
|
182
|
+
Oboe::API.log_exception(nil, e) if log_rails_error?(e)
|
183
|
+
raise
|
184
|
+
ensure
|
185
|
+
Oboe::API.log_exit('rails')
|
97
186
|
end
|
98
187
|
|
99
188
|
def perform_action(*arguments)
|
@@ -106,14 +195,19 @@ if defined?(ActionController::Base) && Oboe::Config[:action_controller][:enabled
|
|
106
195
|
end
|
107
196
|
|
108
197
|
def rescue_action(exn)
|
109
|
-
Oboe::API.log_exception(nil, exn)
|
198
|
+
Oboe::API.log_exception(nil, exn) if log_rails_error?(exn)
|
110
199
|
rescue_action_without_oboe(exn)
|
111
200
|
end
|
112
201
|
|
113
202
|
def render(options = nil, extra_options = {}, &block)
|
114
|
-
Oboe::API.
|
115
|
-
|
116
|
-
|
203
|
+
Oboe::API.log_entry('actionview')
|
204
|
+
render_without_oboe(options, extra_options, &block)
|
205
|
+
|
206
|
+
rescue Exception => e
|
207
|
+
Oboe::API.log_exception(nil, e) if log_rails_error?(e)
|
208
|
+
raise
|
209
|
+
ensure
|
210
|
+
Oboe::API.log_exit('actionview')
|
117
211
|
end
|
118
212
|
end
|
119
213
|
end
|
data/lib/oboe/version.rb
CHANGED
@@ -21,20 +21,6 @@ if defined?(Oboe::Config)
|
|
21
21
|
# Verbose output of instrumentation initialization
|
22
22
|
# Oboe::Config[:verbose] = <%= @verbose %>
|
23
23
|
|
24
|
-
#
|
25
|
-
# Resque Options
|
26
|
-
#
|
27
|
-
# :link_workers - associates Resque enqueue operations with the jobs they queue by piggybacking
|
28
|
-
# an additional argument on the Redis queue that is stripped prior to job
|
29
|
-
# processing
|
30
|
-
# !!! Note: Make sure both the enqueue side and the Resque workers are instrumented
|
31
|
-
# before enabling this or jobs will fail !!!
|
32
|
-
# (Default: false)
|
33
|
-
# Oboe::Config[:resque][:link_workers] = false
|
34
|
-
#
|
35
|
-
# Set to true to disable Resque argument logging (Default: false)
|
36
|
-
# Oboe::Config[:resque][:log_args] = false
|
37
|
-
|
38
24
|
# The oboe Ruby client has the ability to sanitize query literals
|
39
25
|
# from SQL statements. By default this is disabled. Enable to
|
40
26
|
# avoid collecting and reporting query literals to TraceView.
|
@@ -68,6 +54,17 @@ if defined?(Oboe::Config)
|
|
68
54
|
# 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
55
|
# Oboe::Config[:dnt_opts] = Regexp::IGNORECASE
|
70
56
|
|
57
|
+
#
|
58
|
+
# Rails Exception Logging
|
59
|
+
#
|
60
|
+
# In Rails, raised exceptions with rescue handlers via
|
61
|
+
# <tt>rescue_from</tt> are not reported to the TraceView
|
62
|
+
# dashboard by default. Setting this value to true will
|
63
|
+
# report all raised exception regardless.
|
64
|
+
#
|
65
|
+
# Oboe::Config[:report_rescued_errors] = false
|
66
|
+
#
|
67
|
+
|
71
68
|
#
|
72
69
|
# Enabling/Disabling Instrumentation
|
73
70
|
#
|
@@ -80,6 +77,7 @@ if defined?(Oboe::Config)
|
|
80
77
|
# Oboe::Config[:action_view][:enabled] = true
|
81
78
|
# Oboe::Config[:cassandra][:enabled] = true
|
82
79
|
# Oboe::Config[:dalli][:enabled] = true
|
80
|
+
# Oboe::Config[:em_http_request][:enabled] = true
|
83
81
|
# Oboe::Config[:faraday][:enabled] = true
|
84
82
|
# Oboe::Config[:memcache][:enabled] = true
|
85
83
|
# Oboe::Config[:memcached][:enabled] = true
|
@@ -88,7 +86,9 @@ if defined?(Oboe::Config)
|
|
88
86
|
# Oboe::Config[:nethttp][:enabled] = true
|
89
87
|
# Oboe::Config[:redis][:enabled] = true
|
90
88
|
# Oboe::Config[:resque][:enabled] = true
|
91
|
-
# Oboe::Config[:
|
89
|
+
# Oboe::Config[:sequel][:enabled] = true
|
90
|
+
# Oboe::Config[:typhoeus][:enabled] = true
|
91
|
+
#
|
92
92
|
|
93
93
|
#
|
94
94
|
# Enabling/Disabling Backtrace Collection
|
@@ -103,6 +103,7 @@ if defined?(Oboe::Config)
|
|
103
103
|
# Oboe::Config[:action_view][:collect_backtraces] = true
|
104
104
|
# Oboe::Config[:cassandra][:collect_backtraces] = true
|
105
105
|
# Oboe::Config[:dalli][:collect_backtraces] = false
|
106
|
+
# Oboe::Config[:em_http_request][:collect_backtraces] = true
|
106
107
|
# Oboe::Config[:faraday][:collect_backtraces] = false
|
107
108
|
# Oboe::Config[:memcache][:collect_backtraces] = false
|
108
109
|
# Oboe::Config[:memcached][:collect_backtraces] = false
|
@@ -111,7 +112,8 @@ if defined?(Oboe::Config)
|
|
111
112
|
# Oboe::Config[:nethttp][:collect_backtraces] = true
|
112
113
|
# Oboe::Config[:redis][:collect_backtraces] = false
|
113
114
|
# Oboe::Config[:resque][:collect_backtraces] = true
|
114
|
-
# Oboe::Config[:
|
115
|
+
# Oboe::Config[:sequel][:collect_backtraces] = true
|
116
|
+
# Oboe::Config[:typhoeus][:collect_backtraces] = false
|
115
117
|
#
|
116
118
|
|
117
119
|
#
|
@@ -123,4 +125,17 @@ if defined?(Oboe::Config)
|
|
123
125
|
# 'index#ok' => true
|
124
126
|
# }
|
125
127
|
|
128
|
+
#
|
129
|
+
# Resque Options
|
130
|
+
#
|
131
|
+
# :link_workers - associates Resque enqueue operations with the jobs they queue by piggybacking
|
132
|
+
# an additional argument on the Redis queue that is stripped prior to job
|
133
|
+
# processing
|
134
|
+
# !!! Note: Make sure both the enqueue side and the Resque workers are instrumented
|
135
|
+
# before enabling this or jobs will fail !!!
|
136
|
+
# (Default: false)
|
137
|
+
# Oboe::Config[:resque][:link_workers] = false
|
138
|
+
#
|
139
|
+
# Set to true to disable Resque argument logging (Default: false)
|
140
|
+
# Oboe::Config[:resque][:log_args] = false
|
126
141
|
end
|
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.15.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-03-
|
12
|
+
date: 2015-03-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: json
|