diff --git a/instrumentation/aws-lambda/aws-lambda-core-1.0/testing/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AbstractAwsLambdaTest.java b/instrumentation/aws-lambda/aws-lambda-core-1.0/testing/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AbstractAwsLambdaTest.java index 25a32896aad5..65948ac56e2a 100644 --- a/instrumentation/aws-lambda/aws-lambda-core-1.0/testing/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AbstractAwsLambdaTest.java +++ b/instrumentation/aws-lambda/aws-lambda-core-1.0/testing/src/main/java/io/opentelemetry/instrumentation/awslambdacore/v1_0/AbstractAwsLambdaTest.java @@ -12,8 +12,6 @@ import com.amazonaws.services.lambda.runtime.Context; import com.amazonaws.services.lambda.runtime.RequestHandler; -import io.opentelemetry.api.common.AttributeKey; -import io.opentelemetry.api.common.Attributes; import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; import io.opentelemetry.sdk.trace.data.StatusData; @@ -22,7 +20,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; -import org.junitpioneer.jupiter.SetEnvironmentVariable; import org.mockito.Mock; import org.mockito.junit.jupiter.MockitoExtension; @@ -90,39 +87,4 @@ void handlerTracedWithException() { .hasAttributesSatisfyingExactly( equalTo(SemanticAttributes.FAAS_INVOCATION_ID, "1-22-333")))); } - - @Test - @SetEnvironmentVariable( - key = "_X_AMZN_TRACE_ID", - value = "Root=1-8a3c60f7-d188f8fa79d48a391a778fa6;Parent=0000000000000456;Sampled=1") - void handlerLinksToInfrastructureTrace() { - String result = handler().handleRequest("hello", context); - assertThat(result).isEqualTo("world"); - - testing() - .waitAndAssertTraces( - trace -> - trace.hasSpansSatisfyingExactly( - span -> - span.hasName("my_function") - .hasKind(SpanKind.SERVER) - .hasLinksSatisfying( - links -> - assertThat(links) - .singleElement() - .satisfies( - link -> { - assertThat(link.getSpanContext().getTraceId()) - .isEqualTo("8a3c60f7d188f8fa79d48a391a778fa6"); - assertThat(link.getSpanContext().getSpanId()) - .isEqualTo("0000000000000456"); - assertThat(link.getAttributes()) - .isEqualTo( - Attributes.of( - AttributeKey.stringKey("source"), - "x-ray-env")); - })) - .hasAttributesSatisfyingExactly( - equalTo(SemanticAttributes.FAAS_INVOCATION_ID, "1-22-333")))); - } }