GraphQL: verify that span has error status when operation failed (#6011)

This commit is contained in:
Lauri Tulmin 2022-05-12 08:58:50 +03:00 committed by GitHub
parent d6cf07496d
commit aac502cea4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import io.opentelemetry.api.common.Attributes;
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 @@ public abstract class AbstractGraphqlTest {
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfying(Attributes::isEmpty)
.hasStatus(StatusData.error())
.hasEventsSatisfyingExactly(
event ->
event
@ -243,6 +245,7 @@ public abstract class AbstractGraphqlTest {
.hasKind(SpanKind.INTERNAL)
.hasNoParent()
.hasAttributesSatisfying(Attributes::isEmpty)
.hasStatus(StatusData.error())
.hasEventsSatisfyingExactly(
event ->
event