|
51 | 51 | import java.util.Set;
|
52 | 52 | import java.util.logging.Level;
|
53 | 53 | import java.util.logging.Logger;
|
54 |
| -import java.util.regex.Pattern; |
55 | 54 |
|
56 | 55 | /**
|
57 | 56 | * This customizer performs the following customizations:
|
|
71 | 70 | public class AwsApplicationSignalsCustomizerProvider
|
72 | 71 | implements AutoConfigurationCustomizerProvider {
|
73 | 72 | 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$"; |
76 | 73 |
|
77 | 74 | private static final Duration DEFAULT_METRIC_EXPORT_INTERVAL = Duration.ofMinutes(1);
|
78 | 75 | private static final Logger logger =
|
@@ -124,16 +121,6 @@ static boolean isLambdaEnvironment() {
|
124 | 121 | return System.getenv(AWS_LAMBDA_FUNCTION_NAME_CONFIG) != null;
|
125 | 122 | }
|
126 | 123 |
|
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 |
| - |
137 | 124 | private boolean isApplicationSignalsEnabled(ConfigProperties configProps) {
|
138 | 125 | return configProps.getBoolean(
|
139 | 126 | APPLICATION_SIGNALS_ENABLED_CONFIG,
|
@@ -234,10 +221,6 @@ private SdkTracerProviderBuilder customizeTracerProviderBuilder(
|
234 | 221 | return tracerProviderBuilder;
|
235 | 222 | }
|
236 | 223 |
|
237 |
| - if (isXrayOtlpEndpoint(System.getenv(OTEL_EXPORTER_OTLP_TRACES_ENDPOINT_CONFIG))) { |
238 |
| - return tracerProviderBuilder; |
239 |
| - } |
240 |
| - |
241 | 224 | // Construct meterProvider
|
242 | 225 | MetricExporter metricsExporter =
|
243 | 226 | ApplicationSignalsExporterProvider.INSTANCE.createExporter(configProps);
|
@@ -303,14 +286,6 @@ private SpanExporter customizeSpanExporter(
|
303 | 286 | .build();
|
304 | 287 | }
|
305 | 288 | }
|
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 |
| - } |
314 | 289 |
|
315 | 290 | if (isApplicationSignalsEnabled(configProps)) {
|
316 | 291 | return AwsMetricAttributesSpanExporterBuilder.create(
|
|
0 commit comments