lib/oboe/api/tracing.rb in oboe-1.3.4 vs lib/oboe/api/tracing.rb in oboe-1.3.5
- old
+ new
@@ -8,11 +8,11 @@
# Public: Trace a given block of code. Detect any exceptions thrown by
# the block and report errors.
#
# layer - The layer the block of code belongs to.
# opts - A hash containing key/value pairs that will be reported along
- # with the first event of this layer (optional).
+ # with the first event of this layer (optional).
#
# Example
#
# def computation(n)
# fib(n)
@@ -26,32 +26,32 @@
# end
#
# result = computation_with_oboe(1000)
#
# Returns the result of the block.
- def trace(layer, opts={})
- log_entry(layer, opts)
+ def trace(layer, opts={}, protect_op=false)
+ log_entry(layer, opts, protect_op)
begin
yield
rescue Exception => e
log_exception(layer, e)
raise
ensure
- log_exit(layer)
+ log_exit(layer, {}, protect_op)
end
end
-
+
# Public: Trace a given block of code which can start a trace depending
# on configuration and probability. Detect any exceptions thrown by the
# block and report errors.
#
# When start_trace returns control to the calling context, the oboe
# context will be cleared.
#
# layer - The layer the block of code belongs to.
# opts - A hash containing key/value pairs that will be reported along
- # with the first event of this layer (optional).
+ # with the first event of this layer (optional).
#
# Example
#
# def handle_request(request, response)
# # ... code that modifies request and response ...
@@ -87,18 +87,18 @@
# Public: Trace a given block of code which can start a trace depending
# on configuration and probability. Detect any exceptions thrown by the
# block and report errors. Insert the oboe metadata into the provided for
# later user.
- #
+ #
# The motivating use case for this is HTTP streaming in rails3. We need
# access to the exit event's trace id so we can set the header before any
# work is done, and before any headers are sent back to the client.
#
# layer - The layer the block of code belongs to.
# target - The target object in which to place the oboe metadata.
# opts - A hash containing key/value pairs that will be reported along
- # with the first event of this layer (optional).
+ # with the first event of this layer (optional).
#
# Example:
#
# def handle_request(request, response)
# # ... code that does something with request and response ...