Skip to content

Commit

Permalink
Merge pull request #2870 from navidemad/dev
Browse files Browse the repository at this point in the history
Safety guard when the self.class is not responding to method identifier
  • Loading branch information
fallwith authored Sep 30, 2024
2 parents d3bd85e + df71498 commit 3063ea8
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3063ea8

Please sign in to comment.