Skip to content

Commit 4d65752

Browse files
authored
Revert SigV4 Authentication support for http exporter (#1019) (#1040)
*Description of changes:* This reverts SigV4 Exporter added in PR #1019 as it is unstable and is blocking the current Java V2 release By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent d107f08 commit 4d65752

File tree

4 files changed

+1
-399
lines changed

4 files changed

+1
-399
lines changed

awsagentprovider/build.gradle.kts

+1-4
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,9 @@ dependencies {
4141
// Import AWS SDK v1 core for ARN parsing utilities
4242
implementation("com.amazonaws:aws-java-sdk-core:1.12.773")
4343
// Export configuration
44-
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
44+
compileOnly("io.opentelemetry:opentelemetry-exporter-otlp")
4545
// For Udp emitter
4646
compileOnly("io.opentelemetry:opentelemetry-exporter-otlp-common")
47-
// For HTTP SigV4 emitter
48-
implementation("software.amazon.awssdk:auth:2.30.14")
49-
implementation("software.amazon.awssdk:http-auth-aws:2.30.14")
5047

5148
testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
5249
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/AwsApplicationSignalsCustomizerProvider.java

-25
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
import java.util.Set;
5252
import java.util.logging.Level;
5353
import java.util.logging.Logger;
54-
import java.util.regex.Pattern;
5554

5655
/**
5756
* This customizer performs the following customizations:
@@ -71,8 +70,6 @@
7170
public class AwsApplicationSignalsCustomizerProvider
7271
implements AutoConfigurationCustomizerProvider {
7372
static final String AWS_LAMBDA_FUNCTION_NAME_CONFIG = "AWS_LAMBDA_FUNCTION_NAME";
74-
private static final String XRAY_OTLP_ENDPOINT_PATTERN =
75-
"^https://xray\\.([a-z0-9-]+)\\.amazonaws\\.com/v1/traces$";
7673

7774
private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration.ofMinutes(1);
7875
private static final Logger logger =
@@ -124,16 +121,6 @@ static boolean isLambdaEnvironment() {
124121
return System.getenv(AWS_LAMBDA_FUNCTION_NAME_CONFIG) != null;
125122
}
126123

127-
static boolean isXrayOtlpEndpoint(String otlpEndpoint) {
128-
if (otlpEndpoint == null) {
129-
return false;
130-
}
131-
132-
return Pattern.compile(XRAY_OTLP_ENDPOINT_PATTERN)
133-
.matcher(otlpEndpoint.toLowerCase())
134-
.matches();
135-
}
136-
137124
private boolean isApplicationSignalsEnabled(ConfigProperties configProps) {
138125
return configProps.getBoolean(
139126
APPLICATION_SIGNALS_ENABLED_CONFIG,
@@ -234,10 +221,6 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
234221
return tracerProviderBuilder;
235222
}
236223

237-
if (isXrayOtlpEndpoint(System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG))) {
238-
return tracerProviderBuilder;
239-
}
240-
241224
// Construct meterProvider
242225
MetricExporter metricsExporter =
243226
ApplicationSignalsExporterProvider.INSTANCE.createExporter(configProps);
@@ -303,14 +286,6 @@ private SpanExporter customizeSpanExporter(
303286
.build();
304287
}
305288
}
306-
// When running OTLP endpoint for X-Ray backend, use custom exporter for SigV4 authentication
307-
else if (spanExporter instanceof OtlpHttpSpanExporter
308-
&& isXrayOtlpEndpoint(System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG))) {
309-
spanExporter =
310-
new OtlpAwsSpanExporter(
311-
(OtlpHttpSpanExporter) spanExporter,
312-
System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG));
313-
}
314289

315290
if (isApplicationSignalsEnabled(configProps)) {
316291
return AwsMetricAttributesSpanExporterBuilder.create(

awsagentprovider/src/main/java/software/amazon/opentelemetry/javaagent/providers/OtlpAwsSpanExporter.java

-159
This file was deleted.

0 commit comments

Comments
 (0)