Skip to content

Commit 886f7d1

Browse files
committed
Update beforeExecution logic
1 parent 7fb9a7e commit 886f7d1

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

core/aws-core/src/main/java/software/amazon/awssdk/awscore/interceptor/TraceIdExecutionInterceptor.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ public class TraceIdExecutionInterceptor implements ExecutionInterceptor {
3939

4040
@Override
4141
public void beforeExecution(Context.BeforeExecution context, ExecutionAttributes executionAttributes) {
42-
String traceId = SdkInternalThreadLocal.get(CONCURRENT_TRACE_ID_KEY);
43-
if (traceId != null && lambdaFunctionNameEnvironmentVariable().isPresent()) {
44-
executionAttributes.putAttribute(TRACE_ID, traceId);
42+
if(lambdaFunctionNameEnvironmentVariable().isPresent()) {
43+
String traceId = SdkInternalThreadLocal.get(CONCURRENT_TRACE_ID_KEY);
44+
if (traceId != null) {
45+
executionAttributes.putAttribute(TRACE_ID, traceId);
46+
}
4547
}
4648
}
4749

utils-lite/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<parent>
2222
<groupId>software.amazon.awssdk</groupId>
2323
<artifactId>aws-sdk-java-pom</artifactId>
24-
<version>2.33.9-SNAPSHOT</version>
24+
<version>2.33.10-SNAPSHOT</version>
2525
</parent>
2626
<artifactId>utils-lite</artifactId>
2727
<name>AWS Java SDK :: Utils Lite</name>

0 commit comments

Comments
 (0)