From df7149839b709f252848c73b017ff15c397ce68a Mon Sep 17 00:00:00 2001 From: Navid EMAD Date: Sat, 28 Sep 2024 18:46:13 +0200 Subject: [PATCH] Safety check in instrumentation render_in_with_tracing that identifier to self.class --- .../agent/instrumentation/view_component/instrumentation.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb b/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb index 71488ca9d0..3005214c36 100644 --- a/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb +++ b/lib/new_relic/agent/instrumentation/view_component/instrumentation.rb @@ -11,7 +11,10 @@ def render_in_with_tracing(*args) begin segment = NewRelic::Agent::Tracer.start_segment( - name: metric_name(self.class.identifier, self.class.name) + name: metric_name( + self.class.respond_to?(:identifier) ? self.class.identifier : nil, + self.class.name + ) ) yield rescue => e