diff --git a/java/awssdk-autoconfigure/build.gradle.kts b/java/awssdk-autoconfigure/build.gradle.kts deleted file mode 100644 index ec0d651df4..0000000000 --- a/java/awssdk-autoconfigure/build.gradle.kts +++ /dev/null @@ -1,14 +0,0 @@ -// TODO(anuraaga): Move this into instrumentation repo - -plugins { - `java-library` -} - -base.archivesName = "opentelemetry-lambda-awsdk-autoconfigure" - -dependencies { - compileOnly("io.opentelemetry:opentelemetry-api") - compileOnly("software.amazon.awssdk:aws-core") - - implementation("io.opentelemetry.instrumentation:opentelemetry-aws-sdk-2.2") -} diff --git a/java/awssdk-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/AutoconfiguredTracingExecutionInterceptor.java b/java/awssdk-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/AutoconfiguredTracingExecutionInterceptor.java deleted file mode 100644 index 0b8477f9f8..0000000000 --- a/java/awssdk-autoconfigure/src/main/java/io/opentelemetry/instrumentation/awssdk/v2_2/autoconfigure/AutoconfiguredTracingExecutionInterceptor.java +++ /dev/null @@ -1,148 +0,0 @@ -/* - * Copyright The OpenTelemetry Authors - * SPDX-License-Identifier: Apache-2.0 - */ - -package io.opentelemetry.instrumentation.awssdk.v2_2.autoconfigure; - -import io.opentelemetry.api.GlobalOpenTelemetry; -import io.opentelemetry.instrumentation.api.internal.ConfigPropertiesUtil; -import io.opentelemetry.instrumentation.awssdk.v2_2.AwsSdkTelemetry; -import java.io.InputStream; -import java.nio.ByteBuffer; -import java.util.Optional; -import org.reactivestreams.Publisher; -import software.amazon.awssdk.core.SdkRequest; -import software.amazon.awssdk.core.SdkResponse; -import software.amazon.awssdk.core.async.AsyncRequestBody; -import software.amazon.awssdk.core.interceptor.Context; -import software.amazon.awssdk.core.interceptor.ExecutionAttributes; -import software.amazon.awssdk.core.interceptor.ExecutionInterceptor; -import software.amazon.awssdk.core.sync.RequestBody; -import software.amazon.awssdk.http.SdkHttpRequest; -import software.amazon.awssdk.http.SdkHttpResponse; - -/** - * A {@link ExecutionInterceptor} for use as an SPI by the AWS SDK to automatically trace all - * requests. - */ -public class AutoconfiguredTracingExecutionInterceptor implements ExecutionInterceptor { - - private static final boolean CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES = - ConfigPropertiesUtil.getBoolean( - "otel.instrumentation.aws-sdk.experimental-span-attributes", false); - - private final ExecutionInterceptor delegate = - AwsSdkTelemetry.builder(GlobalOpenTelemetry.get()) - .setCaptureExperimentalSpanAttributes(CAPTURE_EXPERIMENTAL_SPAN_ATTRIBUTES) - .build() - .createExecutionInterceptor(); - - @Override - public void beforeExecution( - Context.BeforeExecution context, ExecutionAttributes executionAttributes) { - delegate.beforeExecution(context, executionAttributes); - } - - @Override - public SdkRequest modifyRequest( - Context.ModifyRequest context, ExecutionAttributes executionAttributes) { - return delegate.modifyRequest(context, executionAttributes); - } - - @Override - public void beforeMarshalling( - Context.BeforeMarshalling context, ExecutionAttributes executionAttributes) { - delegate.beforeMarshalling(context, executionAttributes); - } - - @Override - public void afterMarshalling( - Context.AfterMarshalling context, ExecutionAttributes executionAttributes) { - delegate.afterMarshalling(context, executionAttributes); - } - - @Override - public SdkHttpRequest modifyHttpRequest( - Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { - return delegate.modifyHttpRequest(context, executionAttributes); - } - - @Override - public Optional modifyHttpContent( - Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { - return delegate.modifyHttpContent(context, executionAttributes); - } - - @Override - public Optional modifyAsyncHttpContent( - Context.ModifyHttpRequest context, ExecutionAttributes executionAttributes) { - return delegate.modifyAsyncHttpContent(context, executionAttributes); - } - - @Override - public void beforeTransmission( - Context.BeforeTransmission context, ExecutionAttributes executionAttributes) { - delegate.beforeTransmission(context, executionAttributes); - } - - @Override - public void afterTransmission( - Context.AfterTransmission context, ExecutionAttributes executionAttributes) { - delegate.afterTransmission(context, executionAttributes); - } - - @Override - public SdkHttpResponse modifyHttpResponse( - Context.ModifyHttpResponse context, ExecutionAttributes executionAttributes) { - return delegate.modifyHttpResponse(context, executionAttributes); - } - - @Override - public Optional> modifyAsyncHttpResponseContent( - Context.ModifyHttpResponse context, ExecutionAttributes executionAttributes) { - return delegate.modifyAsyncHttpResponseContent(context, executionAttributes); - } - - @Override - public Optional modifyHttpResponseContent( - Context.ModifyHttpResponse context, ExecutionAttributes executionAttributes) { - return delegate.modifyHttpResponseContent(context, executionAttributes); - } - - @Override - public void beforeUnmarshalling( - Context.BeforeUnmarshalling context, ExecutionAttributes executionAttributes) { - delegate.beforeUnmarshalling(context, executionAttributes); - } - - @Override - public void afterUnmarshalling( - Context.AfterUnmarshalling context, ExecutionAttributes executionAttributes) { - delegate.afterUnmarshalling(context, executionAttributes); - } - - @Override - public SdkResponse modifyResponse( - Context.ModifyResponse context, ExecutionAttributes executionAttributes) { - return delegate.modifyResponse(context, executionAttributes); - } - - @Override - public void afterExecution( - Context.AfterExecution context, ExecutionAttributes executionAttributes) { - delegate.afterExecution(context, executionAttributes); - } - - @Override - public Throwable modifyException( - Context.FailedExecution context, ExecutionAttributes executionAttributes) { - return delegate.modifyException(context, executionAttributes); - } - - @Override - public void onExecutionFailure( - Context.FailedExecution context, ExecutionAttributes executionAttributes) { - delegate.onExecutionFailure(context, executionAttributes); - } -} diff --git a/java/awssdk-autoconfigure/src/main/resources/software/amazon/awssdk/global/handlers/execution.interceptors b/java/awssdk-autoconfigure/src/main/resources/software/amazon/awssdk/global/handlers/execution.interceptors deleted file mode 100644 index 13d283db43..0000000000 --- a/java/awssdk-autoconfigure/src/main/resources/software/amazon/awssdk/global/handlers/execution.interceptors +++ /dev/null @@ -1 +0,0 @@ -io.opentelemetry.instrumentation.awssdk.v2_2.autoconfigure.AutoconfiguredTracingExecutionInterceptor diff --git a/java/layer-wrapper/build.gradle.kts b/java/layer-wrapper/build.gradle.kts index 062a05668d..3588898cba 100644 --- a/java/layer-wrapper/build.gradle.kts +++ b/java/layer-wrapper/build.gradle.kts @@ -3,8 +3,7 @@ plugins { } dependencies { - runtimeOnly(project(":awssdk-autoconfigure")) - + runtimeOnly("io.opentelemetry.javaagent.instrumentation:opentelemetry-javaagent-aws-sdk-2.2") runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-aws-lambda-events-3.11") runtimeOnly("io.opentelemetry:opentelemetry-exporter-logging") runtimeOnly("io.opentelemetry:opentelemetry-exporter-otlp") diff --git a/java/settings.gradle.kts b/java/settings.gradle.kts index a5ebd31d8c..6fc7da54ad 100644 --- a/java/settings.gradle.kts +++ b/java/settings.gradle.kts @@ -13,7 +13,6 @@ dependencyResolutionManagement { } } -include(":awssdk-autoconfigure") include(":dependencyManagement") include(":layer-javaagent") include(":layer-wrapper")