From 9a6ce1cf1122595175c3c357865541841deaf447 Mon Sep 17 00:00:00 2001 From: thomasduncan Date: Fri, 22 Dec 2023 09:05:09 -0800 Subject: [PATCH] Use internalSet from AttributesExtractorUtil in AWS SDK v1 SnsAttributesExtractor. --- .../awssdk/v1_11/SnsAttributesExtractor.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SnsAttributesExtractor.java b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SnsAttributesExtractor.java index ca7ea4e2f662..f376b01d0232 100644 --- a/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SnsAttributesExtractor.java +++ b/instrumentation/aws-sdk/aws-sdk-1.11/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v1_11/SnsAttributesExtractor.java @@ -11,6 +11,7 @@ import io.opentelemetry.api.common.AttributesBuilder; import io.opentelemetry.context.Context; import io.opentelemetry.instrumentation.api.instrumenter.AttributesExtractor; +import io.opentelemetry.instrumentation.api.internal.AttributesExtractorUtil; import io.opentelemetry.semconv.SemanticAttributes; import javax.annotation.Nullable; @@ -18,9 +19,8 @@ public class SnsAttributesExtractor implements AttributesExtractor, R @Override public void onStart(AttributesBuilder attributes, Context parentContext, Request request) { String destination = findMessageDestination(request.getOriginalRequest()); - if (destination != null) { - attributes.put(SemanticAttributes.MESSAGING_DESTINATION_NAME, destination); - } + AttributesExtractorUtil.internalSet(attributes, SemanticAttributes.MESSAGING_DESTINATION_NAME, + destination); } /*