根据此处的文档,它只是添加了一个 Maven 模块aws-xray-recorder-sdk-aws-sdk-v2
。然后,个人客户将能够使用TracingInterceptor
.
我确实在我的 pom.xml 中添加了sdk-core
和,但sdk-v2
我EventBridgeClient
没有显示添加.addExecutionInterceptor
TracingInterceptor
添加了依赖项。
<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>
事件桥客户端
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();