lib/new_relic/agent/instrumentation/tilt/instrumentation.rb in newrelic_rpm-9.4.2 vs lib/new_relic/agent/instrumentation/tilt/instrumentation.rb in newrelic_rpm-9.5.0
- old
+ new
@@ -4,10 +4,12 @@
module NewRelic
module Agent
module Instrumentation
module Tilt
+ INSTRUMENTATION_NAME = NewRelic::Agent.base_name(name)
+
def metric_name(klass, file)
"View/#{klass}/#{file}/Rendering"
end
# Sinatra uses #caller_locations for the file name in Tilt (unlike Rails/Rack)
@@ -19,9 +21,11 @@
rescue NoMethodError
file
end
def render_with_tracing(*args, &block)
+ NewRelic::Agent.record_instrumentation_invocation(INSTRUMENTATION_NAME)
+
begin
finishable = Tracer.start_segment(
name: metric_name(self.class, create_filename_for_metric(self.file))
)
begin