From aac502cea4265854ebfbbfdce44116a463028ef4 Mon Sep 17 00:00:00 2001 From: Lauri Tulmin Date: Thu, 12 May 2022 08:58:50 +0300 Subject: [PATCH] GraphQL: verify that span has error status when operation failed (#6011) --- .../instrumentation/graphql/AbstractGraphqlTest.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/instrumentation/graphql-java-12.0/testing/src/main/java/io/opentelemetry/instrumentation/graphql/AbstractGraphqlTest.java b/instrumentation/graphql-java-12.0/testing/src/main/java/io/opentelemetry/instrumentation/graphql/AbstractGraphqlTest.java index 7c2bc3354784..140d8adc273c 100644 --- a/instrumentation/graphql-java-12.0/testing/src/main/java/io/opentelemetry/instrumentation/graphql/AbstractGraphqlTest.java +++ b/instrumentation/graphql-java-12.0/testing/src/main/java/io/opentelemetry/instrumentation/graphql/AbstractGraphqlTest.java @@ -23,6 +23,7 @@ import io.opentelemetry.api.trace.SpanKind; import io.opentelemetry.instrumentation.testing.junit.InstrumentationExtension; import io.opentelemetry.sdk.testing.assertj.AttributeAssertion; +import io.opentelemetry.sdk.trace.data.StatusData; import java.io.IOException; import java.io.InputStreamReader; import java.io.Reader; @@ -198,6 +199,7 @@ void parseError() { .hasKind(SpanKind.INTERNAL) .hasNoParent() .hasAttributesSatisfying(Attributes::isEmpty) + .hasStatus(StatusData.error()) .hasEventsSatisfyingExactly( event -> event @@ -243,6 +245,7 @@ void validationError() { .hasKind(SpanKind.INTERNAL) .hasNoParent() .hasAttributesSatisfying(Attributes::isEmpty) + .hasStatus(StatusData.error()) .hasEventsSatisfyingExactly( event -> event