Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions awsagentprovider/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,9 @@ dependencies {
// Import AWS SDK v1 core for ARN parsing utilities
implementation("com.amazonaws:aws-java-sdk-core:1.12.773")
// Export configuration
implementation("io.opentelemetry:opentelemetry-exporter-otlp")
compileOnly("io.opentelemetry:opentelemetry-exporter-otlp")
// For Udp emitter
compileOnly("io.opentelemetry:opentelemetry-exporter-otlp-common")
// For HTTP SigV4 emitter
implementation("software.amazon.awssdk:auth:2.30.14")
implementation("software.amazon.awssdk:http-auth-aws:2.30.14")

testImplementation("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
testImplementation("io.opentelemetry:opentelemetry-sdk-testing")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import java.util.Set;
import java.util.logging.Level;
import java.util.logging.Logger;
import java.util.regex.Pattern;

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

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

static boolean isXrayOtlpEndpoint(String otlpEndpoint) {
if (otlpEndpoint == null) {
return false;
}

return Pattern.compile(XRAY_OTLP_ENDPOINT_PATTERN)
.matcher(otlpEndpoint.toLowerCase())
.matches();
}

private boolean isApplicationSignalsEnabled(ConfigProperties configProps) {
return configProps.getBoolean(
APPLICATION_SIGNALS_ENABLED_CONFIG,
Expand Down Expand Up @@ -234,10 +221,6 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
return tracerProviderBuilder;
}

if (isXrayOtlpEndpoint(System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG))) {
return tracerProviderBuilder;
}

// Construct meterProvider
MetricExporter metricsExporter =
ApplicationSignalsExporterProvider.INSTANCE.createExporter(configProps);
Expand Down Expand Up @@ -303,14 +286,6 @@ private SpanExporter customizeSpanExporter(
.build();
}
}
// When running OTLP endpoint for X-Ray backend, use custom exporter for SigV4 authentication
else if (spanExporter instanceof OtlpHttpSpanExporter
&& isXrayOtlpEndpoint(System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG))) {
spanExporter =
new OtlpAwsSpanExporter(
(OtlpHttpSpanExporter) spanExporter,
System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG));
}

if (isApplicationSignalsEnabled(configProps)) {
return AwsMetricAttributesSpanExporterBuilder.create(
Expand Down

This file was deleted.

Loading
Loading