diff --git a/bom/pom.xml b/bom/pom.xml
index 7a19f5693..2f2df040d 100644
--- a/bom/pom.xml
+++ b/bom/pom.xml
@@ -27,6 +27,11 @@
aws-crt
${awscrt.version}
+
+ io.opentelemetry.instrumentation
+ opentelemetry-aws-sdk-2.2
+ ${awsotel.version}
+
io.quarkiverse.amazonservices
quarkus-amazon-crt
@@ -57,6 +62,16 @@
quarkus-amazon-common-deployment
${project.version}
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-opentelemetry-internal
+ ${project.version}
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-opentelemetry-internal-deployment
+ ${project.version}
+
io.quarkiverse.amazonservices
quarkus-amazon-apache-client-internal
diff --git a/cognito-user-pools/deployment/src/main/java/io/quarkus/amazon/cognitouserpools/deployment/CognitoUserPoolsProcessor.java b/cognito-user-pools/deployment/src/main/java/io/quarkus/amazon/cognitouserpools/deployment/CognitoUserPoolsProcessor.java
index a6d846727..2f6d97c62 100644
--- a/cognito-user-pools/deployment/src/main/java/io/quarkus/amazon/cognitouserpools/deployment/CognitoUserPoolsProcessor.java
+++ b/cognito-user-pools/deployment/src/main/java/io/quarkus/amazon/cognitouserpools/deployment/CognitoUserPoolsProcessor.java
@@ -21,10 +21,12 @@
import io.quarkus.amazon.common.runtime.AmazonClientAwsCrtTransportRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientCommonRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientNettyTransportRecorder;
+import io.quarkus.amazon.common.runtime.AmazonClientOpenTelemetryRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientUrlConnectionTransportRecorder;
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
+import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
@@ -156,7 +158,9 @@ void setupAwsCrtAsyncTransport(List amazonClients, Cognit
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void createClientBuilders(CognitoUserPoolsRecorder recorder,
+ Capabilities capabilities,
AmazonClientCommonRecorder commonRecorder,
+ AmazonClientOpenTelemetryRecorder otelRecorder,
List syncTransports,
List asyncTransports,
BuildProducer syntheticBeans,
@@ -164,8 +168,10 @@ void createClientBuilders(CognitoUserPoolsRecorder recorder,
BuildProducer clientAsync,
ExecutorBuildItem executorBuildItem) {
- createClientBuilders(recorder,
+ createClientBuilders(capabilities,
+ recorder,
commonRecorder,
+ otelRecorder,
buildTimeConfig,
syncTransports,
asyncTransports,
diff --git a/common/deployment-opentelemetry-internal/pom.xml b/common/deployment-opentelemetry-internal/pom.xml
new file mode 100644
index 000000000..c550bd792
--- /dev/null
+++ b/common/deployment-opentelemetry-internal/pom.xml
@@ -0,0 +1,42 @@
+
+
+ 4.0.0
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-common-parent
+ 999-SNAPSHOT
+
+
+ quarkus-amazon-opentelemetry-internal-deployment
+ Quarkus - Amazon Services - Apache Client - Internal - Deployment
+ This module only exists to house opentelemetry-aws-sdk-2.2 as a conditional dependency
+
+
+
+ io.quarkus
+ quarkus-core-deployment
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-opentelemetry-internal
+
+
+
+
+
+
+ maven-compiler-plugin
+
+
+
+ io.quarkus
+ quarkus-extension-processor
+ ${quarkus.version}
+
+
+
+
+
+
+
diff --git a/common/deployment/pom.xml b/common/deployment/pom.xml
index cc7d486ac..457598487 100644
--- a/common/deployment/pom.xml
+++ b/common/deployment/pom.xml
@@ -24,6 +24,16 @@
io.quarkiverse.amazonservices
quarkus-amazon-common
+
+ io.opentelemetry.instrumentation
+ opentelemetry-aws-sdk-2.2
+ true
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-opentelemetry-internal-deployment
+ true
+
io.quarkiverse.amazonservices
quarkus-amazon-netty-client-internal-deployment
diff --git a/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AbstractAmazonServiceProcessor.java b/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AbstractAmazonServiceProcessor.java
index 3b3524ff8..2009d43a7 100644
--- a/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AbstractAmazonServiceProcessor.java
+++ b/common/deployment/src/main/java/io/quarkus/amazon/common/deployment/AbstractAmazonServiceProcessor.java
@@ -8,15 +8,18 @@
import jakarta.enterprise.context.ApplicationScoped;
+import org.jboss.jandex.ClassType;
import org.jboss.jandex.DotName;
import org.jboss.jandex.ParameterizedType;
import org.jboss.jandex.Type;
import io.netty.channel.EventLoopGroup;
+import io.opentelemetry.api.OpenTelemetry;
import io.quarkus.amazon.common.runtime.AmazonClientApacheTransportRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientAwsCrtTransportRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientCommonRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientNettyTransportRecorder;
+import io.quarkus.amazon.common.runtime.AmazonClientOpenTelemetryRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientUrlConnectionTransportRecorder;
import io.quarkus.amazon.common.runtime.AsyncHttpClientBuildTimeConfig;
@@ -31,6 +34,8 @@
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
import io.quarkus.arc.processor.DotNames;
import io.quarkus.arc.processor.InjectionPointInfo;
+import io.quarkus.deployment.Capabilities;
+import io.quarkus.deployment.Capability;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.builditem.ExecutorBuildItem;
import io.quarkus.deployment.builditem.ExtensionSslNativeSupportBuildItem;
@@ -216,8 +221,11 @@ protected void createAwsCrtAsyncTransportBuilder(List ama
});
}
- protected void createClientBuilders(AmazonClientRecorder recorder,
+ protected void createClientBuilders(
+ Capabilities capabilities,
+ AmazonClientRecorder recorder,
AmazonClientCommonRecorder commonRecorder,
+ AmazonClientOpenTelemetryRecorder otelRecorder,
HasSdkBuildTimeConfig sdkBuildConfig,
List syncTransports,
List asyncTransports,
@@ -234,7 +242,9 @@ protected void createClientBuilders(AmazonClientRecorder recorder,
presignerBuilder = recorder.createPresignerBuilder();
}
- createClientBuilders(commonRecorder,
+ createClientBuilders(capabilities,
+ commonRecorder,
+ otelRecorder,
recorder.getAwsConfig(),
recorder.getSdkConfig(),
sdkBuildConfig,
@@ -253,7 +263,9 @@ protected void createClientBuilders(AmazonClientRecorder recorder,
}
private void createClientBuilders(
+ Capabilities capabilities,
AmazonClientCommonRecorder recorder,
+ AmazonClientOpenTelemetryRecorder otelRecorder,
RuntimeValue awsConfigRuntime,
RuntimeValue sdkConfigRuntime,
HasSdkBuildTimeConfig sdkBuildConfig,
@@ -294,25 +306,47 @@ private void createClientBuilders(
: null;
ScheduledExecutorService sharedExecutorService = executorBuildItem.getExecutorProxy();
+ var addOpenTelemetry = sdkBuildConfig.sdk().telemetry().orElse(false)
+ && capabilities.isPresent(Capability.OPENTELEMETRY_TRACER);
if (syncClientBuilder != null) {
syncClientBuilder = recorder.configure(syncClientBuilder, awsConfigRuntime, sdkConfigRuntime,
sdkBuildConfig, sharedExecutorService, configName());
- syntheticBeans.produce(SyntheticBeanBuildItem.configure(syncClientBuilderClass)
- .setRuntimeInit()
- .scope(ApplicationScoped.class)
- .runtimeValue(syncClientBuilder)
- .done());
+ if (addOpenTelemetry) {
+ syntheticBeans.produce(SyntheticBeanBuildItem
+ .configure(syncClientBuilderClass)
+ .defaultBean()
+ .scope(ApplicationScoped.class)
+ .setRuntimeInit()
+ .createWith(otelRecorder.configure(syncClientBuilder))
+ .addInjectionPoint(ClassType.create(OpenTelemetry.class)).done());
+ } else {
+ syntheticBeans.produce(SyntheticBeanBuildItem.configure(syncClientBuilderClass)
+ .setRuntimeInit()
+ .scope(ApplicationScoped.class)
+ .runtimeValue(syncClientBuilder)
+ .done());
+ }
clientSync.produce(new AmazonClientSyncResultBuildItem(configName));
}
if (asyncClientBuilder != null) {
asyncClientBuilder = recorder.configure(asyncClientBuilder, awsConfigRuntime, sdkConfigRuntime,
sdkBuildConfig, sharedExecutorService, configName());
- syntheticBeans.produce(SyntheticBeanBuildItem.configure(asyncClientBuilderClass)
- .setRuntimeInit()
- .scope(ApplicationScoped.class)
- .runtimeValue(asyncClientBuilder)
- .done());
+ if (addOpenTelemetry) {
+ syntheticBeans.produce(SyntheticBeanBuildItem
+ .configure(asyncClientBuilderClass)
+ .defaultBean()
+ .scope(ApplicationScoped.class)
+ .setRuntimeInit()
+ .createWith(otelRecorder.configure(asyncClientBuilder))
+ .addInjectionPoint(ClassType.create(OpenTelemetry.class)).done());
+ } else {
+ syntheticBeans.produce(SyntheticBeanBuildItem.configure(asyncClientBuilderClass)
+ .setRuntimeInit()
+ .scope(ApplicationScoped.class)
+ .runtimeValue(asyncClientBuilder)
+ .done());
+ }
clientAsync.produce(new AmazonClientAsyncResultBuildItem(configName));
}
if (presignerBuilder != null) {
diff --git a/common/pom.xml b/common/pom.xml
index e025deb8f..ef6037fc3 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -17,12 +17,14 @@
runtime-apache-client-internal
runtime-netty-client-internal
runtime-crt-client-internal
+ runtime-opentelemetry-internal
runtime
deployment-devservices-spi
deployment-spi
deployment-apache-client-internal
deployment-netty-client-internal
deployment-crt-client-internal
+ deployment-opentelemetry-internal
deployment
diff --git a/common/runtime-opentelemetry-internal/pom.xml b/common/runtime-opentelemetry-internal/pom.xml
new file mode 100644
index 000000000..dfe04d1f0
--- /dev/null
+++ b/common/runtime-opentelemetry-internal/pom.xml
@@ -0,0 +1,60 @@
+
+
+ 4.0.0
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-common-parent
+ 999-SNAPSHOT
+
+
+ quarkus-amazon-opentelemetry-internal
+ Quarkus - Amazon Services - OpenTelemetry - Runtime - Internal
+ This module only exists to house opentelemetry-aws-sdk-2.2 as a conditional dependency
+
+
+
+ io.quarkus
+ quarkus-core
+
+
+ io.opentelemetry.instrumentation
+ opentelemetry-aws-sdk-2.2
+
+
+
+
+
+
+ io.quarkus
+ quarkus-extension-maven-plugin
+ ${quarkus.version}
+
+
+ process-resources
+
+ extension-descriptor
+
+
+
+ io.quarkus:quarkus-opentelemetry
+
+
+
+
+
+
+ maven-compiler-plugin
+
+
+
+ io.quarkus
+ quarkus-extension-processor
+ ${quarkus.version}
+
+
+
+
+
+
+
diff --git a/common/runtime/pom.xml b/common/runtime/pom.xml
index 3375f0e5a..9d2299021 100644
--- a/common/runtime/pom.xml
+++ b/common/runtime/pom.xml
@@ -37,6 +37,16 @@
software.amazon.awssdk
auth
+
+ io.opentelemetry.instrumentation
+ opentelemetry-aws-sdk-2.2
+ true
+
+
+ io.quarkiverse.amazonservices
+ quarkus-amazon-opentelemetry-internal
+ true
+
software.amazon.awssdk
http-client-spi
diff --git a/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/AmazonClientOpenTelemetryRecorder.java b/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/AmazonClientOpenTelemetryRecorder.java
new file mode 100644
index 000000000..a5b8e0d4b
--- /dev/null
+++ b/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/AmazonClientOpenTelemetryRecorder.java
@@ -0,0 +1,32 @@
+package io.quarkus.amazon.common.runtime;
+
+import java.util.function.Function;
+
+import io.opentelemetry.api.OpenTelemetry;
+import io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdkTelemetry;
+import io.quarkus.arc.SyntheticCreationalContext;
+import io.quarkus.runtime.RuntimeValue;
+import io.quarkus.runtime.annotations.Recorder;
+import software.amazon.awssdk.awscore.client.builder.AwsClientBuilder;
+
+@Recorder
+public class AmazonClientOpenTelemetryRecorder {
+
+ public Function, AwsClientBuilder> configure(
+ RuntimeValue clientBuilder) {
+ return new Function, AwsClientBuilder>() {
+ @Override
+ public AwsClientBuilder apply(SyntheticCreationalContext context) {
+ AwsClientBuilder builder = clientBuilder.getValue();
+ OpenTelemetry openTelemetry = context.getInjectedReference(OpenTelemetry.class);
+
+ builder.overrideConfiguration(
+ builder.overrideConfiguration().toBuilder()
+ .addExecutionInterceptor(AwsSdkTelemetry.create(openTelemetry).newExecutionInterceptor())
+ .build());
+
+ return builder;
+ }
+ };
+ }
+}
diff --git a/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/SdkBuildTimeConfig.java b/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/SdkBuildTimeConfig.java
index 7fa6a83c6..4e8b2b107 100644
--- a/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/SdkBuildTimeConfig.java
+++ b/common/runtime/src/main/java/io/quarkus/amazon/common/runtime/SdkBuildTimeConfig.java
@@ -3,7 +3,9 @@
import java.util.List;
import java.util.Optional;
+import io.quarkus.runtime.annotations.ConfigDocDefault;
import io.quarkus.runtime.annotations.ConfigGroup;
+import io.smallrye.config.WithName;
/**
* AWS SDK specific configurations
@@ -21,4 +23,11 @@ public interface SdkBuildTimeConfig {
* @see software.amazon.awssdk.core.interceptor.ExecutionInterceptor
*/
Optional> interceptors(); // cannot be classes as can be runtime initialized (e.g. XRay interceptor)
+
+ /**
+ * OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+ */
+ @WithName("telemetry.enabled")
+ @ConfigDocDefault("false")
+ Optional telemetry();
}
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-cognitouserpools.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-cognitouserpools.adoc
index ac227f08c..ae47f825c 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-cognitouserpools.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-cognitouserpools.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-cognitouserpools_quarkus.cognito-user-pools.telemetry.enabled]]`link:#quarkus-amazon-cognitouserpools_quarkus.cognito-user-pools.telemetry.enabled[quarkus.cognito-user-pools.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_COGNITO_USER_POOLS_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_COGNITO_USER_POOLS_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-cognitouserpools_quarkus.cognito-user-pools.sync-client.type]]`link:#quarkus-amazon-cognitouserpools_quarkus.cognito-user-pools.sync-client.type[quarkus.cognito-user-pools.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-dynamodb.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-dynamodb.adoc
index 4b37942e8..a58d5b1fc 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-dynamodb.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-dynamodb.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-dynamodb_quarkus.dynamodb.telemetry.enabled]]`link:#quarkus-amazon-dynamodb_quarkus.dynamodb.telemetry.enabled[quarkus.dynamodb.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_DYNAMODB_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_DYNAMODB_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-dynamodb_quarkus.dynamodb.sync-client.type]]`link:#quarkus-amazon-dynamodb_quarkus.dynamodb.sync-client.type[quarkus.dynamodb.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-iam.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-iam.adoc
index 13f648b4f..c58bc8e27 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-iam.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-iam.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-iam_quarkus.iam.telemetry.enabled]]`link:#quarkus-amazon-iam_quarkus.iam.telemetry.enabled[quarkus.iam.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_IAM_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_IAM_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-iam_quarkus.iam.sync-client.type]]`link:#quarkus-amazon-iam_quarkus.iam.sync-client.type[quarkus.iam.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-kms.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-kms.adoc
index 7435c1715..19cec52f1 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-kms.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-kms.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-kms_quarkus.kms.telemetry.enabled]]`link:#quarkus-amazon-kms_quarkus.kms.telemetry.enabled[quarkus.kms.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_KMS_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_KMS_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-kms_quarkus.kms.sync-client.type]]`link:#quarkus-amazon-kms_quarkus.kms.sync-client.type[quarkus.kms.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-lambda.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-lambda.adoc
index 4b53e2c3b..1296633e9 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-lambda.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-lambda.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-lambda_quarkus.lambda.telemetry.enabled]]`link:#quarkus-amazon-lambda_quarkus.lambda.telemetry.enabled[quarkus.lambda.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_LAMBDA_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_LAMBDA_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-lambda_quarkus.lambda.sync-client.type]]`link:#quarkus-amazon-lambda_quarkus.lambda.sync-client.type[quarkus.lambda.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-s3.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-s3.adoc
index 1a066039e..086f5061f 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-s3.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-s3.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-s3_quarkus.s3.telemetry.enabled]]`link:#quarkus-amazon-s3_quarkus.s3.telemetry.enabled[quarkus.s3.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_S3_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_S3_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-s3_quarkus.s3.sync-client.type]]`link:#quarkus-amazon-s3_quarkus.s3.sync-client.type[quarkus.s3.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-secretsmanager.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-secretsmanager.adoc
index 0ad7f337a..fdfbd7047 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-secretsmanager.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-secretsmanager.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-secretsmanager_quarkus.secretsmanager.telemetry.enabled]]`link:#quarkus-amazon-secretsmanager_quarkus.secretsmanager.telemetry.enabled[quarkus.secretsmanager.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_SECRETSMANAGER_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_SECRETSMANAGER_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-secretsmanager_quarkus.secretsmanager.sync-client.type]]`link:#quarkus-amazon-secretsmanager_quarkus.secretsmanager.sync-client.type[quarkus.secretsmanager.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-ses.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-ses.adoc
index a44eeaf03..9175a7292 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-ses.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-ses.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-ses_quarkus.ses.telemetry.enabled]]`link:#quarkus-amazon-ses_quarkus.ses.telemetry.enabled[quarkus.ses.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_SES_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_SES_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-ses_quarkus.ses.sync-client.type]]`link:#quarkus-amazon-ses_quarkus.ses.sync-client.type[quarkus.ses.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-sns.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-sns.adoc
index b2ec005ed..8f342f29d 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-sns.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-sns.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sns_quarkus.sns.telemetry.enabled]]`link:#quarkus-amazon-sns_quarkus.sns.telemetry.enabled[quarkus.sns.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_SNS_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_SNS_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sns_quarkus.sns.sync-client.type]]`link:#quarkus-amazon-sns_quarkus.sns.sync-client.type[quarkus.sns.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-sqs.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-sqs.adoc
index 907b6855f..9c112f3d9 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-sqs.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-sqs.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sqs_quarkus.sqs.telemetry.enabled]]`link:#quarkus-amazon-sqs_quarkus.sqs.telemetry.enabled[quarkus.sqs.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_SQS_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_SQS_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sqs_quarkus.sqs.sync-client.type]]`link:#quarkus-amazon-sqs_quarkus.sqs.sync-client.type[quarkus.sqs.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-ssm.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-ssm.adoc
index 4c9a15454..4ab1c355a 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-ssm.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-ssm.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-ssm_quarkus.ssm.telemetry.enabled]]`link:#quarkus-amazon-ssm_quarkus.ssm.telemetry.enabled[quarkus.ssm.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_SSM_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_SSM_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-ssm_quarkus.ssm.sync-client.type]]`link:#quarkus-amazon-ssm_quarkus.ssm.sync-client.type[quarkus.ssm.sync-client.type]`
diff --git a/docs/modules/ROOT/pages/includes/quarkus-amazon-sts.adoc b/docs/modules/ROOT/pages/includes/quarkus-amazon-sts.adoc
index 3b80cb936..f5fd0895c 100644
--- a/docs/modules/ROOT/pages/includes/quarkus-amazon-sts.adoc
+++ b/docs/modules/ROOT/pages/includes/quarkus-amazon-sts.adoc
@@ -29,6 +29,23 @@ endif::add-copy-button-to-env-var[]
|
+a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sts_quarkus.sts.telemetry.enabled]]`link:#quarkus-amazon-sts_quarkus.sts.telemetry.enabled[quarkus.sts.telemetry.enabled]`
+
+
+[.description]
+--
+OpenTelemetry AWS SDK instrumentation will be enabled if the OpenTelemetry extension is present and this value is true.
+
+ifdef::add-copy-button-to-env-var[]
+Environment variable: env_var_with_copy_button:+++QUARKUS_STS_TELEMETRY_ENABLED+++[]
+endif::add-copy-button-to-env-var[]
+ifndef::add-copy-button-to-env-var[]
+Environment variable: `+++QUARKUS_STS_TELEMETRY_ENABLED+++`
+endif::add-copy-button-to-env-var[]
+--|boolean
+|`false`
+
+
a|icon:lock[title=Fixed at build time] [[quarkus-amazon-sts_quarkus.sts.sync-client.type]]`link:#quarkus-amazon-sts_quarkus.sts.sync-client.type[quarkus.sts.sync-client.type]`
diff --git a/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java b/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java
index a056beac4..a9c5bdc09 100644
--- a/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java
+++ b/dynamodb/deployment/src/main/java/io/quarkus/amazon/dynamodb/deployment/DynamodbProcessor.java
@@ -18,6 +18,7 @@
import io.quarkus.amazon.common.runtime.AmazonClientAwsCrtTransportRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientCommonRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientNettyTransportRecorder;
+import io.quarkus.amazon.common.runtime.AmazonClientOpenTelemetryRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientUrlConnectionTransportRecorder;
import io.quarkus.amazon.dynamodb.runtime.DynamodbBuildTimeConfig;
import io.quarkus.amazon.dynamodb.runtime.DynamodbClientProducer;
@@ -25,6 +26,7 @@
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
+import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
@@ -162,7 +164,9 @@ void setupAwsCrtAsyncTransport(List amazonClients, Dynamo
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void createClientBuilders(DynamodbRecorder recorder,
+ Capabilities capabilities,
AmazonClientCommonRecorder commonRecorder,
+ AmazonClientOpenTelemetryRecorder otelRecorder,
List syncTransports,
List asyncTransports,
BuildProducer syntheticBeans,
@@ -170,8 +174,10 @@ void createClientBuilders(DynamodbRecorder recorder,
BuildProducer clientAsync,
ExecutorBuildItem executorBuildItem) {
- createClientBuilders(recorder,
+ createClientBuilders(capabilities,
+ recorder,
commonRecorder,
+ otelRecorder,
buildTimeConfig,
syncTransports,
asyncTransports,
diff --git a/iam/deployment/src/main/java/io/quarkus/amazon/iam/deployment/IamProcessor.java b/iam/deployment/src/main/java/io/quarkus/amazon/iam/deployment/IamProcessor.java
index 9e9d40f28..3c524cf7e 100644
--- a/iam/deployment/src/main/java/io/quarkus/amazon/iam/deployment/IamProcessor.java
+++ b/iam/deployment/src/main/java/io/quarkus/amazon/iam/deployment/IamProcessor.java
@@ -18,6 +18,7 @@
import io.quarkus.amazon.common.runtime.AmazonClientAwsCrtTransportRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientCommonRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientNettyTransportRecorder;
+import io.quarkus.amazon.common.runtime.AmazonClientOpenTelemetryRecorder;
import io.quarkus.amazon.common.runtime.AmazonClientUrlConnectionTransportRecorder;
import io.quarkus.amazon.iam.runtime.IamBuildTimeConfig;
import io.quarkus.amazon.iam.runtime.IamClientProducer;
@@ -25,6 +26,7 @@
import io.quarkus.arc.deployment.AdditionalBeanBuildItem;
import io.quarkus.arc.deployment.BeanRegistrationPhaseBuildItem;
import io.quarkus.arc.deployment.SyntheticBeanBuildItem;
+import io.quarkus.deployment.Capabilities;
import io.quarkus.deployment.annotations.BuildProducer;
import io.quarkus.deployment.annotations.BuildStep;
import io.quarkus.deployment.annotations.ExecutionTime;
@@ -153,7 +155,9 @@ void setupAwsCrtAsyncTransport(List amazonClients, IamRec
@BuildStep
@Record(ExecutionTime.RUNTIME_INIT)
void createClientBuilders(IamRecorder recorder,
+ Capabilities capabilities,
AmazonClientCommonRecorder commonRecorder,
+ AmazonClientOpenTelemetryRecorder otelRecorder,
List syncTransports,
List asyncTransports,
BuildProducer syntheticBeans,
@@ -161,8 +165,10 @@ void createClientBuilders(IamRecorder recorder,
BuildProducer clientAsync,
ExecutorBuildItem executorBuildItem) {
- createClientBuilders(recorder,
+ createClientBuilders(capabilities,
+ recorder,
commonRecorder,
+ otelRecorder,
buildTimeConfig,
syncTransports,
asyncTransports,
diff --git a/integration-tests/pom.xml b/integration-tests/pom.xml
index b62e66183..5333804fe 100644
--- a/integration-tests/pom.xml
+++ b/integration-tests/pom.xml
@@ -20,6 +20,10 @@
io.quarkus
quarkus-resteasy-reactive
+
+ io.quarkus
+ quarkus-resteasy-reactive-jackson
+
io.quarkus
quarkus-core
@@ -76,13 +80,22 @@
io.quarkiverse.amazonservices
quarkus-amazon-cognito-user-pools
-
+
+ io.quarkus
+ quarkus-opentelemetry
+
org.jboss.slf4j
slf4j-jboss-logmanager
provided
+
+
+ io.opentelemetry
+ opentelemetry-sdk-testing
+
+
io.quarkus
@@ -105,6 +118,7 @@
2.2.0
test
+
@@ -223,4 +237,4 @@
-
\ No newline at end of file
+
diff --git a/integration-tests/src/main/java/io/quarkus/it/amazon/opentelemetry/ExporterResource.java b/integration-tests/src/main/java/io/quarkus/it/amazon/opentelemetry/ExporterResource.java
new file mode 100644
index 000000000..14197b416
--- /dev/null
+++ b/integration-tests/src/main/java/io/quarkus/it/amazon/opentelemetry/ExporterResource.java
@@ -0,0 +1,46 @@
+package io.quarkus.it.amazon.opentelemetry;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+import jakarta.enterprise.context.ApplicationScoped;
+import jakarta.enterprise.inject.Produces;
+import jakarta.inject.Inject;
+import jakarta.inject.Singleton;
+import jakarta.ws.rs.GET;
+import jakarta.ws.rs.Path;
+import jakarta.ws.rs.core.Response;
+
+import io.opentelemetry.sdk.testing.exporter.InMemorySpanExporter;
+import io.opentelemetry.sdk.trace.data.SpanData;
+
+@Path("")
+public class ExporterResource {
+ @Inject
+ InMemorySpanExporter inMemorySpanExporter;
+
+ @GET
+ @Path("/export")
+ public List export() {
+ return inMemorySpanExporter.getFinishedSpanItems()
+ .stream()
+ .filter(sd -> !sd.getName().contains("export") && !sd.getName().contains("reset"))
+ .collect(Collectors.toList());
+ }
+
+ @GET
+ @Path("/reset")
+ public Response reset() {
+ inMemorySpanExporter.reset();
+ return Response.ok().build();
+ }
+
+ @ApplicationScoped
+ static class InMemorySpanExporterProducer {
+ @Produces
+ @Singleton
+ InMemorySpanExporter inMemorySpanExporter() {
+ return InMemorySpanExporter.create();
+ }
+ }
+}
\ No newline at end of file
diff --git a/integration-tests/src/main/resources/application.properties b/integration-tests/src/main/resources/application.properties
index 6197ec7e1..fa70edc1f 100644
--- a/integration-tests/src/main/resources/application.properties
+++ b/integration-tests/src/main/resources/application.properties
@@ -35,4 +35,7 @@ quarkus.ses.async-client.type=${async-client.type}
quarkus.sns.async-client.type=${async-client.type}
quarkus.sqs.async-client.type=${async-client.type}
quarkus.ssm.async-client.type=${async-client.type}
-quarkus.sts.async-client.type=${async-client.type}
\ No newline at end of file
+quarkus.sts.async-client.type=${async-client.type}
+
+
+quarkus.s3.telemetry.enabled=true
\ No newline at end of file
diff --git a/integration-tests/src/test/java/io/quarkus/it/amazon/AmazonOpenTelemetryTest.java b/integration-tests/src/test/java/io/quarkus/it/amazon/AmazonOpenTelemetryTest.java
new file mode 100644
index 000000000..78d115d6f
--- /dev/null
+++ b/integration-tests/src/test/java/io/quarkus/it/amazon/AmazonOpenTelemetryTest.java
@@ -0,0 +1,77 @@
+package io.quarkus.it.amazon;
+
+import static java.net.HttpURLConnection.HTTP_OK;
+import static java.util.concurrent.TimeUnit.SECONDS;
+import static org.awaitility.Awaitility.await;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+
+import java.time.Duration;
+import java.util.List;
+import java.util.Map;
+
+import org.awaitility.Awaitility;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
+
+import io.quarkus.test.junit.QuarkusTest;
+import io.restassured.RestAssured;
+import io.restassured.common.mapper.TypeRef;
+
+@QuarkusTest
+public class AmazonOpenTelemetryTest {
+
+ @BeforeEach
+ @AfterEach
+ void reset() {
+ RestAssured.when().get("/test/reset").then().statusCode(HTTP_OK);
+ await().atMost(30, SECONDS).until(() -> {
+ // make sure spans are cleared
+ List