lib/new_relic/agent/instrumentation/curb.rb in newrelic_rpm-3.11.2.286 vs lib/new_relic/agent/instrumentation/curb.rb in newrelic_rpm-3.12.0.288
- old
+ new
@@ -122,17 +122,17 @@
# Instrument the specified +request+ (a Curl::Easy object) and set up cross-application
# tracing if it's enabled.
def hook_pending_request(request) #THREAD_LOCAL_ACCESS
wrapped_request, wrapped_response = wrap_request(request)
- state = NewRelic::Agent::TransactionState.tl_get
- t0 = Time.now
- segment = NewRelic::Agent::CrossAppTracing.start_trace(state, t0, wrapped_request)
+ state = NewRelic::Agent::TransactionState.tl_get
+ t0 = Time.now
+ node = NewRelic::Agent::CrossAppTracing.start_trace(state, t0, wrapped_request)
unless request._nr_instrumented
install_header_callback(request, wrapped_response)
- install_completion_callback(request, t0, segment, wrapped_request, wrapped_response)
+ install_completion_callback(request, t0, node, wrapped_request, wrapped_response)
request._nr_instrumented = true
end
rescue => err
NewRelic::Agent.logger.error("Untrapped exception", err)
end
@@ -161,16 +161,16 @@
end
end
end
# Install a callback that will finish the trace.
- def install_completion_callback(request, t0, segment, wrapped_request, wrapped_response) #THREAD_LOCAL_ACCESS
+ def install_completion_callback(request, t0, node, wrapped_request, wrapped_response) #THREAD_LOCAL_ACCESS
original_callback = request.on_complete
request._nr_original_on_complete = original_callback
request.on_complete do |finished_request|
begin
state = NewRelic::Agent::TransactionState.tl_get
- NewRelic::Agent::CrossAppTracing.finish_trace(state, t0, segment, wrapped_request, wrapped_response)
+ NewRelic::Agent::CrossAppTracing.finish_trace(state, t0, node, wrapped_request, wrapped_response)
ensure
# Make sure the existing completion callback is run, and restore the
# on_complete callback to how it was before.
original_callback.call(finished_request) if original_callback
remove_instrumentation_callbacks(request)