From 55ed14f7e06a7d4dcad3c6e46483c5f5367e1a13 Mon Sep 17 00:00:00 2001 From: Tanna McClure Date: Tue, 24 Jan 2023 10:21:52 -0800 Subject: [PATCH] fix for frozen segment name in action mailer --- .../agent/instrumentation/action_mailer_subscriber.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/new_relic/agent/instrumentation/action_mailer_subscriber.rb b/lib/new_relic/agent/instrumentation/action_mailer_subscriber.rb index 3446034a31..646a2790f8 100644 --- a/lib/new_relic/agent/instrumentation/action_mailer_subscriber.rb +++ b/lib/new_relic/agent/instrumentation/action_mailer_subscriber.rb @@ -53,7 +53,7 @@ def finish_segment(id, payload) return unless segment if segment.name.match?(UNKNOWN_MAILER) && payload.key?(:mailer) - segment.name.sub!(UNKNOWN_MAILER, "#{BASE_NAME}/#{payload[:mailer]}/") + segment.name = segment.name.sub(UNKNOWN_MAILER, "#{BASE_NAME}/#{payload[:mailer]}/") end PAYLOAD_KEYS.each do |key| @@ -72,6 +72,7 @@ def notice_exception(segment, payload) def metric_name(name, payload) mailer = payload[:mailer] || UNKNOWN + # binding.irb if mailer == 'Unknown' method = method_from_name(name) "#{BASE_NAME}/#{mailer}/#{method}" end