From e186d9be37e66fbcc77e58de70504ff7f38b9117 Mon Sep 17 00:00:00 2001 From: Michael Ashton Date: Fri, 12 Sep 2025 11:43:03 -0400 Subject: [PATCH] Safely access :request_method on bandit start events 82a0b1e added a path in which [:bandit, :server, :start] events missing `Plug.Conn` could propagate downstream withouth the `:request_id` attribute. A dot-style accessor for `:request_method` downstream causes processes to crash, reporting the error in the New Relic Agent rather than the bandit error which caused the initial event. --- lib/new_relic/transaction/complete.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/transaction/complete.ex b/lib/new_relic/transaction/complete.ex index 8d11077..7404e80 100644 --- a/lib/new_relic/transaction/complete.ex +++ b/lib/new_relic/transaction/complete.ex @@ -619,7 +619,7 @@ defmodule NewRelic.Transaction.Complete do transaction_name: Util.metric_join(["WebTransaction", tx_attrs.name]), agent_attributes: %{ http_response_code: tx_attrs[:status], - request_method: tx_attrs.request_method + request_method: tx_attrs[:request_method] }, user_attributes: Map.merge(attributes, %{