lib/new_relic/agent/instrumentation/memcache/dalli.rb in newrelic_rpm-6.9.0.363 vs lib/new_relic/agent/instrumentation/memcache/dalli.rb in newrelic_rpm-6.10.0.364
- old
+ new
@@ -64,11 +64,13 @@
operation: SEND_MULTIGET_METRIC_NAME
)
::NewRelic::Agent::Instrumentation::Memcache::Dalli.assign_instance_to(segment, self)
begin
- send_multiget_without_newrelic_trace(keys)
+ NewRelic::Agent::Tracer.capture_segment_error segment do
+ send_multiget_without_newrelic_trace(keys)
+ end
ensure
if ::NewRelic::Agent.config[:capture_memcache_keys]
segment.notice_nosql_statement "#{SEND_MULTIGET_METRIC_NAME} #{keys.inspect}"
end
segment.finish if segment
@@ -85,10 +87,12 @@
alias_method method_name_without, method_name
define_method method_name do |*args, &block|
segment = NewRelic::Agent::Tracer.start_segment name: "Ruby/Memcached/Dalli/#{method_name}"
begin
- __send__ method_name_without, *args, &block
+ NewRelic::Agent::Tracer.capture_segment_error segment do
+ __send__ method_name_without, *args, &block
+ end
ensure
segment.finish if segment
end
end