Remove duplicate status verification (#2710)

This commit is contained in:
Trask Stalnaker 2021-04-19 11:41:37 -07:00 committed by GitHub
parent 95f8342558
commit bd829a6494
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
104 changed files with 438 additions and 692 deletions

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import akka.actor.ActorSystem import akka.actor.ActorSystem
import akka.http.javadsl.Http import akka.http.javadsl.Http
@ -84,7 +85,7 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<HttpRequest> impl
hasNoParent() hasNoParent()
name "HTTP request" name "HTTP request"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent(NullPointerException, e.getMessage()) errorEvent(NullPointerException, e.getMessage())
} }
} }

View File

@ -5,6 +5,11 @@
package io.opentelemetry.instrumentation.apachedubbo.v2_7 package io.opentelemetry.instrumentation.apachedubbo.v2_7
import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService import io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService
import io.opentelemetry.instrumentation.apachedubbo.v2_7.impl.HelloServiceImpl import io.opentelemetry.instrumentation.apachedubbo.v2_7.impl.HelloServiceImpl
import io.opentelemetry.instrumentation.test.InstrumentationSpecification import io.opentelemetry.instrumentation.test.InstrumentationSpecification
@ -22,11 +27,6 @@ import org.apache.dubbo.rpc.service.GenericService
import spock.lang.Shared import spock.lang.Shared
import spock.lang.Unroll import spock.lang.Unroll
import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@Unroll @Unroll
abstract class AbstractDubboTest extends InstrumentationSpecification { abstract class AbstractDubboTest extends InstrumentationSpecification {
@ -93,7 +93,6 @@ abstract class AbstractDubboTest extends InstrumentationSpecification {
name "org.apache.dubbo.rpc.service.GenericService/\$invoke" name "org.apache.dubbo.rpc.service.GenericService/\$invoke"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo" "${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${SemanticAttributes.RPC_SERVICE.key}" "org.apache.dubbo.rpc.service.GenericService" "${SemanticAttributes.RPC_SERVICE.key}" "org.apache.dubbo.rpc.service.GenericService"
@ -106,7 +105,6 @@ abstract class AbstractDubboTest extends InstrumentationSpecification {
name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello" name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo" "${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${SemanticAttributes.RPC_SERVICE.key}" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService" "${SemanticAttributes.RPC_SERVICE.key}" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService"
@ -162,7 +160,6 @@ abstract class AbstractDubboTest extends InstrumentationSpecification {
name "org.apache.dubbo.rpc.service.GenericService/\$invokeAsync" name "org.apache.dubbo.rpc.service.GenericService/\$invokeAsync"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo" "${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${SemanticAttributes.RPC_SERVICE.key}" "org.apache.dubbo.rpc.service.GenericService" "${SemanticAttributes.RPC_SERVICE.key}" "org.apache.dubbo.rpc.service.GenericService"
@ -175,7 +172,6 @@ abstract class AbstractDubboTest extends InstrumentationSpecification {
name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello" name "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService/hello"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo" "${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${SemanticAttributes.RPC_SERVICE.key}" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService" "${SemanticAttributes.RPC_SERVICE.key}" "io.opentelemetry.instrumentation.apachedubbo.v2_7.api.HelloService"

View File

@ -65,7 +65,7 @@ class ApacheHttpAsyncClientTest extends HttpClientTest<HttpUriRequest> implement
} }
@Override @Override
Integer statusOnRedirectError() { Integer responseCodeOnRedirectError() {
return 302 return 302
} }

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.awslambda.v1_0 package io.opentelemetry.instrumentation.awslambda.v1_0
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.amazonaws.services.lambda.runtime.Context import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestStreamHandler import com.amazonaws.services.lambda.runtime.RequestStreamHandler
@ -120,7 +121,7 @@ class TracingRequestStreamWrapperPropagationTest extends LibraryInstrumentationS
traceId("4fd0b6131f19f39af59518d127b0cafe") traceId("4fd0b6131f19f39af59518d127b0cafe")
name("my_function") name("my_function")
kind SERVER kind SERVER
errored true status ERROR
errorEvent(IllegalArgumentException, "bad argument") errorEvent(IllegalArgumentException, "bad argument")
attributes { attributes {
"${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333"

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.awslambda.v1_0 package io.opentelemetry.instrumentation.awslambda.v1_0
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.amazonaws.services.lambda.runtime.Context import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestStreamHandler import com.amazonaws.services.lambda.runtime.RequestStreamHandler
@ -102,7 +103,7 @@ class TracingRequestStreamWrapperTest extends LibraryInstrumentationSpecificatio
span(0) { span(0) {
name("my_function") name("my_function")
kind SERVER kind SERVER
errored true status ERROR
errorEvent(IllegalArgumentException, "bad argument") errorEvent(IllegalArgumentException, "bad argument")
attributes { attributes {
"$ResourceAttributes.FAAS_ID.key" "arn:aws:lambda:us-east-1:123456789:function:test" "$ResourceAttributes.FAAS_ID.key" "arn:aws:lambda:us-east-1:123456789:function:test"

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.awslambda.v1_0 package io.opentelemetry.instrumentation.awslambda.v1_0
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.amazonaws.services.lambda.runtime.Context import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestHandler import com.amazonaws.services.lambda.runtime.RequestHandler
@ -68,7 +69,7 @@ class TracingRequestWrapperTest extends TracingRequestWrapperTestBase {
span(0) { span(0) {
name("my_function") name("my_function")
kind SERVER kind SERVER
errored true status ERROR
errorEvent(IllegalArgumentException, "bad argument") errorEvent(IllegalArgumentException, "bad argument")
attributes { attributes {
"$ResourceAttributes.FAAS_ID.key" "arn:aws:lambda:us-east-1:123456789:function:test" "$ResourceAttributes.FAAS_ID.key" "arn:aws:lambda:us-east-1:123456789:function:test"

View File

@ -6,12 +6,13 @@
package io.opentelemetry.instrumentation.awslambda.v1_0 package io.opentelemetry.instrumentation.awslambda.v1_0
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.amazonaws.services.lambda.runtime.Context import com.amazonaws.services.lambda.runtime.Context
import com.amazonaws.services.lambda.runtime.RequestHandler import com.amazonaws.services.lambda.runtime.RequestHandler
import com.github.stefanbirkner.systemlambda.SystemLambda import com.github.stefanbirkner.systemlambda.SystemLambda
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.instrumentation.test.InstrumentationSpecification import io.opentelemetry.instrumentation.test.InstrumentationSpecification
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecification { abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecification {
@ -67,7 +68,7 @@ abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecif
span(0) { span(0) {
name("my_function") name("my_function")
kind SERVER kind SERVER
errored true status ERROR
errorEvent(IllegalArgumentException, "bad argument") errorEvent(IllegalArgumentException, "bad argument")
attributes { attributes {
"${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333" "${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333"

View File

@ -5,6 +5,8 @@
package io.opentelemetry.javaagent.instrumentation.awssdk.v1_11 package io.opentelemetry.javaagent.instrumentation.awssdk.v1_11
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.amazonaws.AmazonWebServiceClient import com.amazonaws.AmazonWebServiceClient
import com.amazonaws.Request import com.amazonaws.Request
import com.amazonaws.auth.BasicAWSCredentials import com.amazonaws.auth.BasicAWSCredentials
@ -90,7 +92,7 @@ class Aws1ClientTest extends AbstractAws1ClientTest implements AgentTestTrait {
span(0) { span(0) {
name "S3.HeadBucket" name "S3.HeadBucket"
kind SpanKind.CLIENT kind SpanKind.CLIENT
errored true status ERROR
errorEvent RuntimeException, "bad handler" errorEvent RuntimeException, "bad handler"
hasNoParent() hasNoParent()
attributes { attributes {

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
@ -101,7 +102,6 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -160,7 +160,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent AmazonClientException, ~/Unable to execute HTTP request/ errorEvent AmazonClientException, ~/Unable to execute HTTP request/
hasNoParent() hasNoParent()
attributes { attributes {
@ -208,7 +208,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "S3.GetObject" name "S3.GetObject"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RuntimeException, "bad handler" errorEvent RuntimeException, "bad handler"
hasNoParent() hasNoParent()
attributes { attributes {
@ -254,7 +254,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "S3.GetObject" name "S3.GetObject"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent AmazonClientException, ~/Unable to execute HTTP request/ errorEvent AmazonClientException, ~/Unable to execute HTTP request/
hasNoParent() hasNoParent()
attributes { attributes {

View File

@ -7,6 +7,7 @@ package io.opentelemetry.instrumentation.awssdk.v1_11
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.PRODUCER import static io.opentelemetry.api.trace.SpanKind.PRODUCER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
@ -94,7 +95,6 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind operation == "SendMessage" ? PRODUCER : CLIENT kind operation == "SendMessage" ? PRODUCER : CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -119,19 +119,19 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
server.lastRequest.headers.get("traceparent") == null server.lastRequest.headers.get("traceparent") == null
where: where:
service | operation | method | path | clientBuilder | call | additionalAttributes | body service | operation | method | path | clientBuilder | call | additionalAttributes | body
"S3" | "CreateBucket" | "PUT" | "/testbucket/" | AmazonS3ClientBuilder.standard().withPathStyleAccessEnabled(true) | { c -> c.createBucket("testbucket") } | ["aws.bucket.name": "testbucket"] | "" "S3" | "CreateBucket" | "PUT" | "/testbucket/" | AmazonS3ClientBuilder.standard().withPathStyleAccessEnabled(true) | { c -> c.createBucket("testbucket") } | ["aws.bucket.name": "testbucket"] | ""
"S3" | "GetObject" | "GET" | "/someBucket/someKey" | AmazonS3ClientBuilder.standard().withPathStyleAccessEnabled(true) | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | "" "S3" | "GetObject" | "GET" | "/someBucket/someKey" | AmazonS3ClientBuilder.standard().withPathStyleAccessEnabled(true) | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | ""
"DynamoDBv2" | "CreateTable" | "POST" | "/" | AmazonDynamoDBClientBuilder.standard() | { c -> c.createTable(new CreateTableRequest("sometable", null)) } | ["aws.table.name": "sometable"] | "" "DynamoDBv2" | "CreateTable" | "POST" | "/" | AmazonDynamoDBClientBuilder.standard() | { c -> c.createTable(new CreateTableRequest("sometable", null)) } | ["aws.table.name": "sometable"] | ""
"Kinesis" | "DeleteStream" | "POST" | "/" | AmazonKinesisClientBuilder.standard() | { c -> c.deleteStream(new DeleteStreamRequest().withStreamName("somestream")) } | ["aws.stream.name": "somestream"] | "" "Kinesis" | "DeleteStream" | "POST" | "/" | AmazonKinesisClientBuilder.standard() | { c -> c.deleteStream(new DeleteStreamRequest().withStreamName("somestream")) } | ["aws.stream.name": "somestream"] | ""
"EC2" | "AllocateAddress" | "POST" | "/" | AmazonEC2ClientBuilder.standard() | { c -> c.allocateAddress() } | [:] | """ "EC2" | "AllocateAddress" | "POST" | "/" | AmazonEC2ClientBuilder.standard() | { c -> c.allocateAddress() } | [:] | """
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/"> <AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId> <requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<publicIp>192.0.2.1</publicIp> <publicIp>192.0.2.1</publicIp>
<domain>standard</domain> <domain>standard</domain>
</AllocateAddressResponse> </AllocateAddressResponse>
""" """
"RDS" | "DeleteOptionGroup" | "POST" | "/" | AmazonRDSClientBuilder.standard() | { c -> c.deleteOptionGroup(new DeleteOptionGroupRequest()) } | [:] | """ "RDS" | "DeleteOptionGroup" | "POST" | "/" | AmazonRDSClientBuilder.standard() | { c -> c.deleteOptionGroup(new DeleteOptionGroupRequest()) } | [:] | """
<DeleteOptionGroupResponse xmlns="http://rds.amazonaws.com/doc/2014-09-01/"> <DeleteOptionGroupResponse xmlns="http://rds.amazonaws.com/doc/2014-09-01/">
<ResponseMetadata> <ResponseMetadata>
<RequestId>0ac9cda2-bbf4-11d3-f92b-31fa5e8dbc99</RequestId> <RequestId>0ac9cda2-bbf4-11d3-f92b-31fa5e8dbc99</RequestId>
@ -160,7 +160,7 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent SdkClientException, ~/Unable to execute HTTP request/ errorEvent SdkClientException, ~/Unable to execute HTTP request/
hasNoParent() hasNoParent()
attributes { attributes {
@ -183,8 +183,8 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
} }
where: where:
service | operation | method | url | call | additionalAttributes | body | clientBuilder service | operation | method | url | call | additionalAttributes | body | clientBuilder
"S3" | "GetObject" | "GET" | "someBucket/someKey" | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | "" | AmazonS3ClientBuilder.standard() "S3" | "GetObject" | "GET" | "someBucket/someKey" | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | "" | AmazonS3ClientBuilder.standard()
} }
// TODO(anuraaga): Add events for retries. // TODO(anuraaga): Add events for retries.
@ -215,7 +215,7 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "S3.GetObject" name "S3.GetObject"
kind CLIENT kind CLIENT
errored true status ERROR
try { try {
errorEvent AmazonClientException, ~/Unable to execute HTTP request/ errorEvent AmazonClientException, ~/Unable to execute HTTP request/
} catch (AssertionError e) { } catch (AssertionError e) {

View File

@ -7,6 +7,7 @@ package io.opentelemetry.instrumentation.awssdk.v2_2
import static com.google.common.collect.ImmutableMap.of import static com.google.common.collect.ImmutableMap.of
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer
import io.opentelemetry.instrumentation.test.InstrumentationSpecification import io.opentelemetry.instrumentation.test.InstrumentationSpecification
@ -153,7 +154,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "DynamoDb.CreateTable" name "DynamoDb.CreateTable"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -189,7 +189,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "DynamoDb.Query" name "DynamoDb.Query"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -224,7 +223,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -337,7 +335,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -426,7 +423,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "$service.$operation" name "$service.$operation"
kind CLIENT kind CLIENT
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -526,7 +522,7 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) { span(0) {
name "S3.GetObject" name "S3.GetObject"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent SdkClientException, "Unable to execute HTTP request: Read timed out" errorEvent SdkClientException, "Unable to execute HTTP request: Read timed out"
hasNoParent() hasNoParent()
attributes { attributes {

View File

@ -16,7 +16,6 @@ class CouchbaseSpanUtil {
trace.span(index) { trace.span(index) {
name spanName name spanName
kind CLIENT kind CLIENT
errored false
if (parentSpan == null) { if (parentSpan == null) {
hasNoParent() hasNoParent()
} else { } else {
@ -41,7 +40,7 @@ class CouchbaseSpanUtil {
// that do have operation ids // that do have operation ids
"couchbase.operation_id" { it == null || String } "couchbase.operation_id" { it == null || String }
"${SemanticAttributes.DB_STATEMENT.key}" (statement ?: spanName) "${SemanticAttributes.DB_STATEMENT.key}"(statement ?: spanName)
} }
} }
} }

View File

@ -107,7 +107,6 @@ abstract class AbstractCouchbaseTest extends AgentInstrumentationSpecification {
trace.span(index) { trace.span(index) {
name spanName name spanName
kind CLIENT kind CLIENT
errored false
if (parentSpan == null) { if (parentSpan == null) {
hasNoParent() hasNoParent()
} else { } else {
@ -118,7 +117,7 @@ abstract class AbstractCouchbaseTest extends AgentInstrumentationSpecification {
if (bucketName != null) { if (bucketName != null) {
"${SemanticAttributes.DB_NAME.key}" bucketName "${SemanticAttributes.DB_NAME.key}" bucketName
} }
"${SemanticAttributes.DB_STATEMENT.key}" (statement ?: spanName) "${SemanticAttributes.DB_STATEMENT.key}"(statement ?: spanName)
} }
} }
} }

View File

@ -18,6 +18,7 @@ import io.dropwizard.setup.Bootstrap
import io.dropwizard.setup.Environment import io.dropwizard.setup.Environment
import io.dropwizard.testing.ConfigOverride import io.dropwizard.testing.ConfigOverride
import io.dropwizard.testing.DropwizardTestSupport import io.dropwizard.testing.DropwizardTestSupport
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -76,8 +77,8 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> implements Ag
trace.span(index) { trace.span(index) {
name "${this.testResource().simpleName}.${endpoint.name().toLowerCase()}" name "${this.testResource().simpleName}.${endpoint.name().toLowerCase()}"
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
childOf((SpanData) parent) childOf((SpanData) parent)
@ -90,7 +91,9 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> implements Ag
trace.span(index) { trace.span(index) {
name "${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}" name "${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}"
kind SERVER kind SERVER
errored endpoint.errored if (endpoint.errored) {
status StatusCode.ERROR
}
if (parentID != null) { if (parentID != null) {
traceId traceID traceId traceID
parentSpanId parentID parentSpanId parentID

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -68,10 +69,10 @@ class Elasticsearch5NodeClientTest extends AgentInstrumentationSpecification {
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()) def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status def clusterHealthStatus = result.get().status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -101,7 +102,7 @@ class Elasticsearch5NodeClientTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "GetAction" name "GetAction"
errored true status ERROR
errorEvent IndexNotFoundException, "no such index" errorEvent IndexNotFoundException, "no such index"
kind CLIENT kind CLIENT
attributes { attributes {

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -84,10 +85,10 @@ class Elasticsearch5TransportClientTest extends AgentInstrumentationSpecificatio
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()) def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status def clusterHealthStatus = result.get().status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -121,7 +122,7 @@ class Elasticsearch5TransportClientTest extends AgentInstrumentationSpecificatio
span(0) { span(0) {
name "GetAction" name "GetAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RemoteTransportException, String errorEvent RemoteTransportException, String
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -71,10 +72,10 @@ class Elasticsearch53NodeClientTest extends AgentInstrumentationSpecification {
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()) def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status def clusterHealthStatus = result.get().status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -105,7 +106,7 @@ class Elasticsearch53NodeClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GetAction" name "GetAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent IndexNotFoundException, "no such index" errorEvent IndexNotFoundException, "no such index"
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -89,10 +90,10 @@ class Elasticsearch53TransportClientTest extends AgentInstrumentationSpecificati
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()) def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status def clusterHealthStatus = result.get().status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -126,7 +127,7 @@ class Elasticsearch53TransportClientTest extends AgentInstrumentationSpecificati
span(0) { span(0) {
name "GetAction" name "GetAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RemoteTransportException, String errorEvent RemoteTransportException, String
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -89,7 +89,6 @@ class Elasticsearch53SpringRepositoryTest extends AgentInstrumentationSpecificat
span(1) { span(1) {
name "SearchAction" name "SearchAction"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -6,6 +6,7 @@
package springdata package springdata
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -93,7 +94,7 @@ class Elasticsearch53SpringTemplateTest extends AgentInstrumentationSpecificatio
span(0) { span(0) {
name "RefreshAction" name "RefreshAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent IndexNotFoundException, "no such index" errorEvent IndexNotFoundException, "no such index"
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -66,10 +67,10 @@ class Elasticsearch6NodeClientTest extends AgentInstrumentationSpecification {
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()).get() def result = client.admin().cluster().health(new ClusterHealthRequest()).get()
def status = result.status def clusterHealthStatus = result.status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -100,7 +101,7 @@ class Elasticsearch6NodeClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GetAction" name "GetAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent IndexNotFoundException, ~/no such index( \[invalid-index\])?/ errorEvent IndexNotFoundException, ~/no such index( \[invalid-index\])?/
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -82,10 +83,10 @@ class Elasticsearch6TransportClientTest extends AgentInstrumentationSpecificatio
setup: setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()) def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status def clusterHealthStatus = result.get().status
expect: expect:
status.name() == "GREEN" clusterHealthStatus.name() == "GREEN"
assertTraces(1) { assertTraces(1) {
trace(0, 1) { trace(0, 1) {
@ -119,7 +120,7 @@ class Elasticsearch6TransportClientTest extends AgentInstrumentationSpecificatio
span(0) { span(0) {
name "GetAction" name "GetAction"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RemoteTransportException, String errorEvent RemoteTransportException, String
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch" "${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

@ -3,6 +3,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.test.annotation.SayTracedHello import io.opentelemetry.test.annotation.SayTracedHello
import io.opentracing.contrib.dropwizard.Trace import io.opentracing.contrib.dropwizard.Trace
@ -21,7 +23,6 @@ class TraceAnnotationsTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SayTracedHello.sayHello" name "SayTracedHello.sayHello"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"myattr" "test" "myattr" "test"
} }
@ -41,7 +42,6 @@ class TraceAnnotationsTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SayTracedHello.sayHelloSayHa" name "SayTracedHello.sayHelloSayHa"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"myattr" "test2" "myattr" "test2"
} }
@ -49,7 +49,6 @@ class TraceAnnotationsTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name "SayTracedHello.sayHello" name "SayTracedHello.sayHello"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"myattr" "test" "myattr" "test"
} }
@ -57,7 +56,6 @@ class TraceAnnotationsTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "SayTracedHello.sayHello" name "SayTracedHello.sayHello"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"myattr" "test" "myattr" "test"
} }
@ -80,7 +78,7 @@ class TraceAnnotationsTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "SayTracedHello.sayError" name "SayTracedHello.sayError"
errored true status ERROR
errorEvent(error.class) errorEvent(error.class)
} }
} }

View File

@ -21,7 +21,6 @@ class TraceProvidersTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SayTracedHello.${provider.toLowerCase()}" name "SayTracedHello.${provider.toLowerCase()}"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"providerAttr" provider "providerAttr" provider
} }

View File

@ -90,7 +90,6 @@ class FinatraServerLatestTest extends HttpServerTest<HttpServer> implements Agen
childOf(parent as SpanData) childOf(parent as SpanData)
// Finatra doesn't propagate the stack trace or exception to the instrumentation // Finatra doesn't propagate the stack trace or exception to the instrumentation
// so the normal errorAttributes() method can't be used // so the normal errorAttributes() method can't be used
errored false
attributes { attributes {
} }
} }

View File

@ -76,7 +76,6 @@ class FinatraServerTest extends HttpServerTest<HttpServer> implements AgentTestT
childOf(parent as SpanData) childOf(parent as SpanData)
// Finatra doesn't propagate the stack trace or exception to the instrumentation // Finatra doesn't propagate the stack trace or exception to the instrumentation
// so the normal errorAttributes() method can't be used // so the normal errorAttributes() method can't be used
errored false
attributes { attributes {
} }
} }

View File

@ -112,12 +112,10 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "someTrace" name "someTrace"
kind INTERNAL kind INTERNAL
errored false
} }
span(1) { span(1) {
name "clear" name "clear"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode" "$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region" "$SemanticAttributes.DB_NAME.key" "test-region"
@ -127,7 +125,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "put" name "put"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode" "$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region" "$SemanticAttributes.DB_NAME.key" "test-region"
@ -137,7 +134,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(3) { span(3) {
name verb name verb
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode" "$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region" "$SemanticAttributes.DB_NAME.key" "test-region"
@ -171,7 +167,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "query" name "query"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode" "$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region" "$SemanticAttributes.DB_NAME.key" "test-region"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.google.api.client.http.GenericUrl import com.google.api.client.http.GenericUrl
import com.google.api.client.http.HttpRequest import com.google.api.client.http.HttpRequest
@ -64,15 +65,15 @@ abstract class AbstractGoogleHttpClientTest extends HttpClientTest<HttpRequest>
def uri = server.address.resolve("/error") def uri = server.address.resolve("/error")
when: when:
def status = doRequest(method, uri) def responseCode = doRequest(method, uri)
then: then:
status == 500 responseCode == 500
assertTraces(1) { assertTraces(1) {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
kind CLIENT kind CLIENT
errored true status ERROR
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"

View File

@ -16,6 +16,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import grails.boot.GrailsApp import grails.boot.GrailsApp
import grails.boot.config.GrailsAutoConfiguration import grails.boot.config.GrailsAutoConfiguration
import groovy.transform.CompileStatic import groovy.transform.CompileStatic
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -36,7 +37,8 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
try { try {
ServerProperties.getDeclaredMethod("getServlet") ServerProperties.getDeclaredMethod("getServlet")
contextPathKey = "server.servlet.contextPath" contextPathKey = "server.servlet.contextPath"
} catch (NoSuchMethodException ignore) {} } catch (NoSuchMethodException ignore) {
}
Map<String, Object> properties = new HashMap<>() Map<String, Object> properties = new HashMap<>()
properties.put("server.port", port) properties.put("server.port", port)
properties.put(contextPathKey, contextPath) properties.put(contextPathKey, contextPath)
@ -116,7 +118,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index + 1) { trace.span(index + 1) {
name errorSpanName name errorSpanName
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -124,7 +125,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index + 2) { trace.span(index + 2) {
name ~/\.sendError$/ name ~/\.sendError$/
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -136,7 +136,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index) { trace.span(index) {
name endpoint == REDIRECT ? ~/\.sendRedirect$/ : ~/\.sendError$/ name endpoint == REDIRECT ? ~/\.sendRedirect$/ : ~/\.sendError$/
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -155,8 +154,8 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
name "TestController.${endpoint.name().toLowerCase()}" name "TestController.${endpoint.name().toLowerCase()}"
} }
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
childOf((SpanData) parent) childOf((SpanData) parent)

View File

@ -16,9 +16,9 @@ import io.grpc.ManagedChannelBuilder
import io.grpc.Server import io.grpc.Server
import io.grpc.ServerBuilder import io.grpc.ServerBuilder
import io.grpc.stub.StreamObserver import io.grpc.stub.StreamObserver
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.instrumentation.test.InstrumentationSpecification import io.opentelemetry.instrumentation.test.InstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.PortUtils import io.opentelemetry.instrumentation.test.utils.PortUtils
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import java.util.concurrent.CopyOnWriteArrayList import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
@ -108,7 +108,6 @@ abstract class AbstractGrpcStreamingTest extends InstrumentationSpecification {
name "example.Greeter/Conversation" name "example.Greeter/Conversation"
kind CLIENT kind CLIENT
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "grpc" "${SemanticAttributes.RPC_SYSTEM.key}" "grpc"
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter" "${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
@ -129,7 +128,6 @@ abstract class AbstractGrpcStreamingTest extends InstrumentationSpecification {
name "example.Greeter/Conversation" name "example.Greeter/Conversation"
kind SERVER kind SERVER
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "grpc" "${SemanticAttributes.RPC_SYSTEM.key}" "grpc"
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter" "${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"

View File

@ -7,6 +7,7 @@ package io.opentelemetry.instrumentation.grpc.v1_5
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -31,10 +32,9 @@ import io.grpc.ServerInterceptor
import io.grpc.Status import io.grpc.Status
import io.grpc.StatusRuntimeException import io.grpc.StatusRuntimeException
import io.grpc.stub.StreamObserver import io.grpc.stub.StreamObserver
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.instrumentation.test.InstrumentationSpecification import io.opentelemetry.instrumentation.test.InstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.PortUtils import io.opentelemetry.instrumentation.test.utils.PortUtils
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import java.util.concurrent.CountDownLatch import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit import java.util.concurrent.TimeUnit
import java.util.concurrent.atomic.AtomicReference import java.util.concurrent.atomic.AtomicReference
@ -86,7 +86,6 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {
@ -104,7 +103,6 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {
@ -168,8 +166,7 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind CLIENT kind CLIENT
hasNoParent() hasNoParent()
errored true status ERROR
status(StatusCode.ERROR)
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "grpc" "${SemanticAttributes.RPC_SYSTEM.key}" "grpc"
"${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter" "${SemanticAttributes.RPC_SERVICE.key}" "example.Greeter"
@ -180,8 +177,7 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind SERVER kind SERVER
childOf span(0) childOf span(0)
errored true status ERROR
status(StatusCode.ERROR)
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {
@ -255,7 +251,7 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind CLIENT kind CLIENT
hasNoParent() hasNoParent()
errored true status ERROR
// NB: Exceptions thrown on the server don't appear to be propagated to the client, at // NB: Exceptions thrown on the server don't appear to be propagated to the client, at
// least for the version we test against. // least for the version we test against.
attributes { attributes {
@ -268,8 +264,7 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind SERVER kind SERVER
childOf span(0) childOf span(0)
errored true status ERROR
status(StatusCode.ERROR)
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {
@ -413,7 +408,6 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {
@ -431,7 +425,6 @@ abstract class AbstractGrpcTest extends InstrumentationSpecification {
name "example.Greeter/SayHello" name "example.Greeter/SayHello"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
event(0) { event(0) {
eventName "message" eventName "message"
attributes { attributes {

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
@ -286,7 +287,7 @@ class SessionTest extends AbstractHibernateTest {
name "Session.replicate" name "Session.replicate"
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored(true) status ERROR
errorEvent(MappingException, "Unknown entity: java.lang.Long") errorEvent(MappingException, "Unknown entity: java.lang.Long")
} }
span(2) { span(2) {

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
@ -225,7 +226,7 @@ class SessionTest extends AbstractHibernateTest {
name "Session.replicate" name "Session.replicate"
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored(true) status ERROR
errorEvent(MappingException, "Unknown entity: java.lang.Long") errorEvent(MappingException, "Unknown entity: java.lang.Long")
} }
span(2) { span(2) {

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
@ -151,7 +152,7 @@ class ProcedureCallTest extends AgentInstrumentationSpecification {
name "ProcedureCall.getOutputs TEST_PROC" name "ProcedureCall.getOutputs TEST_PROC"
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored(true) status ERROR
errorEvent(SQLGrammarException, "could not prepare statement") errorEvent(SQLGrammarException, "could not prepare statement")
} }
span(2) { span(2) {

View File

@ -32,7 +32,7 @@ class HttpUrlConnectionResponseCodeOnlyTest extends HttpClientTest<HttpURLConnec
} }
@Override @Override
Integer statusOnRedirectError() { Integer responseCodeOnRedirectError() {
return 302 return 302
} }

View File

@ -51,7 +51,7 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
} }
@Override @Override
Integer statusOnRedirectError() { Integer responseCodeOnRedirectError() {
return 302 return 302
} }
@ -99,7 +99,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
span(0) { span(0) {
name "someTrace" name "someTrace"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -107,7 +106,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
@ -122,7 +120,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name "test-http-server" name "test-http-server"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
attributes { attributes {
} }
} }
@ -130,7 +127,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
@ -145,7 +141,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name "test-http-server" name "test-http-server"
kind SERVER kind SERVER
childOf span(3) childOf span(3)
errored false
attributes { attributes {
} }
} }
@ -190,7 +185,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
span(0) { span(0) {
name "someTrace" name "someTrace"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -198,7 +192,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
@ -213,7 +206,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
@ -249,7 +241,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
span(0) { span(0) {
name "someTrace" name "someTrace"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -257,7 +248,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
"${SemanticAttributes.NET_PEER_PORT.key}" server.address.port "${SemanticAttributes.NET_PEER_PORT.key}" server.address.port
@ -308,7 +298,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
span(0) { span(0) {
name "someTrace" name "someTrace"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -316,7 +305,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name expectedOperationName("POST") name expectedOperationName("POST")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" "localhost" "${SemanticAttributes.NET_PEER_NAME.key}" "localhost"
@ -331,7 +319,6 @@ class HttpUrlConnectionTest extends HttpClientTest<HttpURLConnection> implements
name "test-http-server" name "test-http-server"
kind SERVER kind SERVER
childOf span(1) childOf span(1)
errored false
attributes { attributes {
} }
} }

View File

@ -39,7 +39,7 @@ class HttpUrlConnectionUseCachesFalseTest extends HttpClientTest<HttpURLConnecti
} }
@Override @Override
Integer statusOnRedirectError() { Integer responseCodeOnRedirectError() {
return 302 return 302
} }

View File

@ -59,7 +59,7 @@ class SpringRestTemplateTest extends HttpClientTest<HttpEntity<String>> implemen
} }
@Override @Override
Integer statusOnRedirectError() { Integer responseCodeOnRedirectError() {
return 302 return 302
} }
} }

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -32,14 +33,14 @@ class UrlConnectionTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "someTrace" name "someTrace"
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent ConnectException, String errorEvent ConnectException, String
} }
span(1) { span(1) {
name expectedOperationName("GET") name expectedOperationName("GET")
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent ConnectException, String errorEvent ConnectException, String
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"

View File

@ -63,14 +63,12 @@ class HystrixObservableChainTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "ExampleGroup.HystrixObservableChainTest\$1.execute" name "ExampleGroup.HystrixObservableChainTest\$1.execute"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"hystrix.command" "HystrixObservableChainTest\$1" "hystrix.command" "HystrixObservableChainTest\$1"
"hystrix.group" "ExampleGroup" "hystrix.group" "ExampleGroup"
@ -80,14 +78,12 @@ class HystrixObservableChainTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "tracedMethod" name "tracedMethod"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
} }
} }
span(3) { span(3) {
name "OtherGroup.HystrixObservableChainTest\$2.execute" name "OtherGroup.HystrixObservableChainTest\$2.execute"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
"hystrix.command" "HystrixObservableChainTest\$2" "hystrix.command" "HystrixObservableChainTest\$2"
"hystrix.group" "OtherGroup" "hystrix.group" "OtherGroup"
@ -97,7 +93,6 @@ class HystrixObservableChainTest extends AgentInstrumentationSpecification {
span(4) { span(4) {
name "anotherTracedMethod" name "anotherTracedMethod"
childOf span(3) childOf span(3)
errored false
attributes { attributes {
} }
} }

View File

@ -4,6 +4,7 @@
*/ */
import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -54,14 +55,12 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "ExampleGroup.HystrixObservableTest\$1.execute" name "ExampleGroup.HystrixObservableTest\$1.execute"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"hystrix.command" "HystrixObservableTest\$1" "hystrix.command" "HystrixObservableTest\$1"
"hystrix.group" "ExampleGroup" "hystrix.group" "ExampleGroup"
@ -71,7 +70,6 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "tracedMethod" name "tracedMethod"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
} }
} }
@ -148,14 +146,13 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "ExampleGroup.HystrixObservableTest\$2.execute" name "ExampleGroup.HystrixObservableTest\$2.execute"
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(IllegalArgumentException) errorEvent(IllegalArgumentException)
attributes { attributes {
"hystrix.command" "HystrixObservableTest\$2" "hystrix.command" "HystrixObservableTest\$2"
@ -166,7 +163,6 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "ExampleGroup.HystrixObservableTest\$2.fallback" name "ExampleGroup.HystrixObservableTest\$2.fallback"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
"hystrix.command" "HystrixObservableTest\$2" "hystrix.command" "HystrixObservableTest\$2"
"hystrix.group" "ExampleGroup" "hystrix.group" "ExampleGroup"
@ -245,13 +241,13 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(HystrixRuntimeException, "HystrixObservableTest\$3 failed and no fallback available.") errorEvent(HystrixRuntimeException, "HystrixObservableTest\$3 failed and no fallback available.")
} }
span(1) { span(1) {
name "FailingGroup.HystrixObservableTest\$3.execute" name "FailingGroup.HystrixObservableTest\$3.execute"
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(IllegalArgumentException) errorEvent(IllegalArgumentException)
attributes { attributes {
"hystrix.command" "HystrixObservableTest\$3" "hystrix.command" "HystrixObservableTest\$3"
@ -262,7 +258,7 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "FailingGroup.HystrixObservableTest\$3.fallback" name "FailingGroup.HystrixObservableTest\$3.fallback"
childOf span(1) childOf span(1)
errored true status ERROR
errorEvent(UnsupportedOperationException, "No fallback available.") errorEvent(UnsupportedOperationException, "No fallback available.")
attributes { attributes {
"hystrix.command" "HystrixObservableTest\$3" "hystrix.command" "HystrixObservableTest\$3"

View File

@ -4,6 +4,7 @@
*/ */
import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey import static com.netflix.hystrix.HystrixCommandGroupKey.Factory.asKey
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -38,14 +39,12 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "ExampleGroup.HystrixTest\$1.execute" name "ExampleGroup.HystrixTest\$1.execute"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"hystrix.command" "HystrixTest\$1" "hystrix.command" "HystrixTest\$1"
"hystrix.group" "ExampleGroup" "hystrix.group" "ExampleGroup"
@ -55,7 +54,6 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "tracedMethod" name "tracedMethod"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
} }
} }
@ -100,14 +98,13 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "parent" name "parent"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "ExampleGroup.HystrixTest\$2.execute" name "ExampleGroup.HystrixTest\$2.execute"
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(IllegalArgumentException) errorEvent(IllegalArgumentException)
attributes { attributes {
"hystrix.command" "HystrixTest\$2" "hystrix.command" "HystrixTest\$2"
@ -118,7 +115,6 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "ExampleGroup.HystrixTest\$2.fallback" name "ExampleGroup.HystrixTest\$2.fallback"
childOf span(1) childOf span(1)
errored false
attributes { attributes {
"hystrix.command" "HystrixTest\$2" "hystrix.command" "HystrixTest\$2"
"hystrix.group" "ExampleGroup" "hystrix.group" "ExampleGroup"

View File

@ -71,17 +71,16 @@ class JdkHttpClientTest extends HttpClientTest<HttpRequest> implements AgentTest
def uri = new URI("https://www.google.com/") def uri = new URI("https://www.google.com/")
when: when:
def status = doRequest(method, uri) def responseCode = doRequest(method, uri)
then: then:
status == 200 responseCode == 200
assertTraces(1) { assertTraces(1) {
trace(0, 1 + extraClientSpans()) { trace(0, 1 + extraClientSpans()) {
span(0) { span(0) {
hasNoParent() hasNoParent()
name expectedOperationName(method) name expectedOperationName(method)
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" uri.host "${SemanticAttributes.NET_PEER_NAME.key}" uri.host
@ -91,7 +90,7 @@ class JdkHttpClientTest extends HttpClientTest<HttpRequest> implements AgentTest
"${SemanticAttributes.HTTP_URL.key}" { it == "${uri}" || it == "${removeFragment(uri)}" } "${SemanticAttributes.HTTP_URL.key}" { it == "${uri}" || it == "${removeFragment(uri)}" }
"${SemanticAttributes.HTTP_METHOD.key}" method "${SemanticAttributes.HTTP_METHOD.key}" method
"${SemanticAttributes.HTTP_FLAVOR.key}" "2.0" "${SemanticAttributes.HTTP_FLAVOR.key}" "2.0"
"${SemanticAttributes.HTTP_STATUS_CODE.key}" status "${SemanticAttributes.HTTP_STATUS_CODE.key}" responseCode
} }
} }
} }

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.base.HttpClientTest import io.opentelemetry.instrumentation.test.base.HttpClientTest
@ -83,7 +84,7 @@ abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implem
hasNoParent() hasNoParent()
name expectedOperationName(method) name expectedOperationName(method)
kind CLIENT kind CLIENT
errored true status ERROR
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_NAME.key}" uri.host "${SemanticAttributes.NET_PEER_NAME.key}" uri.host

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderServerTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderServerTrace
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -74,11 +75,8 @@ abstract class JaxRsFilterTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name parentSpanName != null ? parentSpanName : "test.span" name parentSpanName != null ? parentSpanName : "test.span"
kind SERVER kind SERVER
if (runsOnServer()) { if (runsOnServer() && abortNormal) {
errored abortNormal status ERROR
} else {
attributes {
}
} }
} }
span(1) { span(1) {

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
@ -173,7 +174,9 @@ abstract class JaxRsHttpServerTest<S> extends HttpServerTest<S> implements Agent
trace.span(index) { trace.span(index) {
name path name path
kind SERVER kind SERVER
errored isError if (isError) {
status ERROR
}
if (parentID != null) { if (parentID != null) {
traceId traceID traceId traceID
parentSpanId parentID parentSpanId parentID
@ -216,8 +219,8 @@ abstract class JaxRsHttpServerTest<S> extends HttpServerTest<S> implements Agent
trace.span(index) { trace.span(index) {
name "JaxRsTestResource.${methodName}" name "JaxRsTestResource.${methodName}"
kind INTERNAL kind INTERNAL
errored isError
if (isError) { if (isError) {
status ERROR
errorEvent(Exception, exceptionMessage) errorEvent(Exception, exceptionMessage)
} }
childOf((SpanData) parent) childOf((SpanData) parent)

View File

@ -3,14 +3,17 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import io.opentelemetry.api.trace.SpanKind import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTestTrait import io.opentelemetry.instrumentation.test.base.HttpServerTestTrait
import io.opentelemetry.sdk.trace.data.SpanData import io.opentelemetry.sdk.trace.data.SpanData
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.test.hello_web_service.HelloRequest
import io.opentelemetry.test.hello_web_service.Hello2Request import io.opentelemetry.test.hello_web_service.Hello2Request
import io.opentelemetry.test.hello_web_service.HelloRequest
import org.eclipse.jetty.server.Server import org.eclipse.jetty.server.Server
import org.eclipse.jetty.util.resource.Resource import org.eclipse.jetty.util.resource.Resource
import org.eclipse.jetty.webapp.WebAppContext import org.eclipse.jetty.webapp.WebAppContext
@ -156,8 +159,10 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
trace.span(index) { trace.span(index) {
hasNoParent() hasNoParent()
name operation name operation
kind SpanKind.SERVER kind SERVER
errored exception != null if (exception != null) {
status ERROR
}
} }
} }
@ -169,9 +174,9 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
childOf((SpanData) parentSpan) childOf((SpanData) parentSpan)
} }
name "HelloService/" + operation name "HelloService/" + operation
kind SpanKind.INTERNAL kind INTERNAL
errored exception != null
if (exception) { if (exception) {
status ERROR
errorEvent(exception.class, exception.message) errorEvent(exception.class, exception.message)
} }
} }
@ -185,9 +190,9 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
childOf((SpanData) parentSpan) childOf((SpanData) parentSpan)
} }
name "HelloServiceImpl." + methodName name "HelloServiceImpl." + methodName
kind SpanKind.INTERNAL kind INTERNAL
errored exception != null
if (exception) { if (exception) {
status ERROR
errorEvent(exception.class, exception.message) errorEvent(exception.class, exception.message)
} }
attributes { attributes {

View File

@ -180,7 +180,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -238,7 +237,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -288,7 +286,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -338,7 +335,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbName.toLowerCase() "$SemanticAttributes.DB_NAME.key" dbName.toLowerCase()
@ -388,7 +384,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name dbNameLower name dbNameLower
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -439,7 +434,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name dbNameLower name dbNameLower
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbName.toLowerCase() "$SemanticAttributes.DB_NAME.key" dbName.toLowerCase()
@ -501,7 +495,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" system "$SemanticAttributes.DB_SYSTEM.key" system
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -604,7 +597,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name "DB Query" name "DB Query"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "testdb" "$SemanticAttributes.DB_SYSTEM.key" "testdb"
"$SemanticAttributes.DB_STATEMENT.key" "testing ?" "$SemanticAttributes.DB_STATEMENT.key" "testing ?"
@ -643,7 +635,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "testdb" "$SemanticAttributes.DB_SYSTEM.key" "testdb"
"$SemanticAttributes.DB_NAME.key" databaseName "$SemanticAttributes.DB_NAME.key" databaseName
@ -702,7 +693,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SELECT ${dbNameLower}.INFORMATION_SCHEMA.SYSTEM_USERS" name "SELECT ${dbNameLower}.INFORMATION_SCHEMA.SYSTEM_USERS"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "hsqldb" "$SemanticAttributes.DB_SYSTEM.key" "hsqldb"
"$SemanticAttributes.DB_NAME.key" dbNameLower "$SemanticAttributes.DB_NAME.key" dbNameLower
@ -748,7 +738,6 @@ class JdbcInstrumentationTest extends AgentInstrumentationSpecification {
name "SELECT table" name "SELECT table"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "testdb" "$SemanticAttributes.DB_SYSTEM.key" "testdb"
"$SemanticAttributes.DB_CONNECTION_STRING.key" "testdb://localhost" "$SemanticAttributes.DB_CONNECTION_STRING.key" "testdb://localhost"

View File

@ -239,7 +239,6 @@ class Jms2Test extends AgentInstrumentationSpecification {
trace.span(index) { trace.span(index) {
name destinationName + " send" name destinationName + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
@ -264,7 +263,6 @@ class Jms2Test extends AgentInstrumentationSpecification {
} else { } else {
hasNoParent() hasNoParent()
} }
errored false
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
"${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName "${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName

View File

@ -199,7 +199,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name destinationName + " receive" name destinationName + " receive"
kind CONSUMER kind CONSUMER
errored false
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
"${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName "${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName
@ -271,7 +270,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
trace.span(index) { trace.span(index) {
name destinationName + " send" name destinationName + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
@ -296,7 +294,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
} else { } else {
hasNoParent() hasNoParent()
} }
errored false
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
"${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName "${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicServerSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicServerSpan
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -126,7 +127,7 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
// set up form parameter for post // set up form parameter for post
RequestBody formBody = new FormBody.Builder() RequestBody formBody = new FormBody.Builder()
.add("app-form", "app-form") .add("app-form", "app-form")
// value used for name is returned in app-form:output-message element // value used for name is returned in app-form:output-message element
.add("app-form:name", "test") .add("app-form:name", "test")
.add("app-form:submit", "Say hello") .add("app-form:submit", "Say hello")
.add("app-form_SUBMIT", "1") // MyFaces .add("app-form_SUBMIT", "1") // MyFaces
@ -186,7 +187,7 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
// set up form parameter for post // set up form parameter for post
RequestBody formBody = new FormBody.Builder() RequestBody formBody = new FormBody.Builder()
.add("app-form", "app-form") .add("app-form", "app-form")
// setting name parameter to "exception" triggers throwing exception in GreetingForm // setting name parameter to "exception" triggers throwing exception in GreetingForm
.add("app-form:name", "exception") .add("app-form:name", "exception")
.add("app-form:submit", "Say hello") .add("app-form:submit", "Say hello")
.add("app-form_SUBMIT", "1") // MyFaces .add("app-form_SUBMIT", "1") // MyFaces
@ -219,8 +220,8 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
trace.span(index) { trace.span(index) {
name spanName name spanName
kind INTERNAL kind INTERNAL
errored expectedException != null
if (expectedException != null) { if (expectedException != null) {
status ERROR
errorEvent(expectedException.getClass(), expectedException.getMessage()) errorEvent(expectedException.getClass(), expectedException.getMessage())
} }
childOf((SpanData) parent) childOf((SpanData) parent)

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.OkHttpUtils import io.opentelemetry.instrumentation.test.utils.OkHttpUtils
@ -87,7 +88,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/$jspFileName" name "/$jspWebappContext/$jspFileName"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -102,7 +102,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /$jspFileName" name "Compile /$jspFileName"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName" "jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -111,7 +110,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /$jspFileName" name "Render /$jspFileName"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -146,7 +144,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/getQuery.jsp" name "/$jspWebappContext/getQuery.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -161,7 +158,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /getQuery.jsp" name "Compile /getQuery.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.getQuery_jsp" "jsp.classFQCN" "org.apache.jsp.getQuery_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -170,7 +166,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /getQuery.jsp" name "Render /getQuery.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -202,7 +197,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/post.jsp" name "/$jspWebappContext/post.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -217,7 +211,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /post.jsp" name "Compile /post.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.post_jsp" "jsp.classFQCN" "org.apache.jsp.post_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -226,7 +219,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /post.jsp" name "Render /post.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -255,7 +247,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/$jspFileName" name "/$jspWebappContext/$jspFileName"
kind SERVER kind SERVER
errored true status ERROR
event(0) { event(0) {
eventName(SemanticAttributes.EXCEPTION_EVENT_NAME) eventName(SemanticAttributes.EXCEPTION_EVENT_NAME)
attributes { attributes {
@ -282,7 +274,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /$jspFileName" name "Compile /$jspFileName"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassName" "jsp.classFQCN" "org.apache.jsp.$jspClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -291,7 +282,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /$jspFileName" name "Render /$jspFileName"
errored true status ERROR
event(0) { event(0) {
eventName(SemanticAttributes.EXCEPTION_EVENT_NAME) eventName(SemanticAttributes.EXCEPTION_EVENT_NAME)
attributes { attributes {
@ -337,7 +328,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/includes/includeHtml.jsp" name "/$jspWebappContext/includes/includeHtml.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -352,7 +342,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /includes/includeHtml.jsp" name "Compile /includes/includeHtml.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeHtml_jsp" "jsp.classFQCN" "org.apache.jsp.includes.includeHtml_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -361,7 +350,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /includes/includeHtml.jsp" name "Render /includes/includeHtml.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -369,7 +357,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.include" name "ApplicationDispatcher.include"
errored false
} }
} }
} }
@ -394,7 +381,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/includes/includeMulti.jsp" name "/$jspWebappContext/includes/includeMulti.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -409,7 +395,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /includes/includeMulti.jsp" name "Compile /includes/includeMulti.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp" "jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -418,7 +403,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /includes/includeMulti.jsp" name "Render /includes/includeMulti.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -426,12 +410,10 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.include" name "ApplicationDispatcher.include"
errored false
} }
span(4) { span(4) {
childOf span(3) childOf span(3)
name "Compile /common/javaLoopH2.jsp" name "Compile /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp" "jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -440,7 +422,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(5) { span(5) {
childOf span(3) childOf span(3)
name "Render /common/javaLoopH2.jsp" name "Render /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -448,12 +429,10 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(6) { span(6) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.include" name "ApplicationDispatcher.include"
errored false
} }
span(7) { span(7) {
childOf span(6) childOf span(6)
name "Compile /common/javaLoopH2.jsp" name "Compile /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp" "jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -462,7 +441,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(8) { span(8) {
childOf span(6) childOf span(6)
name "Render /common/javaLoopH2.jsp" name "Render /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -490,7 +468,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/$jspFileName" name "/$jspWebappContext/$jspFileName"
kind SERVER kind SERVER
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -506,7 +484,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /$jspFileName" name "Compile /$jspFileName"
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName" "jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName"
@ -542,7 +520,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/*" name "/$jspWebappContext/*"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.OkHttpUtils import io.opentelemetry.instrumentation.test.utils.OkHttpUtils
@ -85,7 +86,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/$forwardFromFileName" name "/$jspWebappContext/$forwardFromFileName"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -100,7 +100,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /$forwardFromFileName" name "Compile /$forwardFromFileName"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.$jspForwardFromClassPrefix$jspForwardFromClassName" "jsp.classFQCN" "org.apache.jsp.$jspForwardFromClassPrefix$jspForwardFromClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -109,7 +108,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /$forwardFromFileName" name "Render /$forwardFromFileName"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -117,12 +115,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored false
} }
span(4) { span(4) {
childOf span(3) childOf span(3)
name "Compile /$forwardDestFileName" name "Compile /$forwardDestFileName"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.$jspForwardDestClassPrefix$jspForwardDestClassName" "jsp.classFQCN" "org.apache.jsp.$jspForwardDestClassPrefix$jspForwardDestClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -131,7 +127,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) { span(5) {
childOf span(3) childOf span(3)
name "Render /$forwardDestFileName" name "Render /$forwardDestFileName"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/$forwardFromFileName" "jsp.forwardOrigin" "/$forwardFromFileName"
"jsp.requestURL" baseUrl + "/$forwardDestFileName" "jsp.requestURL" baseUrl + "/$forwardDestFileName"
@ -165,7 +160,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/forwards/forwardToHtml.jsp" name "/$jspWebappContext/forwards/forwardToHtml.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -180,7 +174,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /forwards/forwardToHtml.jsp" name "Compile /forwards/forwardToHtml.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToHtml_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToHtml_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -189,7 +182,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /forwards/forwardToHtml.jsp" name "Render /forwards/forwardToHtml.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -197,7 +189,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored false
} }
} }
} }
@ -222,7 +213,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/forwards/forwardToIncludeMulti.jsp" name "/$jspWebappContext/forwards/forwardToIncludeMulti.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -237,7 +227,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /forwards/forwardToIncludeMulti.jsp" name "Compile /forwards/forwardToIncludeMulti.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToIncludeMulti_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToIncludeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -246,7 +235,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /forwards/forwardToIncludeMulti.jsp" name "Render /forwards/forwardToIncludeMulti.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -254,12 +242,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored false
} }
span(4) { span(4) {
childOf span(3) childOf span(3)
name "Compile /includes/includeMulti.jsp" name "Compile /includes/includeMulti.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp" "jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -268,7 +254,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) { span(5) {
childOf span(3) childOf span(3)
name "Render /includes/includeMulti.jsp" name "Render /includes/includeMulti.jsp"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp" "jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp" "jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -277,12 +262,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(6) { span(6) {
childOf span(5) childOf span(5)
name "ApplicationDispatcher.include" name "ApplicationDispatcher.include"
errored false
} }
span(7) { span(7) {
childOf span(6) childOf span(6)
name "Compile /common/javaLoopH2.jsp" name "Compile /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp" "jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -291,7 +274,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(8) { span(8) {
childOf span(6) childOf span(6)
name "Render /common/javaLoopH2.jsp" name "Render /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp" "jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp" "jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -300,12 +282,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(9) { span(9) {
childOf span(5) childOf span(5)
name "ApplicationDispatcher.include" name "ApplicationDispatcher.include"
errored false
} }
span(10) { span(10) {
childOf span(9) childOf span(9)
name "Compile /common/javaLoopH2.jsp" name "Compile /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp" "jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -314,7 +294,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(11) { span(11) {
childOf span(9) childOf span(9)
name "Render /common/javaLoopH2.jsp" name "Render /common/javaLoopH2.jsp"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp" "jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp" "jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -343,7 +322,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/forwards/forwardToJspForward.jsp" name "/$jspWebappContext/forwards/forwardToJspForward.jsp"
kind SERVER kind SERVER
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -358,7 +336,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /forwards/forwardToJspForward.jsp" name "Compile /forwards/forwardToJspForward.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToJspForward_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToJspForward_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -367,7 +344,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /forwards/forwardToJspForward.jsp" name "Render /forwards/forwardToJspForward.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }
@ -375,12 +351,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored false
} }
span(4) { span(4) {
childOf span(3) childOf span(3)
name "Compile /forwards/forwardToSimpleJava.jsp" name "Compile /forwards/forwardToSimpleJava.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToSimpleJava_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToSimpleJava_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -389,7 +363,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) { span(5) {
childOf span(3) childOf span(3)
name "Render /forwards/forwardToSimpleJava.jsp" name "Render /forwards/forwardToSimpleJava.jsp"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp" "jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/forwards/forwardToSimpleJava.jsp" "jsp.requestURL" baseUrl + "/forwards/forwardToSimpleJava.jsp"
@ -398,12 +371,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(6) { span(6) {
childOf span(5) childOf span(5)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored false
} }
span(7) { span(7) {
childOf span(6) childOf span(6)
name "Compile /common/loop.jsp" name "Compile /common/loop.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.common.loop_jsp" "jsp.classFQCN" "org.apache.jsp.common.loop_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -412,7 +383,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(8) { span(8) {
childOf span(6) childOf span(6)
name "Render /common/loop.jsp" name "Render /common/loop.jsp"
errored false
attributes { attributes {
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp" "jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/common/loop.jsp" "jsp.requestURL" baseUrl + "/common/loop.jsp"
@ -441,7 +411,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/forwards/forwardToCompileError.jsp" name "/$jspWebappContext/forwards/forwardToCompileError.jsp"
kind SERVER kind SERVER
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -457,7 +427,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /forwards/forwardToCompileError.jsp" name "Compile /forwards/forwardToCompileError.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToCompileError_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToCompileError_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -466,7 +435,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /forwards/forwardToCompileError.jsp" name "Render /forwards/forwardToCompileError.jsp"
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
@ -475,13 +444,13 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) { span(3) {
childOf span(2) childOf span(2)
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
} }
span(4) { span(4) {
childOf span(3) childOf span(3)
name "Compile /compileError.jsp" name "Compile /compileError.jsp"
errored true status ERROR
errorEvent(JasperException, String) errorEvent(JasperException, String)
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.compileError_jsp" "jsp.classFQCN" "org.apache.jsp.compileError_jsp"
@ -511,7 +480,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent() hasNoParent()
name "/$jspWebappContext/forwards/forwardToNonExistent.jsp" name "/$jspWebappContext/forwards/forwardToNonExistent.jsp"
kind SERVER kind SERVER
errored true status ERROR
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -526,7 +495,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) { span(1) {
childOf span(0) childOf span(0)
name "Compile /forwards/forwardToNonExistent.jsp" name "Compile /forwards/forwardToNonExistent.jsp"
errored false
attributes { attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToNonExistent_jsp" "jsp.classFQCN" "org.apache.jsp.forwards.forwardToNonExistent_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler" "jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -535,7 +503,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) { span(2) {
childOf span(0) childOf span(0)
name "Render /forwards/forwardToNonExistent.jsp" name "Render /forwards/forwardToNonExistent.jsp"
errored false
attributes { attributes {
"jsp.requestURL" reqUrl "jsp.requestURL" reqUrl
} }

View File

@ -37,7 +37,6 @@ class KafkaClientPropagationDisabledTest extends KafkaClientBaseTest {
span(0) { span(0) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -62,7 +61,6 @@ class KafkaClientPropagationDisabledTest extends KafkaClientBaseTest {
span(0) { span(0) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -75,7 +73,6 @@ class KafkaClientPropagationDisabledTest extends KafkaClientBaseTest {
span(0) { span(0) {
name SHARED_TOPIC + " process" name SHARED_TOPIC + " process"
kind CONSUMER kind CONSUMER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"

View File

@ -88,7 +88,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(1) { span(1) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -99,7 +98,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(2) { span(2) {
name SHARED_TOPIC + " process" name SHARED_TOPIC + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(1) childOf span(1)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -178,7 +176,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(1) { span(1) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -189,7 +186,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(2) { span(2) {
name SHARED_TOPIC + " process" name SHARED_TOPIC + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(1) childOf span(1)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -261,7 +257,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(0) { span(0) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -274,7 +269,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(1) { span(1) {
name SHARED_TOPIC + " process" name SHARED_TOPIC + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -336,7 +330,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(0) { span(0) {
name SHARED_TOPIC + " send" name SHARED_TOPIC + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -348,7 +341,6 @@ class KafkaClientPropagationEnabledTest extends KafkaClientBaseTest {
span(1) { span(1) {
name SHARED_TOPIC + " process" name SHARED_TOPIC + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"

View File

@ -130,7 +130,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name STREAM_PENDING + " send" name STREAM_PENDING + " send"
kind PRODUCER kind PRODUCER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -142,7 +141,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name STREAM_PENDING + " process" name STREAM_PENDING + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -159,7 +157,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name STREAM_PENDING + " process" name STREAM_PENDING + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -175,7 +172,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(3) { span(3) {
name STREAM_PROCESSED + " send" name STREAM_PROCESSED + " send"
kind PRODUCER kind PRODUCER
errored false
childOf span(2) childOf span(2)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -187,7 +183,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(4) { span(4) {
name STREAM_PROCESSED + " process" name STREAM_PROCESSED + " process"
kind CONSUMER kind CONSUMER
errored false
childOf span(3) childOf span(3)
attributes { attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka" "${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.distributedRequestSpan import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.distributedRequestSpan
import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer import static io.opentelemetry.instrumentation.test.server.http.TestHttpServer.httpServer
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
@ -172,8 +173,8 @@ class KubernetesClientTest extends AgentInstrumentationSpecification {
name spanName name spanName
kind CLIENT kind CLIENT
childOf trace.span(0) childOf trace.span(0)
errored hasFailed
if (hasFailed) { if (hasFailed) {
status ERROR
errorEvent exception.class, exception.message errorEvent exception.class, exception.message
} }
attributes { attributes {

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.lambdaworks.redis.ClientOptions import com.lambdaworks.redis.ClientOptions
import com.lambdaworks.redis.RedisClient import com.lambdaworks.redis.RedisClient
@ -116,7 +117,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST "${SemanticAttributes.NET_PEER_NAME.key}" HOST
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -149,7 +149,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RedisConnectionException, String errorEvent RedisConnectionException, String
attributes { attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST "${SemanticAttributes.NET_PEER_NAME.key}" HOST
@ -175,7 +175,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SET" "${SemanticAttributes.DB_STATEMENT.key}" "SET"
@ -208,7 +207,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET" "${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -255,7 +253,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET" "${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -288,7 +285,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY" "${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
@ -340,7 +336,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET" "${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
@ -351,7 +346,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL" "${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
@ -392,7 +386,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEL" name "DEL"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent(IllegalStateException, "TestException") errorEvent(IllegalStateException, "TestException")
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
@ -428,7 +422,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SADD" name "SADD"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SADD" "${SemanticAttributes.DB_STATEMENT.key}" "SADD"
@ -449,7 +442,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG" "${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
@ -470,7 +462,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SHUTDOWN" name "SHUTDOWN"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN" "${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import com.lambdaworks.redis.ClientOptions import com.lambdaworks.redis.ClientOptions
import com.lambdaworks.redis.RedisClient import com.lambdaworks.redis.RedisClient
@ -98,7 +99,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST "${SemanticAttributes.NET_PEER_NAME.key}" HOST
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -129,7 +129,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent RedisConnectionException, String errorEvent RedisConnectionException, String
attributes { attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST "${SemanticAttributes.NET_PEER_NAME.key}" HOST
@ -154,7 +154,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SET" "${SemanticAttributes.DB_STATEMENT.key}" "SET"
@ -175,7 +174,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET" "${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -196,7 +194,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET" "${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -217,7 +214,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY" "${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
@ -238,7 +234,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "LPUSH" name "LPUSH"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "LPUSH" "${SemanticAttributes.DB_STATEMENT.key}" "LPUSH"
@ -259,7 +254,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET" "${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
@ -280,7 +274,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL" "${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
@ -300,7 +293,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG" "${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
@ -320,7 +312,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SHUTDOWN" name "SHUTDOWN"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis" "${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN" "${SemanticAttributes.DB_STATEMENT.key}" "SHUTDOWN"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.lettuce.core.ClientOptions import io.lettuce.core.ClientOptions
import io.lettuce.core.ConnectionFuture import io.lettuce.core.ConnectionFuture
@ -120,7 +121,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME "$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
"$SemanticAttributes.NET_PEER_IP.key" PEER_IP "$SemanticAttributes.NET_PEER_IP.key" PEER_IP
@ -154,7 +154,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent AbstractChannel.AnnotatedConnectException, String errorEvent AbstractChannel.AnnotatedConnectException, String
attributes { attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME "$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
@ -180,7 +180,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?" "$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -213,7 +212,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY" "$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -260,7 +258,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY" "$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -293,7 +290,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY" "$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -344,7 +340,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HMSET TESTHM firstname ? lastname ? age ?" "$SemanticAttributes.DB_STATEMENT.key" "HMSET TESTHM firstname ? lastname ? age ?"
@ -355,7 +350,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM" "$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM"
@ -396,7 +390,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEL" name "DEL"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent(IllegalStateException, "TestException") errorEvent(IllegalStateException, "TestException")
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -432,7 +426,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SADD" name "SADD"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SADD SKEY ? ?" "$SemanticAttributes.DB_STATEMENT.key" "SADD SKEY ? ?"
@ -453,7 +446,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT" "$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -474,7 +466,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SHUTDOWN" name "SHUTDOWN"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE" "$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"

View File

@ -96,7 +96,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?" "$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -120,7 +119,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY" "$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -152,7 +150,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY" "$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -182,7 +179,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY" "$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -202,7 +198,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "COMMAND" name "COMMAND"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "COMMAND" "$SemanticAttributes.DB_STATEMENT.key" "COMMAND"
@ -223,7 +218,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "COMMAND" name "COMMAND"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "COMMAND" "$SemanticAttributes.DB_STATEMENT.key" "COMMAND"
@ -254,7 +248,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT" "$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -274,7 +267,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SHUTDOWN" name "SHUTDOWN"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE" "$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"
@ -297,14 +289,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -314,7 +304,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -338,14 +327,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -355,7 +342,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -380,14 +366,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -397,7 +381,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.lettuce.core.ClientOptions import io.lettuce.core.ClientOptions
import io.lettuce.core.RedisClient import io.lettuce.core.RedisClient
@ -100,7 +101,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME "$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
"$SemanticAttributes.NET_PEER_IP.key" PEER_IP "$SemanticAttributes.NET_PEER_IP.key" PEER_IP
@ -131,7 +131,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent AbstractChannel.AnnotatedConnectException, String errorEvent AbstractChannel.AnnotatedConnectException, String
attributes { attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME "$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
@ -156,7 +156,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?" "$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -177,7 +176,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY" "$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -198,7 +196,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY" "$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -219,7 +216,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY" "$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -240,7 +236,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "LPUSH" name "LPUSH"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "LPUSH TESTLIST ?" "$SemanticAttributes.DB_STATEMENT.key" "LPUSH TESTLIST ?"
@ -261,7 +256,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HMSET user firstname ? lastname ? age ?" "$SemanticAttributes.DB_STATEMENT.key" "HMSET user firstname ? lastname ? age ?"
@ -282,7 +276,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM" "$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM"
@ -302,7 +295,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT" "$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -322,7 +314,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "SHUTDOWN" name "SHUTDOWN"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis" "$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE" "$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"

View File

@ -36,14 +36,12 @@ class LettuceReactiveClientTest extends AbstractLettuceReactiveClientTest implem
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind SpanKind.CLIENT kind SpanKind.CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -63,7 +61,6 @@ class LettuceReactiveClientTest extends AbstractLettuceReactiveClientTest implem
span(2) { span(2) {
name "GET" name "GET"
kind SpanKind.CLIENT kind SpanKind.CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"

View File

@ -148,7 +148,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -191,7 +190,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -248,7 +246,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -291,7 +288,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -352,7 +348,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -373,7 +368,6 @@ abstract class AbstractLettuceAsyncClientTest extends InstrumentationSpecificati
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"

View File

@ -97,7 +97,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -131,7 +130,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -173,7 +171,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -213,7 +210,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -243,7 +239,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(0) { span(0) {
name "COMMAND" name "COMMAND"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -285,14 +280,12 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -312,7 +305,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(2) { span(2) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -346,14 +338,12 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
trace(0, 3) { trace(0, 3) {
span(0) { span(0) {
name "test-parent" name "test-parent"
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -373,7 +363,6 @@ abstract class AbstractLettuceReactiveClientTest extends InstrumentationSpecific
span(2) { span(2) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
childOf span(0) childOf span(0)
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"

View File

@ -71,7 +71,6 @@ abstract class AbstractLettuceSyncClientAuthTest extends InstrumentationSpecific
span(0) { span(0) {
name "AUTH" name "AUTH"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.lettuce.v5_1 package io.opentelemetry.instrumentation.lettuce.v5_1
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static java.nio.charset.StandardCharsets.UTF_8 import static java.nio.charset.StandardCharsets.UTF_8
import io.lettuce.core.RedisClient import io.lettuce.core.RedisClient
@ -133,7 +134,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -167,7 +167,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "SET" name "SET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -199,7 +198,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -230,7 +228,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "GET" name "GET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -261,7 +258,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "RANDOMKEY" name "RANDOMKEY"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -292,7 +288,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "LPUSH" name "LPUSH"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -323,7 +318,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "HMSET" name "HMSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -354,7 +348,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "HGETALL" name "HGETALL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -390,7 +383,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "EVAL" name "EVAL"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -425,7 +417,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) { span(0) {
name "MSET" name "MSET"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -456,7 +447,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
name "DEBUG" name "DEBUG"
kind CLIENT kind CLIENT
// Disconnect not an actual error even though an exception is recorded. // Disconnect not an actual error even though an exception is recorded.
errored false
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -492,7 +482,7 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
kind CLIENT kind CLIENT
if (Boolean.getBoolean("testLatestDeps")) { if (Boolean.getBoolean("testLatestDeps")) {
// Seems to only be treated as an error with Lettuce 6+ // Seems to only be treated as an error with Lettuce 6+
errored true status ERROR
} }
attributes { attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP" "${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -108,7 +109,7 @@ class Netty38ClientTest extends HttpClientTest<Request> implements AgentTestTrai
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
Class errorClass = ConnectException Class errorClass = ConnectException
try { try {
errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException') errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException')

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -105,7 +106,7 @@ class Netty38ClientTest extends HttpClientTest<Request> implements AgentTestTrai
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
Class errorClass = ConnectException Class errorClass = ConnectException
try { try {
errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException') errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException')

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -118,7 +119,7 @@ class Netty40ClientTest extends HttpClientTest<DefaultFullHttpRequest> implement
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
Class errorClass = ConnectException Class errorClass = ConnectException
try { try {
errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException') errorClass = Class.forName('io.netty.channel.AbstractChannel$AnnotatedConnectException')

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT import static io.opentelemetry.instrumentation.test.utils.PortUtils.UNUSABLE_PORT
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -185,7 +186,7 @@ class Netty41ClientTest extends HttpClientTest<DefaultFullHttpRequest> implement
name "CONNECT" name "CONNECT"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(thrownException.class, ~/Connection refused:( no further information:)? localhost\/\[?[0-9.:]+\]?:$UNUSABLE_PORT/) errorEvent(thrownException.class, ~/Connection refused:( no further information:)? localhost\/\[?[0-9.:]+\]?:$UNUSABLE_PORT/)
} }
} }
@ -273,19 +274,18 @@ class Netty41ClientTest extends HttpClientTest<DefaultFullHttpRequest> implement
def annotatedClass = new TracedClass() def annotatedClass = new TracedClass()
when: when:
def status = runUnderTrace("parent") { def responseCode = runUnderTrace("parent") {
annotatedClass.tracedMethod(method) annotatedClass.tracedMethod(method)
} }
then: then:
status == 200 responseCode == 200
assertTraces(1) { assertTraces(1) {
trace(0, 4) { trace(0, 4) {
basicSpan(it, 0, "parent") basicSpan(it, 0, "parent")
span(1) { span(1) {
childOf span(0) childOf span(0)
name "tracedMethod" name "tracedMethod"
errored false
attributes { attributes {
} }
} }

View File

@ -3,18 +3,18 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import io.opentelemetry.extension.annotations.WithSpan
import io.opentelemetry.instrumentation.test.utils.TraceUtils
import java.lang.reflect.Modifier
import java.util.concurrent.CompletableFuture
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.PRODUCER import static io.opentelemetry.api.trace.SpanKind.PRODUCER
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.extension.annotations.WithSpan
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.TraceUtils
import io.opentelemetry.test.annotation.TracedWithSpan import io.opentelemetry.test.annotation.TracedWithSpan
import java.lang.reflect.Modifier
import java.util.concurrent.CompletableFuture
import net.bytebuddy.ByteBuddy import net.bytebuddy.ByteBuddy
import net.bytebuddy.ClassFileVersion import net.bytebuddy.ClassFileVersion
import net.bytebuddy.asm.MemberAttributeExtension import net.bytebuddy.asm.MemberAttributeExtension
@ -38,9 +38,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.otel" name "TracedWithSpan.otel"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -58,7 +57,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "manualName" name "manualName"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -77,7 +75,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.oneOfAKind" name "TracedWithSpan.oneOfAKind"
kind PRODUCER kind PRODUCER
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -96,14 +93,12 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.server" name "TracedWithSpan.server"
kind SERVER kind SERVER
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "TracedWithSpan.otel" name "TracedWithSpan.otel"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
} }
} }
@ -122,7 +117,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.nestedServers" name "TracedWithSpan.nestedServers"
kind SERVER kind SERVER
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -141,7 +135,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.nestedClients" name "TracedWithSpan.nestedClients"
kind CLIENT kind CLIENT
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -168,9 +161,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completionStage" name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -193,9 +185,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completionStage" name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -214,9 +205,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completionStage" name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -240,9 +231,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completionStage" name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -260,9 +251,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completionStage" name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -280,9 +270,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completableFuture" name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -305,9 +294,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completableFuture" name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -326,9 +314,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completableFuture" name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -352,9 +340,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completableFuture" name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -372,9 +360,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completableFuture" name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -397,11 +384,11 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
.name("GeneratedJava6TestClass") .name("GeneratedJava6TestClass")
.implement(Runnable) .implement(Runnable)
.defineMethod("run", void.class, Modifier.PUBLIC).intercept(MethodDelegation.to(new Object() { .defineMethod("run", void.class, Modifier.PUBLIC).intercept(MethodDelegation.to(new Object() {
@RuntimeType @RuntimeType
void intercept(@This Object o) { void intercept(@This Object o) {
TraceUtils.runUnderTrace("intercept", {}) TraceUtils.runUnderTrace("intercept", {})
} }
})) }))
.visit(new MemberAttributeExtension.ForMethod() .visit(new MemberAttributeExtension.ForMethod()
.annotateMethod(AnnotationDescription.Builder.ofType(WithSpan).build()) .annotateMethod(AnnotationDescription.Builder.ofType(WithSpan).build())
.on(ElementMatchers.named("run"))) .on(ElementMatchers.named("run")))
@ -417,17 +404,15 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "GeneratedJava6TestClass.run" name "GeneratedJava6TestClass.run"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
span(1) { span(1) {
name "intercept" name "intercept"
kind SpanKind.INTERNAL kind INTERNAL
childOf(span(0)) childOf(span(0))
errored false
attributes { attributes {
} }
} }

View File

@ -12,6 +12,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -70,8 +71,8 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
trace.span(index) { trace.span(index) {
name "play.request" name "play.request"
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
childOf((SpanData) parent) childOf((SpanData) parent)
@ -82,5 +83,4 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
String expectedServerSpanName(ServerEndpoint endpoint) { String expectedServerSpanName(ServerEndpoint endpoint) {
return "HTTP GET" return "HTTP GET"
} }
} }

View File

@ -12,6 +12,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -72,9 +73,9 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
trace.span(index) { trace.span(index) {
name "play.request" name "play.request"
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent) childOf((SpanData) parent)
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
} }

View File

@ -6,6 +6,7 @@
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.CONSUMER import static io.opentelemetry.api.trace.SpanKind.CONSUMER
import static io.opentelemetry.api.trace.SpanKind.PRODUCER import static io.opentelemetry.api.trace.SpanKind.PRODUCER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import com.rabbitmq.client.AMQP import com.rabbitmq.client.AMQP
@ -350,8 +351,8 @@ class RabbitMQTest extends AgentInstrumentationSpecification {
hasLink((SpanData) linkSpan) hasLink((SpanData) linkSpan)
} }
errored exception != null
if (exception) { if (exception) {
status ERROR
errorEvent(exception.class, errorMsg) errorEvent(exception.class, errorMsg)
} }

View File

@ -73,7 +73,6 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
name "/$route" name "/$route"
kind SERVER kind SERVER
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -89,7 +88,6 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
name "/$route" name "/$route"
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored false
attributes { attributes {
} }
} }

View File

@ -13,6 +13,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -112,9 +113,9 @@ class RatpackHttpServerTest extends HttpServerTest<EmbeddedApp> implements Agent
trace.span(index) { trace.span(index) {
name endpoint.status == 404 ? "/" : endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.path name endpoint.status == 404 ? "/" : endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.path
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent) childOf((SpanData) parent)
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
} }

View File

@ -5,6 +5,7 @@
package io.opentelemetry.instrumentation.reactor package io.opentelemetry.instrumentation.reactor
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runInternalSpan
@ -97,7 +98,7 @@ abstract class AbstractReactorCoreTest extends InstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "trace-parent" name "trace-parent"
errored true status ERROR
errorEvent(RuntimeException, EXCEPTION_MESSAGE) errorEvent(RuntimeException, EXCEPTION_MESSAGE)
hasNoParent() hasNoParent()
} }
@ -128,7 +129,7 @@ abstract class AbstractReactorCoreTest extends InstrumentationSpecification {
trace(0, workSpans + 2) { trace(0, workSpans + 2) {
span(0) { span(0) {
name "trace-parent" name "trace-parent"
errored true status ERROR
errorEvent(RuntimeException, EXCEPTION_MESSAGE) errorEvent(RuntimeException, EXCEPTION_MESSAGE)
hasNoParent() hasNoParent()
} }

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -107,7 +108,7 @@ class RmiTest extends AgentInstrumentationSpecification {
name "rmi.app.Greeter/exceptional" name "rmi.app.Greeter/exceptional"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(RuntimeException, String) errorEvent(RuntimeException, String)
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "java_rmi" "${SemanticAttributes.RPC_SYSTEM.key}" "java_rmi"
@ -119,7 +120,7 @@ class RmiTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "rmi.app.Server/exceptional" name "rmi.app.Server/exceptional"
kind SERVER kind SERVER
errored true status ERROR
errorEvent(RuntimeException, String) errorEvent(RuntimeException, String)
attributes { attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "java_rmi" "${SemanticAttributes.RPC_SYSTEM.key}" "java_rmi"

View File

@ -3,7 +3,9 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import io.opentelemetry.api.trace.SpanKind import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.rxjava2.TracedWithSpan import io.opentelemetry.instrumentation.rxjava2.TracedWithSpan
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.reactivex.Completable import io.reactivex.Completable
@ -38,9 +40,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -68,9 +69,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -93,9 +93,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -125,9 +125,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -151,9 +151,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -164,7 +163,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already empty Maybe"() { def "should capture span for already empty Maybe"() {
setup: setup:
def observer = new TestObserver() def observer = new TestObserver()
def source = Maybe.<String>empty() def source = Maybe.<String> empty()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
.subscribe(observer) .subscribe(observer)
@ -175,9 +174,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -187,7 +185,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Maybe"() { def "should capture span for eventually completed Maybe"() {
setup: setup:
def source = MaybeSubject.<String>create() def source = MaybeSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
@ -206,9 +204,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -220,7 +217,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Maybe.<String>error(error) def source = Maybe.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
.subscribe(observer) .subscribe(observer)
@ -231,9 +228,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -245,7 +242,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Maybe"() { def "should capture span for eventually errored Maybe"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = MaybeSubject.<String>create() def source = MaybeSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
@ -263,9 +260,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -289,9 +286,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -301,7 +297,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Single"() { def "should capture span for eventually completed Single"() {
setup: setup:
def source = SingleSubject.<String>create() def source = SingleSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
@ -320,9 +316,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -334,7 +329,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Single.<String>error(error) def source = Single.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
.subscribe(observer) .subscribe(observer)
@ -345,9 +340,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -359,7 +354,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Single"() { def "should capture span for eventually errored Single"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = SingleSubject.<String>create() def source = SingleSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
@ -377,9 +372,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -391,7 +386,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed Observable"() { def "should capture span for already completed Observable"() {
setup: setup:
def observer = new TestObserver() def observer = new TestObserver()
def source = Observable.<String>just("Value") def source = Observable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
.subscribe(observer) .subscribe(observer)
@ -403,9 +398,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -415,7 +409,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Observable"() { def "should capture span for eventually completed Observable"() {
setup: setup:
def source = UnicastSubject.<String>create() def source = UnicastSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
@ -439,9 +433,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -453,7 +446,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Observable.<String>error(error) def source = Observable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
.subscribe(observer) .subscribe(observer)
@ -464,9 +457,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -478,7 +471,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Observable"() { def "should capture span for eventually errored Observable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastSubject.<String>create() def source = UnicastSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
@ -502,9 +495,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -516,7 +509,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed Flowable"() { def "should capture span for already completed Flowable"() {
setup: setup:
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>just("Value") def source = Flowable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
.subscribe(observer) .subscribe(observer)
@ -528,9 +521,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -540,7 +532,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Flowable"() { def "should capture span for eventually completed Flowable"() {
setup: setup:
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
@ -564,9 +556,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -578,7 +569,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>error(error) def source = Flowable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
.subscribe(observer) .subscribe(observer)
@ -589,9 +580,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -603,7 +594,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Flowable"() { def "should capture span for eventually errored Flowable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
@ -627,9 +618,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -641,7 +632,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed ParallelFlowable"() { def "should capture span for already completed ParallelFlowable"() {
setup: setup:
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>just("Value") def source = Flowable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
.sequential() .sequential()
@ -654,9 +645,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -666,7 +656,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed ParallelFlowable"() { def "should capture span for eventually completed ParallelFlowable"() {
setup: setup:
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
@ -691,9 +681,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -705,7 +694,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>error(error) def source = Flowable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
.sequential() .sequential()
@ -717,9 +706,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -731,7 +720,7 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored ParallelFlowable"() { def "should capture span for eventually errored ParallelFlowable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
@ -756,9 +745,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -787,9 +776,8 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.publisher" name "TracedWithSpan.publisher"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -818,9 +806,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.publisher" name "TracedWithSpan.publisher"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -847,9 +835,9 @@ class RxJava2WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
} }
@Override @Override
void request(long l) { } void request(long l) {}
@Override @Override
void cancel() { } void cancel() {}
} }
} }

View File

@ -3,7 +3,9 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import io.opentelemetry.api.trace.SpanKind import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.rxjava3.TracedWithSpan import io.opentelemetry.instrumentation.rxjava3.TracedWithSpan
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.reactivex.rxjava3.core.Completable import io.reactivex.rxjava3.core.Completable
@ -38,9 +40,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -67,9 +68,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -92,9 +92,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -123,9 +123,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.completable" name "TracedWithSpan.completable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -149,9 +149,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -162,7 +161,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already empty Maybe"() { def "should capture span for already empty Maybe"() {
setup: setup:
def observer = new TestObserver() def observer = new TestObserver()
def source = Maybe.<String>empty() def source = Maybe.<String> empty()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
.subscribe(observer) .subscribe(observer)
@ -173,9 +172,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -185,7 +183,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Maybe"() { def "should capture span for eventually completed Maybe"() {
setup: setup:
def source = MaybeSubject.<String>create() def source = MaybeSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
@ -203,9 +201,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -217,7 +214,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Maybe.<String>error(error) def source = Maybe.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
.subscribe(observer) .subscribe(observer)
@ -228,9 +225,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -242,7 +239,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Maybe"() { def "should capture span for eventually errored Maybe"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = MaybeSubject.<String>create() def source = MaybeSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.maybe(source) .maybe(source)
@ -259,9 +256,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.maybe" name "TracedWithSpan.maybe"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -285,9 +282,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -297,7 +293,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Single"() { def "should capture span for eventually completed Single"() {
setup: setup:
def source = SingleSubject.<String>create() def source = SingleSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
@ -315,9 +311,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -329,7 +324,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Single.<String>error(error) def source = Single.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
.subscribe(observer) .subscribe(observer)
@ -340,9 +335,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -354,7 +349,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Single"() { def "should capture span for eventually errored Single"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = SingleSubject.<String>create() def source = SingleSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.single(source) .single(source)
@ -371,9 +366,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.single" name "TracedWithSpan.single"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -385,7 +380,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed Observable"() { def "should capture span for already completed Observable"() {
setup: setup:
def observer = new TestObserver() def observer = new TestObserver()
def source = Observable.<String>just("Value") def source = Observable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
.subscribe(observer) .subscribe(observer)
@ -397,9 +392,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -409,7 +403,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Observable"() { def "should capture span for eventually completed Observable"() {
setup: setup:
def source = UnicastSubject.<String>create() def source = UnicastSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
@ -432,9 +426,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -446,7 +439,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestObserver() def observer = new TestObserver()
def source = Observable.<String>error(error) def source = Observable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
.subscribe(observer) .subscribe(observer)
@ -457,9 +450,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -471,7 +464,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Observable"() { def "should capture span for eventually errored Observable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastSubject.<String>create() def source = UnicastSubject.<String> create()
def observer = new TestObserver() def observer = new TestObserver()
new TracedWithSpan() new TracedWithSpan()
.observable(source) .observable(source)
@ -494,9 +487,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.observable" name "TracedWithSpan.observable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -508,7 +501,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed Flowable"() { def "should capture span for already completed Flowable"() {
setup: setup:
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>just("Value") def source = Flowable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
.subscribe(observer) .subscribe(observer)
@ -520,9 +513,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -532,7 +524,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed Flowable"() { def "should capture span for eventually completed Flowable"() {
setup: setup:
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
@ -555,9 +547,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -569,7 +560,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>error(error) def source = Flowable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
.subscribe(observer) .subscribe(observer)
@ -580,9 +571,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -594,7 +585,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored Flowable"() { def "should capture span for eventually errored Flowable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.flowable(source) .flowable(source)
@ -617,9 +608,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.flowable" name "TracedWithSpan.flowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -631,7 +622,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for already completed ParallelFlowable"() { def "should capture span for already completed ParallelFlowable"() {
setup: setup:
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>just("Value") def source = Flowable.<String> just("Value")
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
.sequential() .sequential()
@ -644,9 +635,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -656,7 +646,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually completed ParallelFlowable"() { def "should capture span for eventually completed ParallelFlowable"() {
setup: setup:
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
@ -680,9 +670,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -694,7 +683,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def observer = new TestSubscriber() def observer = new TestSubscriber()
def source = Flowable.<String>error(error) def source = Flowable.<String> error(error)
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
.sequential() .sequential()
@ -706,9 +695,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -720,7 +709,7 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
def "should capture span for eventually errored ParallelFlowable"() { def "should capture span for eventually errored ParallelFlowable"() {
setup: setup:
def error = new IllegalArgumentException("Boom") def error = new IllegalArgumentException("Boom")
def source = UnicastProcessor.<String>create() def source = UnicastProcessor.<String> create()
def observer = new TestSubscriber() def observer = new TestSubscriber()
new TracedWithSpan() new TracedWithSpan()
.parallelFlowable(source.parallel()) .parallelFlowable(source.parallel())
@ -744,9 +733,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.parallelFlowable" name "TracedWithSpan.parallelFlowable"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -774,9 +763,8 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.publisher" name "TracedWithSpan.publisher"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -804,9 +792,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
trace(0, 1) { trace(0, 1) {
span(0) { span(0) {
name "TracedWithSpan.publisher" name "TracedWithSpan.publisher"
kind SpanKind.INTERNAL kind INTERNAL
hasNoParent() hasNoParent()
errored true status ERROR
errorEvent(IllegalArgumentException, "Boom") errorEvent(IllegalArgumentException, "Boom")
attributes { attributes {
} }
@ -833,9 +821,9 @@ class RxJava3WithSpanInstrumentationTest extends AgentInstrumentationSpecificati
} }
@Override @Override
void request(long l) { } void request(long l) {}
@Override @Override
void cancel() { } void cancel() {}
} }
} }

View File

@ -26,7 +26,6 @@ class SlickTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "run query" name "run query"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -34,7 +33,6 @@ class SlickTest extends AgentInstrumentationSpecification {
name "SELECT ${SlickUtils.Db()}" name "SELECT ${SlickUtils.Db()}"
kind CLIENT kind CLIENT
childOf span(0) childOf span(0)
errored false
attributes { attributes {
"$SemanticAttributes.DB_SYSTEM.key" "h2" "$SemanticAttributes.DB_SYSTEM.key" "h2"
"$SemanticAttributes.DB_NAME.key" SlickUtils.Db() "$SemanticAttributes.DB_NAME.key" SlickUtils.Db()

View File

@ -81,7 +81,6 @@ class JettyServlet2Test extends HttpServerTest<Server> implements AgentTestTrait
trace.span(index) { trace.span(index) {
name endpoint == REDIRECT ? "Response.sendRedirect" : "Response.sendError" name endpoint == REDIRECT ? "Response.sendRedirect" : "Response.sendError"
kind INTERNAL kind INTERNAL
errored false
childOf((SpanData) parent) childOf((SpanData) parent)
attributes { attributes {
} }

View File

@ -3,6 +3,8 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.base.HttpServerTestTrait import io.opentelemetry.instrumentation.test.base.HttpServerTestTrait
@ -56,7 +58,9 @@ abstract class AbstractServletMappingTest<SERVER, CONTEXT> extends AgentInstrume
span(0) { span(0) {
name getContextPath() + spanName name getContextPath() + spanName
kind SpanKind.SERVER kind SpanKind.SERVER
errored !success if (!success) {
status ERROR
}
} }
if (!success) { if (!success) {
span(1) { span(1) {
@ -66,13 +70,13 @@ abstract class AbstractServletMappingTest<SERVER, CONTEXT> extends AgentInstrume
} }
where: where:
path | spanName | success path | spanName | success
'prefix' | '/prefix/*' | true 'prefix' | '/prefix/*' | true
'prefix/' | '/prefix/*' | true 'prefix/' | '/prefix/*' | true
'prefix/a' | '/prefix/*' | true 'prefix/a' | '/prefix/*' | true
'prefixa' | '/*' | false 'prefixa' | '/*' | false
'a.suffix' | '/*.suffix' | true 'a.suffix' | '/*.suffix' | true
'.suffix' | '/*.suffix' | true '.suffix' | '/*.suffix' | true
'suffix' | '/*' | false 'suffix' | '/*' | false
} }
} }

View File

@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static java.util.Collections.emptyEnumeration import static java.util.Collections.emptyEnumeration
@ -108,7 +109,7 @@ class HttpServletResponseTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name 'HttpServletResponseTest$2.sendRedirect' name 'HttpServletResponseTest$2.sendRedirect'
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(ex.class, ex.message) errorEvent(ex.class, ex.message)
} }
} }

View File

@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
@ -121,7 +122,7 @@ class RequestDispatcherTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name "TestDispatcher.$operation" name "TestDispatcher.$operation"
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(ex.class, ex.message) errorEvent(ex.class, ex.message)
} }
basicSpan(it, 2, "$operation-child", span(1)) basicSpan(it, 2, "$operation-child", span(1))

View File

@ -48,7 +48,6 @@ class SparkJavaBasedTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "/param/:param" name "/param/:param"
kind SERVER kind SERVER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static java.util.Collections.emptyMap import static java.util.Collections.emptyMap
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -61,7 +62,7 @@ abstract class SpringBatchTest extends AgentInstrumentationSpecification {
name "BatchJob taskletJob.step.Chunk" name "BatchJob taskletJob.step.Chunk"
kind INTERNAL kind INTERNAL
childOf span(1) childOf span(1)
errored true status ERROR
errorEvent RuntimeException, "fail" errorEvent RuntimeException, "fail"
} }
} }

View File

@ -61,7 +61,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "JpaRepository.findAll" name "JpaRepository.findAll"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -94,7 +93,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CrudRepository.save" name "CrudRepository.save"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -127,7 +125,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CrudRepository.save" name "CrudRepository.save"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -172,7 +169,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "JpaCustomerRepository.findByLastName" name "JpaCustomerRepository.findByLastName"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -203,7 +199,6 @@ class SpringJpaTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "CrudRepository.delete" name "CrudRepository.delete"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }

View File

@ -23,7 +23,6 @@ class SpringSchedulingTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "TriggerTask.run" name "TriggerTask.run"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -45,7 +44,6 @@ class SpringSchedulingTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "IntervalTask.run" name "IntervalTask.run"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -67,7 +65,6 @@ class SpringSchedulingTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
nameContains "LambdaTaskConfigurer\$\$Lambda\$" nameContains "LambdaTaskConfigurer\$\$Lambda\$"
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }

View File

@ -5,6 +5,7 @@
import static io.opentelemetry.api.trace.SpanKind.INTERNAL import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.SERVER import static io.opentelemetry.api.trace.SpanKind.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.OkHttpUtils import io.opentelemetry.instrumentation.test.utils.OkHttpUtils
@ -161,7 +162,6 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "tracedMethod" name "tracedMethod"
childOf span(0) childOf span(0)
errored false
attributes { attributes {
} }
} }
@ -249,7 +249,6 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(2) { span(2) {
name "tracedMethod" name "tracedMethod"
childOf span(annotatedMethod ? 0 : 1) childOf span(annotatedMethod ? 0 : 1)
errored false
attributes { attributes {
} }
} }
@ -278,7 +277,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
name "/**" name "/**"
kind SERVER kind SERVER
hasNoParent() hasNoParent()
errored true status ERROR
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -294,7 +293,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
name "ResourceWebHandler.handle" name "ResourceWebHandler.handle"
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(ResponseStatusException, String) errorEvent(ResponseStatusException, String)
attributes { attributes {
"spring-webflux.handler.type" "org.springframework.web.reactive.resource.ResourceWebHandler" "spring-webflux.handler.type" "org.springframework.web.reactive.resource.ResourceWebHandler"
@ -370,7 +369,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name urlPathWithVariables name urlPathWithVariables
kind SERVER kind SERVER
errored true status ERROR
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1" "${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -393,7 +392,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
} }
kind INTERNAL kind INTERNAL
childOf span(0) childOf span(0)
errored true status ERROR
errorEvent(RuntimeException, "bad things happen") errorEvent(RuntimeException, "bad things happen")
attributes { attributes {
if (annotatedMethod == null) { if (annotatedMethod == null) {

View File

@ -14,6 +14,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -155,7 +156,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) { trace.span(index) {
name "BasicErrorController.error" name "BasicErrorController.error"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -167,7 +167,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) { trace.span(index) {
name responseSpanName name responseSpanName
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
} }
} }
@ -178,7 +177,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) { trace.span(index) {
name "Render RedirectView" name "Render RedirectView"
kind INTERNAL kind INTERNAL
errored false
attributes { attributes {
"spring-webmvc.view.type" RedirectView.simpleName "spring-webmvc.view.type" RedirectView.simpleName
} }
@ -194,8 +192,8 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) { trace.span(index) {
name handlerSpanName name handlerSpanName
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
childOf((SpanData) parent) childOf((SpanData) parent)

View File

@ -12,6 +12,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -84,9 +85,9 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index) { trace.span(index) {
name "TestController.${endpoint.name().toLowerCase()}" name "TestController.${endpoint.name().toLowerCase()}"
kind INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent) childOf((SpanData) parent)
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
} }
@ -107,7 +108,6 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index) { trace.span(index) {
name "ApplicationDispatcher.forward" name "ApplicationDispatcher.forward"
kind INTERNAL kind INTERNAL
errored false
childOf((SpanData) parent) childOf((SpanData) parent)
attributes { attributes {
} }
@ -115,7 +115,6 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index + 1) { trace.span(index + 1) {
name "BasicErrorController.error" name "BasicErrorController.error"
kind INTERNAL kind INTERNAL
errored false
childOf(trace.span(index)) childOf(trace.span(index))
attributes { attributes {
} }

View File

@ -5,6 +5,9 @@
package test.boot package test.boot
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.api.trace.StatusCode.ERROR
import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
@ -123,7 +126,9 @@ class SpringWsTest extends AgentInstrumentationSpecification implements HttpServ
hasNoParent() hasNoParent()
name operation name operation
kind SpanKind.SERVER kind SpanKind.SERVER
errored exception != null if (exception != null) {
status ERROR
}
} }
} }
@ -135,9 +140,9 @@ class SpringWsTest extends AgentInstrumentationSpecification implements HttpServ
childOf((SpanData) parentSpan) childOf((SpanData) parentSpan)
} }
name "HelloEndpoint." + methodName name "HelloEndpoint." + methodName
kind SpanKind.INTERNAL kind INTERNAL
errored exception != null
if (exception) { if (exception) {
status ERROR
errorEvent(exception.class, exception.message) errorEvent(exception.class, exception.message)
} }
attributes { attributes {

View File

@ -4,6 +4,7 @@
*/ */
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static net.spy.memcached.ConnectionFactoryBuilder.Protocol.BINARY import static net.spy.memcached.ConnectionFactoryBuilder.Protocol.BINARY
@ -592,7 +593,6 @@ class SpymemcachedTest extends AgentInstrumentationSpecification {
return trace.span(index) { return trace.span(index) {
name parentOperation name parentOperation
hasNoParent() hasNoParent()
errored false
attributes { attributes {
} }
} }
@ -606,7 +606,9 @@ class SpymemcachedTest extends AgentInstrumentationSpecification {
name operation name operation
kind CLIENT kind CLIENT
errored(error != null && error != "canceled") if (error != null && error != "canceled") {
status ERROR
}
if (error == "timeout") { if (error == "timeout") {
errorEvent( errorEvent(

View File

@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.SpanKind.INTERNAL
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.ERROR import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.ERROR
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.EXCEPTION import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.EXCEPTION
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.PATH_PARAM
@ -10,7 +11,7 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicServerSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicServerSpan
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -73,9 +74,9 @@ class Struts2ActionSpanTest extends HttpServerTest<Server> implements AgentTestT
void handlerSpan(TraceAssert trace, int index, Object parent, String method, ServerEndpoint endpoint) { void handlerSpan(TraceAssert trace, int index, Object parent, String method, ServerEndpoint endpoint) {
trace.span(index) { trace.span(index) {
name "GreetingAction.${endpoint.name().toLowerCase()}" name "GreetingAction.${endpoint.name().toLowerCase()}"
kind SpanKind.INTERNAL kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) { if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body) errorEvent(Exception, EXCEPTION.body)
} }
def expectedMethodName = endpoint.name().toLowerCase() def expectedMethodName = endpoint.name().toLowerCase()

View File

@ -3,6 +3,7 @@
* SPDX-License-Identifier: Apache-2.0 * SPDX-License-Identifier: Apache-2.0
*/ */
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicSpan
import io.opentelemetry.api.trace.SpanKind import io.opentelemetry.api.trace.SpanKind
@ -123,7 +124,7 @@ class TapestryTest extends AgentInstrumentationSpecification implements HttpServ
hasNoParent() hasNoParent()
kind SpanKind.SERVER kind SpanKind.SERVER
name getContextPath() + "/Index" name getContextPath() + "/Index"
errored true status ERROR
} }
basicSpan(it, 1, "activate/Index", span(0)) basicSpan(it, 1, "activate/Index", span(0))
basicSpan(it, 2, "action/Index:exception", span(0), new IllegalStateException("expected")) basicSpan(it, 2, "action/Index:exception", span(0), new IllegalStateException("expected"))

View File

@ -6,6 +6,7 @@
package test package test
import static io.opentelemetry.api.trace.SpanKind.CLIENT import static io.opentelemetry.api.trace.SpanKind.CLIENT
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import com.fasterxml.jackson.databind.ObjectMapper import com.fasterxml.jackson.databind.ObjectMapper
@ -135,7 +136,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -143,7 +143,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name "MessageCreator.create" name "MessageCreator.create"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -179,7 +178,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -187,7 +185,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name "CallCreator.create" name "CallCreator.create"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Call" "twilio.type" "com.twilio.rest.api.v2010.account.Call"
"twilio.account" "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" "twilio.account" "ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
@ -245,7 +242,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -254,7 +250,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
name "MessageCreator.create" name "MessageCreator.create"
kind CLIENT kind CLIENT
childOf(span(0)) childOf(span(0))
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -327,7 +322,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -336,7 +330,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
name "MessageCreator.create" name "MessageCreator.create"
kind CLIENT kind CLIENT
childOf(span(0)) childOf(span(0))
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -416,7 +409,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -425,7 +417,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
name "MessageCreator.createAsync" name "MessageCreator.createAsync"
kind CLIENT kind CLIENT
childOf(span(0)) childOf(span(0))
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -466,14 +457,14 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored true status ERROR
errorEvent(ApiException, "Testing Failure") errorEvent(ApiException, "Testing Failure")
hasNoParent() hasNoParent()
} }
span(1) { span(1) {
name "MessageCreator.create" name "MessageCreator.create"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent(ApiException, "Testing Failure") errorEvent(ApiException, "Testing Failure")
} }
} }
@ -502,7 +493,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
name "MessageCreator.create" name "MessageCreator.create"
kind CLIENT kind CLIENT
hasNoParent() hasNoParent()
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -547,7 +537,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored false
hasNoParent() hasNoParent()
attributes { attributes {
} }
@ -555,7 +544,6 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
span(1) { span(1) {
name "MessageCreator.createAsync" name "MessageCreator.createAsync"
kind CLIENT kind CLIENT
errored false
attributes { attributes {
"twilio.type" "com.twilio.rest.api.v2010.account.Message" "twilio.type" "com.twilio.rest.api.v2010.account.Message"
"twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7" "twilio.account" "AC14984e09e497506cf0d5eb59b1f6ace7"
@ -607,14 +595,14 @@ class TwilioClientTest extends AgentInstrumentationSpecification {
trace(0, 2) { trace(0, 2) {
span(0) { span(0) {
name "test" name "test"
errored true status ERROR
errorEvent(ApiException, "Testing Failure") errorEvent(ApiException, "Testing Failure")
hasNoParent() hasNoParent()
} }
span(1) { span(1) {
name "MessageCreator.createAsync" name "MessageCreator.createAsync"
kind CLIENT kind CLIENT
errored true status ERROR
errorEvent(ApiException, "Testing Failure") errorEvent(ApiException, "Testing Failure")
} }
} }

View File

@ -53,7 +53,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
span(0) { span(0) {
name "/listProducts" name "/listProducts"
kind SERVER kind SERVER
errored false
hasNoParent() hasNoParent()
attributes { attributes {
"${SemanticAttributes.NET_PEER_PORT.key}" Long "${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -72,7 +71,6 @@ class VertxReactivePropagationTest extends AgentInstrumentationSpecification {
name "SELECT test.products" name "SELECT test.products"
kind CLIENT kind CLIENT
childOf span(2) childOf span(2)
errored false
attributes { attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "hsqldb" "${SemanticAttributes.DB_SYSTEM.key}" "hsqldb"
"${SemanticAttributes.DB_NAME.key}" "test" "${SemanticAttributes.DB_NAME.key}" "test"

View File

@ -125,16 +125,6 @@ class SpanAssert {
checked.status = true checked.status = true
} }
def errored(boolean errored) {
if (errored) {
// comparing only canonical code, since description may be different
assert span.status.statusCode == StatusCode.ERROR
} else {
assert span.status.statusCode == StatusCode.UNSET
}
checked.status = true
}
def errorEvent(Class<Throwable> errorType) { def errorEvent(Class<Throwable> errorType) {
errorEvent(errorType, null) errorEvent(errorType, null)
} }
@ -158,7 +148,7 @@ class SpanAssert {
void assertDefaults() { void assertDefaults() {
if (!checked.status) { if (!checked.status) {
errored(false) status(StatusCode.UNSET)
} }
if (!checked.kind) { if (!checked.kind) {
kind(SpanKind.INTERNAL) kind(SpanKind.INTERNAL)

Some files were not shown because too many files have changed in this diff Show More