lib/new_relic/agent/instrumentation/curb/instrumentation.rb in newrelic_rpm-8.9.0 vs lib/new_relic/agent/instrumentation/curb/instrumentation.rb in newrelic_rpm-8.10.0
- old
+ new
@@ -33,11 +33,11 @@
self._nr_http_verb = :PUT
yield
end
# Hook the #http method to set the verb.
- def http_with_tracing verb
+ def http_with_tracing(verb)
self._nr_http_verb = verb.to_s.upcase
yield
end
# Hook the #perform method to mark the request as non-parallel.
@@ -46,11 +46,11 @@
self._nr_serial = true
yield
end
# Record the HTTP verb for future #perform calls
- def method_with_tracing verb
+ def method_with_tracing(verb)
self._nr_http_verb = verb.upcase
yield
end
# We override this method in order to ensure access to header_str even
@@ -97,11 +97,11 @@
library: wrapped_request.type,
uri: wrapped_request.uri,
procedure: wrapped_request.method
)
- segment.add_request_headers wrapped_request
+ segment.add_request_headers(wrapped_request)
# install all callbacks
unless request._nr_instrumented
install_header_callback(request, wrapped_response)
install_completion_callback(request, wrapped_response, segment)
@@ -127,13 +127,13 @@
original_callback = request.on_header
request._nr_original_on_header = original_callback
request._nr_header_str = nil
request.on_header do |header_data|
if original_callback
- original_callback.call header_data
+ original_callback.call(header_data)
else
- wrapped_response.append_header_data header_data
+ wrapped_response.append_header_data(header_data)
header_data.length
end
end
end
@@ -141,11 +141,11 @@
def install_completion_callback(request, wrapped_response, segment)
original_callback = request.on_complete
request._nr_original_on_complete = original_callback
request.on_complete do |finished_request|
begin
- segment.process_response_headers wrapped_response
+ segment.process_response_headers(wrapped_response)
ensure
segment.finish if segment
# 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
@@ -165,11 +165,11 @@
original_callback = request.on_failure
request._nr_original_on_failure = original_callback
request.on_failure do |failed_request, error|
begin
if segment
- noticible_error = NewRelic::Agent::NoticibleError.new error[0].name, error[-1]
- segment.notice_error noticible_error
+ noticible_error = NewRelic::Agent::NoticibleError.new(error[0].name, error[-1])
+ segment.notice_error(noticible_error)
end
ensure
original_callback.call(failed_request, error) if original_callback
remove_failure_callback(failed_request)
end