|
10 | 10 | import io.opentelemetry.context.propagation.TextMapPropagator;
|
11 | 11 | import io.opentelemetry.instrumentation.api.instrumenter.Instrumenter;
|
12 | 12 | import io.opentelemetry.instrumentation.awssdk.v2_2.internal.AwsSdkInstrumenterFactory;
|
| 13 | +import io.opentelemetry.instrumentation.awssdk.v2_2.internal.BedrockRuntimeImpl; |
13 | 14 | import io.opentelemetry.instrumentation.awssdk.v2_2.internal.Response;
|
14 | 15 | import io.opentelemetry.instrumentation.awssdk.v2_2.internal.SqsImpl;
|
15 | 16 | import io.opentelemetry.instrumentation.awssdk.v2_2.internal.SqsProcessRequest;
|
|
21 | 22 | import software.amazon.awssdk.core.client.config.ClientOverrideConfiguration;
|
22 | 23 | import software.amazon.awssdk.core.interceptor.ExecutionAttributes;
|
23 | 24 | import software.amazon.awssdk.core.interceptor.ExecutionInterceptor;
|
| 25 | +import software.amazon.awssdk.services.bedrockruntime.BedrockRuntimeAsyncClient; |
24 | 26 | import software.amazon.awssdk.services.sqs.SqsAsyncClient;
|
25 | 27 | import software.amazon.awssdk.services.sqs.SqsClient;
|
26 | 28 |
|
|
29 | 31 | * ExecutionInterceptor} returned by {@link #newExecutionInterceptor()} with an SDK client to have
|
30 | 32 | * all requests traced.
|
31 | 33 | *
|
| 34 | + * <p>Certain services additionally require wrapping the SDK client itself: |
| 35 | + * |
| 36 | + * <ul> |
| 37 | + * <li>SQSClient - {@link #wrap(SqsClient)} |
| 38 | + * <li>SQSAsyncClient - {@link #wrap(SqsAsyncClient)} |
| 39 | + * <li>BedrockRuntimeAsyncClient - {@link #wrapBedrockRuntimeClient(BedrockRuntimeAsyncClient)} |
| 40 | + * </ul> |
| 41 | + * |
32 | 42 | * <pre>{@code
|
33 | 43 | * DynamoDbClient dynamoDb = DynamoDbClient.builder()
|
34 | 44 | * .overrideConfiguration(ClientOverrideConfiguration.builder()
|
@@ -134,4 +144,14 @@ public SqsClient wrap(SqsClient sqsClient) {
|
134 | 144 | public SqsAsyncClient wrap(SqsAsyncClient sqsClient) {
|
135 | 145 | return SqsImpl.wrap(sqsClient);
|
136 | 146 | }
|
| 147 | + |
| 148 | + /** |
| 149 | + * Construct a new tracing-enabled {@link BedrockRuntimeAsyncClient} using the provided {@link |
| 150 | + * BedrockRuntimeAsyncClient} instance. |
| 151 | + */ |
| 152 | + @NoMuzzle |
| 153 | + public BedrockRuntimeAsyncClient wrapBedrockRuntimeClient( |
| 154 | + BedrockRuntimeAsyncClient bedrockClient) { |
| 155 | + return BedrockRuntimeImpl.wrap(bedrockClient); |
| 156 | + } |
137 | 157 | }
|
0 commit comments