Skip to content

Commit 7a51fbd

Browse files
committed
update reference to attribute key
1 parent 3b4b367 commit 7a51fbd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

instrumentation/aws-sdk/aws-sdk-2.2/library/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/TracingExecutionInterceptor.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ final class TracingExecutionInterceptor implements ExecutionInterceptor {
4848
private static final AttributeKey<String> DB_SYSTEM = AttributeKey.stringKey("db.system");
4949
// copied from DbIncubatingAttributes.DbSystemValues
5050
private static final String DB_SYSTEM_DYNAMODB = "dynamodb";
51+
// copied from AwsIncubatingAttributes
52+
private static final AttributeKey<String> AWS_REQUEST_ID =
53+
AttributeKey.stringKey("aws.request_id");
5154

5255
// the class name is part of the attribute name, so that it will be shaded when used in javaagent
5356
// instrumentation, and won't conflict with usage outside javaagent instrumentation
@@ -361,7 +364,7 @@ public void afterExecution(
361364
private void onSdkResponse(
362365
Span span, SdkResponse response, ExecutionAttributes executionAttributes) {
363366
if (response instanceof AwsResponse) {
364-
span.setAttribute("aws.request_id", ((AwsResponse) response).responseMetadata().requestId());
367+
span.setAttribute(AWS_REQUEST_ID, ((AwsResponse) response).responseMetadata().requestId());
365368
}
366369
if (captureExperimentalSpanAttributes) {
367370
AwsSdkRequest sdkRequest = executionAttributes.getAttribute(AWS_SDK_REQUEST_ATTRIBUTE);

0 commit comments

Comments
 (0)