traceview 3.8.0 → 3.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +12 -0
- data/README.md +3 -3
- data/lib/joboe_metal.rb +4 -4
- data/lib/oboe_metal.rb +3 -3
- data/lib/traceview/api/layerinit.rb +2 -2
- data/lib/traceview/api/logging.rb +12 -12
- data/lib/traceview/api/profiling.rb +6 -6
- data/lib/traceview/api/tracing.rb +1 -1
- data/lib/traceview/api/util.rb +1 -1
- data/lib/traceview/base.rb +14 -7
- data/lib/traceview/config.rb +8 -5
- data/lib/traceview/frameworks/padrino/templates.rb +4 -4
- data/lib/traceview/frameworks/rails.rb +2 -2
- data/lib/traceview/frameworks/rails/inst/action_controller.rb +6 -2
- data/lib/traceview/frameworks/rails/inst/action_controller2.rb +4 -2
- data/lib/traceview/frameworks/rails/inst/action_controller3.rb +5 -4
- data/lib/traceview/frameworks/rails/inst/action_controller4.rb +4 -2
- data/lib/traceview/frameworks/rails/inst/action_controller5.rb +22 -11
- data/lib/traceview/frameworks/rails/inst/action_controller5_api.rb +23 -12
- data/lib/traceview/frameworks/sinatra/templates.rb +4 -4
- data/lib/traceview/inst/bunny-client.rb +8 -8
- data/lib/traceview/inst/bunny-consumer.rb +1 -1
- data/lib/traceview/inst/curb.rb +19 -19
- data/lib/traceview/inst/dalli.rb +4 -4
- data/lib/traceview/inst/delayed_job.rb +4 -4
- data/lib/traceview/inst/em-http-request.rb +6 -6
- data/lib/traceview/inst/excon.rb +18 -18
- data/lib/traceview/inst/faraday.rb +13 -13
- data/lib/traceview/inst/http.rb +12 -12
- data/lib/traceview/inst/httpclient.rb +19 -19
- data/lib/traceview/inst/memcache.rb +5 -5
- data/lib/traceview/inst/memcached.rb +4 -4
- data/lib/traceview/inst/mongo.rb +6 -6
- data/lib/traceview/inst/moped.rb +28 -28
- data/lib/traceview/inst/rack.rb +24 -24
- data/lib/traceview/inst/redis.rb +6 -6
- data/lib/traceview/inst/resque.rb +6 -6
- data/lib/traceview/inst/rest-client.rb +4 -4
- data/lib/traceview/inst/sequel.rb +12 -12
- data/lib/traceview/inst/sidekiq-client.rb +3 -3
- data/lib/traceview/inst/sidekiq-worker.rb +3 -3
- data/lib/traceview/inst/twitter-cassandra.rb +17 -17
- data/lib/traceview/inst/typhoeus.rb +13 -13
- data/lib/traceview/method_profiling.rb +2 -2
- data/lib/traceview/ruby.rb +1 -1
- data/lib/traceview/util.rb +4 -4
- data/lib/traceview/version.rb +1 -1
- data/test/frameworks/rails3x_test.rb +105 -0
- data/test/frameworks/rails4x_test.rb +97 -0
- data/test/frameworks/rails5x_api_test.rb +98 -1
- data/test/frameworks/rails5x_test.rb +99 -2
- data/test/profiling/legacy_method_profiling_test.rb +1 -1
- data/test/support/backcompat_test.rb +2 -2
- data/test/support/config_test.rb +1 -1
- metadata +2 -2
data/lib/traceview/inst/moped.rb
CHANGED
@@ -6,7 +6,7 @@ require 'json'
|
|
6
6
|
module TraceView
|
7
7
|
module Inst
|
8
8
|
module Moped
|
9
|
-
FLAVOR =
|
9
|
+
FLAVOR = :mongodb
|
10
10
|
|
11
11
|
# Moped::Database
|
12
12
|
DB_OPS = [:command, :drop]
|
@@ -62,7 +62,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
62
62
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
63
63
|
end
|
64
64
|
|
65
|
-
TraceView::API.trace(
|
65
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
66
66
|
command_without_traceview(command)
|
67
67
|
end
|
68
68
|
else
|
@@ -75,7 +75,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
75
75
|
|
76
76
|
report_kvs = extract_trace_details(:drop_database)
|
77
77
|
|
78
|
-
TraceView::API.trace(
|
78
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
79
79
|
drop_without_traceview
|
80
80
|
end
|
81
81
|
end
|
@@ -130,7 +130,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
130
130
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
131
131
|
end
|
132
132
|
|
133
|
-
TraceView::API.trace(
|
133
|
+
TraceView::API.trace(:mongo, report_kvs, :create_index) do
|
134
134
|
create_without_traceview(key, options = {})
|
135
135
|
end
|
136
136
|
end
|
@@ -142,12 +142,12 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
142
142
|
# We report :drop_indexes here to be consistent
|
143
143
|
# with other mongo implementations
|
144
144
|
report_kvs = extract_trace_details(:drop_indexes)
|
145
|
-
report_kvs[:Key] = key.nil? ?
|
145
|
+
report_kvs[:Key] = key.nil? ? :all : key.to_json
|
146
146
|
rescue StandardError => e
|
147
147
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
148
148
|
end
|
149
149
|
|
150
|
-
TraceView::API.trace(
|
150
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
151
151
|
drop_without_traceview(key = nil)
|
152
152
|
end
|
153
153
|
end
|
@@ -194,12 +194,12 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
194
194
|
|
195
195
|
begin
|
196
196
|
report_kvs = extract_trace_details(:count)
|
197
|
-
report_kvs[:Query] = selector.empty? ?
|
197
|
+
report_kvs[:Query] = selector.empty? ? :all : selector.to_json
|
198
198
|
rescue StandardError => e
|
199
199
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
200
200
|
end
|
201
201
|
|
202
|
-
TraceView::API.trace(
|
202
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
203
203
|
count_without_traceview
|
204
204
|
end
|
205
205
|
end
|
@@ -209,13 +209,13 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
209
209
|
|
210
210
|
begin
|
211
211
|
report_kvs = extract_trace_details(:sort)
|
212
|
-
report_kvs[:Query] = selector.empty? ?
|
212
|
+
report_kvs[:Query] = selector.empty? ? :all : selector.to_json
|
213
213
|
report_kvs[:Order] = sort.to_s
|
214
214
|
rescue StandardError => e
|
215
215
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
216
216
|
end
|
217
217
|
|
218
|
-
TraceView::API.trace(
|
218
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
219
219
|
sort_without_traceview(sort)
|
220
220
|
end
|
221
221
|
end
|
@@ -224,13 +224,13 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
224
224
|
if TraceView.tracing? && !TraceView.tracing_layer_op?(:explain)
|
225
225
|
begin
|
226
226
|
report_kvs = extract_trace_details(:limit)
|
227
|
-
report_kvs[:Query] = selector.empty? ?
|
227
|
+
report_kvs[:Query] = selector.empty? ? :all : selector.to_json
|
228
228
|
report_kvs[:Limit] = limit.to_s
|
229
229
|
rescue StandardError => e
|
230
230
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
231
231
|
end
|
232
232
|
|
233
|
-
TraceView::API.trace(
|
233
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
234
234
|
limit_without_traceview(limit)
|
235
235
|
end
|
236
236
|
else
|
@@ -243,13 +243,13 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
243
243
|
|
244
244
|
begin
|
245
245
|
report_kvs = extract_trace_details(:distinct)
|
246
|
-
report_kvs[:Query] = selector.empty? ?
|
246
|
+
report_kvs[:Query] = selector.empty? ? :all : selector.to_json
|
247
247
|
report_kvs[:Key] = key.to_s
|
248
248
|
rescue StandardError => e
|
249
249
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
250
250
|
end
|
251
251
|
|
252
|
-
TraceView::API.trace(
|
252
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
253
253
|
distinct_without_traceview(key)
|
254
254
|
end
|
255
255
|
end
|
@@ -264,7 +264,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
264
264
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
265
265
|
end
|
266
266
|
|
267
|
-
TraceView::API.trace(
|
267
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
268
268
|
update_without_traceview(change, flags)
|
269
269
|
end
|
270
270
|
else
|
@@ -282,7 +282,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
282
282
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
283
283
|
end
|
284
284
|
|
285
|
-
TraceView::API.trace(
|
285
|
+
TraceView::API.trace(:mongo, report_kvs, :update_all) do
|
286
286
|
update_all_without_traceview(change)
|
287
287
|
end
|
288
288
|
end
|
@@ -298,7 +298,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
298
298
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
299
299
|
end
|
300
300
|
|
301
|
-
TraceView::API.trace(
|
301
|
+
TraceView::API.trace(:mongo, report_kvs, :upsert) do
|
302
302
|
upsert_without_traceview(change)
|
303
303
|
end
|
304
304
|
end
|
@@ -308,12 +308,12 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
308
308
|
|
309
309
|
begin
|
310
310
|
report_kvs = extract_trace_details(:explain)
|
311
|
-
report_kvs[:Query] = selector.empty? ?
|
311
|
+
report_kvs[:Query] = selector.empty? ? :all : selector.to_json
|
312
312
|
rescue StandardError => e
|
313
313
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
314
314
|
end
|
315
315
|
|
316
|
-
TraceView::API.trace(
|
316
|
+
TraceView::API.trace(:mongo, report_kvs, :explain) do
|
317
317
|
explain_without_traceview
|
318
318
|
end
|
319
319
|
end
|
@@ -323,14 +323,14 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
323
323
|
|
324
324
|
begin
|
325
325
|
report_kvs = extract_trace_details(:modify)
|
326
|
-
report_kvs[:Update_Document] = selector.empty? ?
|
326
|
+
report_kvs[:Update_Document] = selector.empty? ? :all : selector.to_json
|
327
327
|
report_kvs[:Change] = change.to_json
|
328
328
|
report_kvs[:Options] = options.to_json
|
329
329
|
rescue StandardError => e
|
330
330
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
331
331
|
end
|
332
332
|
|
333
|
-
TraceView::API.trace(
|
333
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
334
334
|
modify_without_traceview(change, options)
|
335
335
|
end
|
336
336
|
end
|
@@ -345,7 +345,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
345
345
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
346
346
|
end
|
347
347
|
|
348
|
-
TraceView::API.trace(
|
348
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
349
349
|
remove_without_traceview
|
350
350
|
end
|
351
351
|
end
|
@@ -360,7 +360,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
360
360
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
361
361
|
end
|
362
362
|
|
363
|
-
TraceView::API.trace(
|
363
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
364
364
|
remove_all_without_traceview
|
365
365
|
end
|
366
366
|
end
|
@@ -409,7 +409,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
409
409
|
# with other mongo implementations
|
410
410
|
report_kvs = extract_trace_details(:drop_collection)
|
411
411
|
|
412
|
-
TraceView::API.trace(
|
412
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
413
413
|
drop_without_traceview
|
414
414
|
end
|
415
415
|
end
|
@@ -424,7 +424,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
424
424
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
425
425
|
end
|
426
426
|
|
427
|
-
TraceView::API.trace(
|
427
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
428
428
|
find_without_traceview(selector)
|
429
429
|
end
|
430
430
|
end
|
@@ -434,7 +434,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
434
434
|
|
435
435
|
report_kvs = extract_trace_details(:indexes)
|
436
436
|
|
437
|
-
TraceView::API.trace(
|
437
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
438
438
|
indexes_without_traceview
|
439
439
|
end
|
440
440
|
end
|
@@ -443,7 +443,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
443
443
|
if TraceView.tracing? && !TraceView.tracing_layer_op?(:create_index)
|
444
444
|
report_kvs = extract_trace_details(:insert)
|
445
445
|
|
446
|
-
TraceView::API.trace(
|
446
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
447
447
|
insert_without_traceview(documents, flags)
|
448
448
|
end
|
449
449
|
else
|
@@ -457,7 +457,7 @@ if defined?(::Moped) && TraceView::Config[:moped][:enabled]
|
|
457
457
|
report_kvs = extract_trace_details(:aggregate)
|
458
458
|
report_kvs[:Query] = pipeline
|
459
459
|
|
460
|
-
TraceView::API.trace(
|
460
|
+
TraceView::API.trace(:mongo, report_kvs) do
|
461
461
|
aggregate_without_traceview(pipeline)
|
462
462
|
end
|
463
463
|
end
|
data/lib/traceview/inst/rack.rb
CHANGED
@@ -16,30 +16,30 @@ module TraceView
|
|
16
16
|
report_kvs = {}
|
17
17
|
|
18
18
|
begin
|
19
|
-
report_kvs['HTTP-Host'] = req.host
|
20
|
-
report_kvs[
|
21
|
-
report_kvs[
|
19
|
+
report_kvs[:'HTTP-Host'] = req.host
|
20
|
+
report_kvs[:Port] = req.port
|
21
|
+
report_kvs[:Proto] = req.scheme
|
22
22
|
report_kvs[:Method] = req.request_method
|
23
|
-
report_kvs[
|
24
|
-
report_kvs[
|
23
|
+
report_kvs[:AJAX] = true if req.xhr?
|
24
|
+
report_kvs[:ClientIP] = req.ip
|
25
25
|
|
26
26
|
if TraceView::Config[:rack][:log_args]
|
27
|
-
report_kvs['Query-String'] = ::CGI.unescape(req.query_string) unless req.query_string.empty?
|
27
|
+
report_kvs[:'Query-String'] = ::CGI.unescape(req.query_string) unless req.query_string.empty?
|
28
28
|
end
|
29
29
|
|
30
30
|
# Report any request queue'ing headers. Report as 'Request-Start' or the summed Queue-Time
|
31
|
-
report_kvs['Request-Start'] = env['HTTP_X_REQUEST_START'] if env.key?('HTTP_X_REQUEST_START')
|
32
|
-
report_kvs['Request-Start'] = env['HTTP_X_QUEUE_START'] if env.key?('HTTP_X_QUEUE_START')
|
33
|
-
report_kvs['Queue-Time'] = env['HTTP_X_QUEUE_TIME'] if env.key?('HTTP_X_QUEUE_TIME')
|
34
|
-
|
35
|
-
report_kvs['Forwarded-For'] = env['HTTP_X_FORWARDED_FOR'] if env.key?('HTTP_X_FORWARDED_FOR')
|
36
|
-
report_kvs['Forwarded-Host'] = env['HTTP_X_FORWARDED_HOST'] if env.key?('HTTP_X_FORWARDED_HOST')
|
37
|
-
report_kvs['Forwarded-Proto'] = env['HTTP_X_FORWARDED_PROTO'] if env.key?('HTTP_X_FORWARDED_PROTO')
|
38
|
-
report_kvs['Forwarded-Port'] = env['HTTP_X_FORWARDED_PORT'] if env.key?('HTTP_X_FORWARDED_PORT')
|
39
|
-
|
40
|
-
report_kvs['Ruby.TraceView.Version'] = ::TraceView::Version::STRING
|
41
|
-
report_kvs[
|
42
|
-
report_kvs[
|
31
|
+
report_kvs[:'Request-Start'] = env['HTTP_X_REQUEST_START'] if env.key?('HTTP_X_REQUEST_START')
|
32
|
+
report_kvs[:'Request-Start'] = env['HTTP_X_QUEUE_START'] if env.key?('HTTP_X_QUEUE_START')
|
33
|
+
report_kvs[:'Queue-Time'] = env['HTTP_X_QUEUE_TIME'] if env.key?('HTTP_X_QUEUE_TIME')
|
34
|
+
|
35
|
+
report_kvs[:'Forwarded-For'] = env['HTTP_X_FORWARDED_FOR'] if env.key?('HTTP_X_FORWARDED_FOR')
|
36
|
+
report_kvs[:'Forwarded-Host'] = env['HTTP_X_FORWARDED_HOST'] if env.key?('HTTP_X_FORWARDED_HOST')
|
37
|
+
report_kvs[:'Forwarded-Proto'] = env['HTTP_X_FORWARDED_PROTO'] if env.key?('HTTP_X_FORWARDED_PROTO')
|
38
|
+
report_kvs[:'Forwarded-Port'] = env['HTTP_X_FORWARDED_PORT'] if env.key?('HTTP_X_FORWARDED_PORT')
|
39
|
+
|
40
|
+
report_kvs[:'Ruby.TraceView.Version'] = ::TraceView::Version::STRING
|
41
|
+
report_kvs[:ProcessID] = Process.pid
|
42
|
+
report_kvs[:ThreadID] = Thread.current.to_s[/0x\w*/]
|
43
43
|
rescue StandardError => e
|
44
44
|
# Discard any potential exceptions. Debug log and report whatever we can.
|
45
45
|
TraceView.logger.debug "[traceview/debug] Rack KV collection error: #{e.inspect}"
|
@@ -56,7 +56,7 @@ module TraceView
|
|
56
56
|
# instead start instrumenting from the first rack pass.
|
57
57
|
|
58
58
|
# If we're already tracing a rack layer, dont't start another one.
|
59
|
-
if TraceView.tracing? && TraceView.layer ==
|
59
|
+
if TraceView.tracing? && TraceView.layer == :rack
|
60
60
|
rack_skipped = true
|
61
61
|
TraceView.logger.debug "[traceview/rack] Rack skipped!"
|
62
62
|
return @app.call(env)
|
@@ -84,7 +84,7 @@ module TraceView
|
|
84
84
|
TraceView.has_xtrace_header = xtrace_header
|
85
85
|
TraceView.is_continued_trace = TraceView.has_incoming_context or TraceView.has_xtrace_header
|
86
86
|
|
87
|
-
TraceView::API.log_start(
|
87
|
+
TraceView::API.log_start(:rack, xtrace_header, report_kvs)
|
88
88
|
|
89
89
|
# We only trace a subset of requests based off of sample rate so if
|
90
90
|
# TraceView::API.log_start really did start a trace, we act accordingly here.
|
@@ -95,11 +95,11 @@ module TraceView
|
|
95
95
|
# This is done here so in the case of stacks that try/catch/abort
|
96
96
|
# (looking at you Grape) we're sure the KVs get reported now as
|
97
97
|
# this code may not be returned to later.
|
98
|
-
TraceView::API.log_info(
|
98
|
+
TraceView::API.log_info(:rack, report_kvs)
|
99
99
|
|
100
100
|
status, headers, response = @app.call(env)
|
101
101
|
|
102
|
-
xtrace = TraceView::API.log_end(
|
102
|
+
xtrace = TraceView::API.log_end(:rack, :Status => status)
|
103
103
|
else
|
104
104
|
status, headers, response = @app.call(env)
|
105
105
|
end
|
@@ -107,8 +107,8 @@ module TraceView
|
|
107
107
|
[status, headers, response]
|
108
108
|
rescue Exception => e
|
109
109
|
unless rack_skipped
|
110
|
-
TraceView::API.log_exception(
|
111
|
-
xtrace = TraceView::API.log_end(
|
110
|
+
TraceView::API.log_exception(:rack, e)
|
111
|
+
xtrace = TraceView::API.log_end(:rack, :Status => 500)
|
112
112
|
end
|
113
113
|
raise
|
114
114
|
ensure
|
data/lib/traceview/inst/redis.rb
CHANGED
@@ -222,17 +222,17 @@ module TraceView
|
|
222
222
|
#
|
223
223
|
def call_with_traceview(command, &block)
|
224
224
|
if TraceView.tracing?
|
225
|
-
::TraceView::API.log_entry(
|
225
|
+
::TraceView::API.log_entry(:redis, {})
|
226
226
|
|
227
227
|
begin
|
228
228
|
r = call_without_traceview(command, &block)
|
229
229
|
report_kvs = extract_trace_details(command, r)
|
230
230
|
r
|
231
231
|
rescue StandardError => e
|
232
|
-
::TraceView::API.log_exception(
|
232
|
+
::TraceView::API.log_exception(:redis, e)
|
233
233
|
raise
|
234
234
|
ensure
|
235
|
-
::TraceView::API.log_exit(
|
235
|
+
::TraceView::API.log_exit(:redis, report_kvs)
|
236
236
|
end
|
237
237
|
|
238
238
|
else
|
@@ -250,17 +250,17 @@ module TraceView
|
|
250
250
|
# back on exit (a limitation of the TraceView::API.trace
|
251
251
|
# block method) This removes the need for an info
|
252
252
|
# event to send additonal KVs
|
253
|
-
::TraceView::API.log_entry(
|
253
|
+
::TraceView::API.log_entry(:redis, {})
|
254
254
|
|
255
255
|
report_kvs = extract_pipeline_details(pipeline)
|
256
256
|
|
257
257
|
begin
|
258
258
|
call_pipeline_without_traceview(pipeline)
|
259
259
|
rescue StandardError => e
|
260
|
-
::TraceView::API.log_exception(
|
260
|
+
::TraceView::API.log_exception(:redis, e)
|
261
261
|
raise
|
262
262
|
ensure
|
263
|
-
::TraceView::API.log_exit(
|
263
|
+
::TraceView::API.log_exit(:redis, report_kvs)
|
264
264
|
end
|
265
265
|
else
|
266
266
|
call_pipeline_without_traceview(pipeline)
|
@@ -45,7 +45,7 @@ module TraceView
|
|
45
45
|
if TraceView.tracing?
|
46
46
|
report_kvs = extract_trace_details(:enqueue, klass, args)
|
47
47
|
|
48
|
-
TraceView::API.trace('resque-client', report_kvs, :enqueue) do
|
48
|
+
TraceView::API.trace(:'resque-client', report_kvs, :enqueue) do
|
49
49
|
enqueue_without_traceview(klass, *args)
|
50
50
|
end
|
51
51
|
else
|
@@ -58,7 +58,7 @@ module TraceView
|
|
58
58
|
report_kvs = extract_trace_details(:enqueue_to, klass, args)
|
59
59
|
report_kvs[:Queue] = queue.to_s if queue
|
60
60
|
|
61
|
-
TraceView::API.trace('resque-client', report_kvs) do
|
61
|
+
TraceView::API.trace(:'resque-client', report_kvs) do
|
62
62
|
enqueue_to_without_traceview(queue, klass, *args)
|
63
63
|
end
|
64
64
|
else
|
@@ -70,7 +70,7 @@ module TraceView
|
|
70
70
|
if TraceView.tracing?
|
71
71
|
report_kvs = extract_trace_details(:dequeue, klass, args)
|
72
72
|
|
73
|
-
TraceView::API.trace('resque-client', report_kvs) do
|
73
|
+
TraceView::API.trace(:'resque-client', report_kvs) do
|
74
74
|
dequeue_without_traceview(klass, *args)
|
75
75
|
end
|
76
76
|
else
|
@@ -96,7 +96,7 @@ module TraceView
|
|
96
96
|
# Set these keys for the ability to separate out
|
97
97
|
# background tasks into a separate app on the server-side UI
|
98
98
|
|
99
|
-
report_kvs['HTTP-Host'] = Socket.gethostname
|
99
|
+
report_kvs[:'HTTP-Host'] = Socket.gethostname
|
100
100
|
report_kvs[:Controller] = "Resque_#{job.queue}"
|
101
101
|
report_kvs[:Action] = job.payload['class'].to_s
|
102
102
|
report_kvs[:URL] = "/resque/#{job.queue}/#{job.payload['class']}"
|
@@ -117,7 +117,7 @@ module TraceView
|
|
117
117
|
TraceView.logger.debug "[traceview/debug] #{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}" if TraceView::Config[:verbose]
|
118
118
|
end
|
119
119
|
|
120
|
-
TraceView::API.start_trace('resque-worker', nil, report_kvs) do
|
120
|
+
TraceView::API.start_trace(:'resque-worker', nil, report_kvs) do
|
121
121
|
perform_without_traceview(job)
|
122
122
|
end
|
123
123
|
end
|
@@ -130,7 +130,7 @@ module TraceView
|
|
130
130
|
|
131
131
|
def fail_with_traceview(exception)
|
132
132
|
if TraceView.tracing?
|
133
|
-
TraceView::API.log_exception(
|
133
|
+
TraceView::API.log_exception(:resque, exception)
|
134
134
|
end
|
135
135
|
fail_without_traceview(exception)
|
136
136
|
end
|
@@ -15,16 +15,16 @@ module TraceView
|
|
15
15
|
#
|
16
16
|
def execute_with_traceview & block
|
17
17
|
kvs = {}
|
18
|
-
kvs[
|
19
|
-
TraceView::API.log_entry('rest-client', kvs)
|
18
|
+
kvs[:Backtrace] = TraceView::API.backtrace if TraceView::Config[:rest_client][:collect_backtraces]
|
19
|
+
TraceView::API.log_entry(:'rest-client', kvs)
|
20
20
|
|
21
21
|
# The core rest-client call
|
22
22
|
execute_without_traceview(&block)
|
23
23
|
rescue => e
|
24
|
-
TraceView::API.log_exception('rest-client', e)
|
24
|
+
TraceView::API.log_exception(:'rest-client', e)
|
25
25
|
raise e
|
26
26
|
ensure
|
27
|
-
TraceView::API.log_exit('rest-client')
|
27
|
+
TraceView::API.log_exit(:'rest-client')
|
28
28
|
end
|
29
29
|
end
|
30
30
|
end
|
@@ -53,33 +53,33 @@ module TraceView
|
|
53
53
|
def run_with_traceview(sql, opts=::Sequel::OPTS)
|
54
54
|
kvs = extract_trace_details(sql, opts)
|
55
55
|
|
56
|
-
TraceView::API.log_entry(
|
56
|
+
TraceView::API.log_entry(:sequel, kvs)
|
57
57
|
|
58
58
|
run_without_traceview(sql, opts)
|
59
59
|
rescue => e
|
60
|
-
TraceView::API.log_exception(
|
60
|
+
TraceView::API.log_exception(:sequel, e)
|
61
61
|
raise e
|
62
62
|
ensure
|
63
|
-
TraceView::API.log_exit(
|
63
|
+
TraceView::API.log_exit(:sequel)
|
64
64
|
end
|
65
65
|
|
66
66
|
def exec_with_traceview(method, sql, opts=::Sequel::OPTS, &block)
|
67
67
|
kvs = extract_trace_details(sql, opts)
|
68
68
|
|
69
|
-
TraceView::API.log_entry(
|
69
|
+
TraceView::API.log_entry(:sequel, kvs)
|
70
70
|
|
71
71
|
send(method, sql, opts, &block)
|
72
72
|
rescue => e
|
73
|
-
TraceView::API.log_exception(
|
73
|
+
TraceView::API.log_exception(:sequel, e)
|
74
74
|
raise e
|
75
75
|
ensure
|
76
|
-
TraceView::API.log_exit(
|
76
|
+
TraceView::API.log_exit(:sequel)
|
77
77
|
end
|
78
78
|
|
79
79
|
def execute_ddl_with_traceview(sql, opts=::Sequel::OPTS, &block)
|
80
80
|
# If we're already tracing a sequel operation, then this call likely came
|
81
81
|
# from Sequel::Dataset. In this case, just pass it on.
|
82
|
-
return execute_ddl_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(
|
82
|
+
return execute_ddl_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(:sequel)
|
83
83
|
|
84
84
|
exec_with_traceview(:execute_ddl_without_traceview, sql, opts, &block)
|
85
85
|
end
|
@@ -87,7 +87,7 @@ module TraceView
|
|
87
87
|
def execute_dui_with_traceview(sql, opts=::Sequel::OPTS, &block)
|
88
88
|
# If we're already tracing a sequel operation, then this call likely came
|
89
89
|
# from Sequel::Dataset. In this case, just pass it on.
|
90
|
-
return execute_dui_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(
|
90
|
+
return execute_dui_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(:sequel)
|
91
91
|
|
92
92
|
exec_with_traceview(:execute_dui_without_traceview, sql, opts, &block)
|
93
93
|
end
|
@@ -95,7 +95,7 @@ module TraceView
|
|
95
95
|
def execute_insert_with_traceview(sql, opts=::Sequel::OPTS, &block)
|
96
96
|
# If we're already tracing a sequel operation, then this call likely came
|
97
97
|
# from Sequel::Dataset. In this case, just pass it on.
|
98
|
-
return execute_insert_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(
|
98
|
+
return execute_insert_without_traceview(sql, opts, &block) if TraceView.tracing_layer?(:sequel)
|
99
99
|
|
100
100
|
exec_with_traceview(:execute_insert_without_traceview, sql, opts, &block)
|
101
101
|
end
|
@@ -113,14 +113,14 @@ module TraceView
|
|
113
113
|
def exec_with_traceview(method, sql, opts=::Sequel::OPTS, &block)
|
114
114
|
kvs = extract_trace_details(sql, opts)
|
115
115
|
|
116
|
-
TraceView::API.log_entry(
|
116
|
+
TraceView::API.log_entry(:sequel, kvs)
|
117
117
|
|
118
118
|
send(method, sql, opts, &block)
|
119
119
|
rescue => e
|
120
|
-
TraceView::API.log_exception(
|
120
|
+
TraceView::API.log_exception(:sequel, e)
|
121
121
|
raise e
|
122
122
|
ensure
|
123
|
-
TraceView::API.log_exit(
|
123
|
+
TraceView::API.log_exit(:sequel)
|
124
124
|
end
|
125
125
|
|
126
126
|
def execute_with_traceview(sql, opts=::Sequel::OPTS, &block)
|