As per the documentation here, its just adding a maven module aws-xray-recorder-sdk-aws-sdk-v2
. Then individual clients will be able to do x-ray tracing using TracingInterceptor
.
I did add both sdk-core
and sdk-v2
in my pom.xml, but my EventBridgeClient
is not showing addExecutionInterceptor
to add the TracingInterceptor
.
Dependencies added.
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-xray-recorder-sdk-aws-sdk-v2</artifactId>
<version>2.8.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-xray-recorder-sdk-core</artifactId>
<version>2.8.0</version>
</dependency>
EventBridge Client
return EventBridgeClient.builder()
.region(Region.of(System.getenv("AWS_REGION")))
.credentialsProvider(EnvironmentVariableCredentialsProvider.create())
.overrideConfiguration(
ClientOverrideConfiguration.builder()
.apiCallAttemptTimeout(Duration.ofSeconds(1))
.retryPolicy(RetryPolicy.builder().numRetries(10).build())
.build())
.httpClientBuilder(UrlConnectionHttpClient.builder())
.build();