From 7d648221edd4419e8fb53b3d00f6edb633cef411 Mon Sep 17 00:00:00 2001 From: fallwith Date: Fri, 1 Nov 2024 17:03:47 -0700 Subject: [PATCH] aws-sdk-lambda: DRY up region fetch don't attempt to determine the region twice within a single method and simply re-use the result of the single call --- .../agent/instrumentation/aws_sdk_lambda/instrumentation.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb b/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb index c28fca6908..4fa56ce765 100644 --- a/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb +++ b/lib/new_relic/agent/instrumentation/aws_sdk_lambda/instrumentation.rb @@ -79,7 +79,7 @@ def generate_segment(action, options = {}) segment = NewRelic::Agent::Tracer.start_external_request_segment( library: INSTRUMENTATION_NAME, - uri: "https://lambda.#{aws_region || 'unknown-region'}.amazonaws.com", + uri: "https://lambda.#{region || 'unknown-region'}.amazonaws.com", procedure: action ) segment.name = "External/Lambda/#{action}/#{function}"