Skip to content

Commit 50ae35b

Browse files
committed
remove lambda remote service override configuration
1 parent a8da0be commit 50ae35b

File tree

1 file changed

+5
-9
lines changed

1 file changed

+5
-9
lines changed

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsMetricAttributeGenerator.java

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -530,17 +530,13 @@ private static void setRemoteResourceTypeAndIdentifier(SpanData span, Attributes
530530
// More context in PR:
531531
// https://github.com/aws-observability/aws-otel-python-instrumentation/pull/319
532532
//
533-
// NOTE: The environment variables LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE and
534-
// LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT were introduced as part of this fix.
535-
// They are optional and allow users to override the default values if needed.
533+
// NOTE: The environment variables LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT was
534+
// introduced as part of this fix.
535+
// It is optional and allows users to override the default value if needed.
536536
if ("Invoke".equals(getRemoteOperation(span, RPC_METHOD))) {
537537
String remoteService =
538-
Optional.ofNullable(System.getenv("LAMBDA_APPLICATION_SIGNALS_REMOTE_SERVICE"))
539-
.filter(s -> !s.isEmpty())
540-
.orElse(span.getAttributes().get(AWS_LAMBDA_NAME));
541-
if (remoteService != null) {
542-
builder.put(AWS_REMOTE_SERVICE, remoteService);
543-
}
538+
getLambdaFunctionNameFromArn(
539+
Optional.ofNullable(escapeDelimiters(span.getAttributes().get(AWS_LAMBDA_NAME))));
544540

545541
String remoteEnvironment =
546542
Optional.ofNullable(System.getenv("LAMBDA_APPLICATION_SIGNALS_REMOTE_ENVIRONMENT"))

0 commit comments

Comments
 (0)