Skip to content

Commit

Permalink
Use internalSet from AttributesExtractorUtil in AWS SDK v1 SnsAttribu…
Browse files Browse the repository at this point in the history
…tesExtractor.
  • Loading branch information
tduncan committed Dec 22, 2023
1 parent 62cc322 commit 9a6ce1c
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
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;

public class SnsAttributesExtractor implements AttributesExtractor<Request<?>, Response<?>> {
@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);
}

/*
Expand Down

0 comments on commit 9a6ce1c

Please sign in to comment.