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.StatusCode.ERROR
import akka.actor.ActorSystem
import akka.http.javadsl.Http
@ -84,7 +85,7 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<HttpRequest> impl
hasNoParent()
name "HTTP request"
kind CLIENT
errored true
status ERROR
errorEvent(NullPointerException, e.getMessage())
}
}

View File

@ -5,6 +5,11 @@
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.impl.HelloServiceImpl
import io.opentelemetry.instrumentation.test.InstrumentationSpecification
@ -22,11 +27,6 @@ import org.apache.dubbo.rpc.service.GenericService
import spock.lang.Shared
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
abstract class AbstractDubboTest extends InstrumentationSpecification {
@ -93,7 +93,6 @@ abstract class AbstractDubboTest extends InstrumentationSpecification {
name "org.apache.dubbo.rpc.service.GenericService/\$invoke"
kind CLIENT
childOf span(0)
errored false
attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${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"
kind SERVER
childOf span(1)
errored false
attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${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"
kind CLIENT
childOf span(0)
errored false
attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${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"
kind SERVER
childOf span(1)
errored false
attributes {
"${SemanticAttributes.RPC_SYSTEM.key}" "dubbo"
"${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
Integer statusOnRedirectError() {
Integer responseCodeOnRedirectError() {
return 302
}

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.awslambda.v1_0
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.RequestStreamHandler
@ -120,7 +121,7 @@ class TracingRequestStreamWrapperPropagationTest extends LibraryInstrumentationS
traceId("4fd0b6131f19f39af59518d127b0cafe")
name("my_function")
kind SERVER
errored true
status ERROR
errorEvent(IllegalArgumentException, "bad argument")
attributes {
"${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333"

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.awslambda.v1_0
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.RequestStreamHandler
@ -102,7 +103,7 @@ class TracingRequestStreamWrapperTest extends LibraryInstrumentationSpecificatio
span(0) {
name("my_function")
kind SERVER
errored true
status ERROR
errorEvent(IllegalArgumentException, "bad argument")
attributes {
"$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
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.RequestHandler
@ -68,7 +69,7 @@ class TracingRequestWrapperTest extends TracingRequestWrapperTestBase {
span(0) {
name("my_function")
kind SERVER
errored true
status ERROR
errorEvent(IllegalArgumentException, "bad argument")
attributes {
"$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
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.RequestHandler
import com.github.stefanbirkner.systemlambda.SystemLambda
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
import io.opentelemetry.instrumentation.test.InstrumentationSpecification
import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecification {
@ -67,7 +68,7 @@ abstract class AbstractAwsLambdaRequestHandlerTest extends InstrumentationSpecif
span(0) {
name("my_function")
kind SERVER
errored true
status ERROR
errorEvent(IllegalArgumentException, "bad argument")
attributes {
"${SemanticAttributes.FAAS_EXECUTION.key}" "1-22-333"

View File

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

View File

@ -4,6 +4,7 @@
*/
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.utils.PortUtils.UNUSABLE_PORT
@ -101,7 +102,6 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -160,7 +160,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored true
status ERROR
errorEvent AmazonClientException, ~/Unable to execute HTTP request/
hasNoParent()
attributes {
@ -208,7 +208,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) {
name "S3.GetObject"
kind CLIENT
errored true
status ERROR
errorEvent RuntimeException, "bad handler"
hasNoParent()
attributes {
@ -254,7 +254,7 @@ class Aws0ClientTest extends AgentInstrumentationSpecification {
span(0) {
name "S3.GetObject"
kind CLIENT
errored true
status ERROR
errorEvent AmazonClientException, ~/Unable to execute HTTP request/
hasNoParent()
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.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.utils.PortUtils.UNUSABLE_PORT
@ -94,7 +95,6 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) {
name "$service.$operation"
kind operation == "SendMessage" ? PRODUCER : CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -119,19 +119,19 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
server.lastRequest.headers.get("traceparent") == null
where:
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" | "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"] | ""
"Kinesis" | "DeleteStream" | "POST" | "/" | AmazonKinesisClientBuilder.standard() | { c -> c.deleteStream(new DeleteStreamRequest().withStreamName("somestream")) } | ["aws.stream.name": "somestream"] | ""
"EC2" | "AllocateAddress" | "POST" | "/" | AmazonEC2ClientBuilder.standard() | { c -> c.allocateAddress() } | [:] | """
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" | "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"] | ""
"Kinesis" | "DeleteStream" | "POST" | "/" | AmazonKinesisClientBuilder.standard() | { c -> c.deleteStream(new DeleteStreamRequest().withStreamName("somestream")) } | ["aws.stream.name": "somestream"] | ""
"EC2" | "AllocateAddress" | "POST" | "/" | AmazonEC2ClientBuilder.standard() | { c -> c.allocateAddress() } | [:] | """
<AllocateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2016-11-15/">
<requestId>59dbff89-35bd-4eac-99ed-be587EXAMPLE</requestId>
<publicIp>192.0.2.1</publicIp>
<domain>standard</domain>
</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/">
<ResponseMetadata>
<RequestId>0ac9cda2-bbf4-11d3-f92b-31fa5e8dbc99</RequestId>
@ -160,7 +160,7 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored true
status ERROR
errorEvent SdkClientException, ~/Unable to execute HTTP request/
hasNoParent()
attributes {
@ -183,8 +183,8 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
}
where:
service | operation | method | url | call | additionalAttributes | body | clientBuilder
"S3" | "GetObject" | "GET" | "someBucket/someKey" | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | "" | AmazonS3ClientBuilder.standard()
service | operation | method | url | call | additionalAttributes | body | clientBuilder
"S3" | "GetObject" | "GET" | "someBucket/someKey" | { c -> c.getObject("someBucket", "someKey") } | ["aws.bucket.name": "someBucket"] | "" | AmazonS3ClientBuilder.standard()
}
// TODO(anuraaga): Add events for retries.
@ -215,7 +215,7 @@ abstract class AbstractAws1ClientTest extends InstrumentationSpecification {
span(0) {
name "S3.GetObject"
kind CLIENT
errored true
status ERROR
try {
errorEvent AmazonClientException, ~/Unable to execute HTTP request/
} 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 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 io.opentelemetry.instrumentation.test.InstrumentationSpecification
@ -153,7 +154,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "DynamoDb.CreateTable"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -189,7 +189,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "DynamoDb.Query"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -224,7 +223,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -337,7 +335,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -426,7 +423,6 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "$service.$operation"
kind CLIENT
errored false
hasNoParent()
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
@ -526,7 +522,7 @@ abstract class AbstractAws2ClientTest extends InstrumentationSpecification {
span(0) {
name "S3.GetObject"
kind CLIENT
errored true
status ERROR
errorEvent SdkClientException, "Unable to execute HTTP request: Read timed out"
hasNoParent()
attributes {

View File

@ -16,7 +16,6 @@ class CouchbaseSpanUtil {
trace.span(index) {
name spanName
kind CLIENT
errored false
if (parentSpan == null) {
hasNoParent()
} else {
@ -41,7 +40,7 @@ class CouchbaseSpanUtil {
// that do have operation ids
"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) {
name spanName
kind CLIENT
errored false
if (parentSpan == null) {
hasNoParent()
} else {
@ -118,7 +117,7 @@ abstract class AbstractCouchbaseTest extends AgentInstrumentationSpecification {
if (bucketName != null) {
"${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.testing.ConfigOverride
import io.dropwizard.testing.DropwizardTestSupport
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -76,8 +77,8 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> implements Ag
trace.span(index) {
name "${this.testResource().simpleName}.${endpoint.name().toLowerCase()}"
kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
childOf((SpanData) parent)
@ -90,7 +91,9 @@ class DropwizardTest extends HttpServerTest<DropwizardTestSupport> implements Ag
trace.span(index) {
name "${endpoint == PATH_PARAM ? "/path/{id}/param" : endpoint.resolvePath(address).path}"
kind SERVER
errored endpoint.errored
if (endpoint.errored) {
status StatusCode.ERROR
}
if (parentID != null) {
traceId traceID
parentSpanId parentID

View File

@ -4,6 +4,7 @@
*/
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 org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -68,10 +69,10 @@ class Elasticsearch5NodeClientTest extends AgentInstrumentationSpecification {
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status
def clusterHealthStatus = result.get().status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -101,7 +102,7 @@ class Elasticsearch5NodeClientTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "GetAction"
errored true
status ERROR
errorEvent IndexNotFoundException, "no such index"
kind CLIENT
attributes {

View File

@ -4,6 +4,7 @@
*/
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 org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -84,10 +85,10 @@ class Elasticsearch5TransportClientTest extends AgentInstrumentationSpecificatio
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status
def clusterHealthStatus = result.get().status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -121,7 +122,7 @@ class Elasticsearch5TransportClientTest extends AgentInstrumentationSpecificatio
span(0) {
name "GetAction"
kind CLIENT
errored true
status ERROR
errorEvent RemoteTransportException, String
attributes {
"${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.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -71,10 +72,10 @@ class Elasticsearch53NodeClientTest extends AgentInstrumentationSpecification {
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status
def clusterHealthStatus = result.get().status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -105,7 +106,7 @@ class Elasticsearch53NodeClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GetAction"
kind CLIENT
errored true
status ERROR
errorEvent IndexNotFoundException, "no such index"
attributes {
"${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.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -89,10 +90,10 @@ class Elasticsearch53TransportClientTest extends AgentInstrumentationSpecificati
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status
def clusterHealthStatus = result.get().status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -126,7 +127,7 @@ class Elasticsearch53TransportClientTest extends AgentInstrumentationSpecificati
span(0) {
name "GetAction"
kind CLIENT
errored true
status ERROR
errorEvent RemoteTransportException, String
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

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

View File

@ -6,6 +6,7 @@
package springdata
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 org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -93,7 +94,7 @@ class Elasticsearch53SpringTemplateTest extends AgentInstrumentationSpecificatio
span(0) {
name "RefreshAction"
kind CLIENT
errored true
status ERROR
errorEvent IndexNotFoundException, "no such index"
attributes {
"${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.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -66,10 +67,10 @@ class Elasticsearch6NodeClientTest extends AgentInstrumentationSpecification {
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest()).get()
def status = result.status
def clusterHealthStatus = result.status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -100,7 +101,7 @@ class Elasticsearch6NodeClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GetAction"
kind CLIENT
errored true
status ERROR
errorEvent IndexNotFoundException, ~/no such index( \[invalid-index\])?/
attributes {
"${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.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderTrace
import static org.elasticsearch.cluster.ClusterName.CLUSTER_NAME_SETTING
@ -82,10 +83,10 @@ class Elasticsearch6TransportClientTest extends AgentInstrumentationSpecificatio
setup:
def result = client.admin().cluster().health(new ClusterHealthRequest())
def status = result.get().status
def clusterHealthStatus = result.get().status
expect:
status.name() == "GREEN"
clusterHealthStatus.name() == "GREEN"
assertTraces(1) {
trace(0, 1) {
@ -119,7 +120,7 @@ class Elasticsearch6TransportClientTest extends AgentInstrumentationSpecificatio
span(0) {
name "GetAction"
kind CLIENT
errored true
status ERROR
errorEvent RemoteTransportException, String
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "elasticsearch"

View File

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

View File

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

View File

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

View File

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

View File

@ -112,12 +112,10 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(0) {
name "someTrace"
kind INTERNAL
errored false
}
span(1) {
name "clear"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region"
@ -127,7 +125,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(2) {
name "put"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region"
@ -137,7 +134,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(3) {
name verb
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode"
"$SemanticAttributes.DB_NAME.key" "test-region"
@ -171,7 +167,6 @@ class PutGetTest extends AgentInstrumentationSpecification {
span(0) {
name "query"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "geode"
"$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.StatusCode.ERROR
import com.google.api.client.http.GenericUrl
import com.google.api.client.http.HttpRequest
@ -64,15 +65,15 @@ abstract class AbstractGoogleHttpClientTest extends HttpClientTest<HttpRequest>
def uri = server.address.resolve("/error")
when:
def status = doRequest(method, uri)
def responseCode = doRequest(method, uri)
then:
status == 500
responseCode == 500
assertTraces(1) {
trace(0, 2) {
span(0) {
kind CLIENT
errored true
status ERROR
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${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.config.GrailsAutoConfiguration
import groovy.transform.CompileStatic
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -36,7 +37,8 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
try {
ServerProperties.getDeclaredMethod("getServlet")
contextPathKey = "server.servlet.contextPath"
} catch (NoSuchMethodException ignore) {}
} catch (NoSuchMethodException ignore) {
}
Map<String, Object> properties = new HashMap<>()
properties.put("server.port", port)
properties.put(contextPathKey, contextPath)
@ -116,7 +118,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index + 1) {
name errorSpanName
kind INTERNAL
errored false
attributes {
}
}
@ -124,7 +125,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index + 2) {
name ~/\.sendError$/
kind INTERNAL
errored false
attributes {
}
}
@ -136,7 +136,6 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
trace.span(index) {
name endpoint == REDIRECT ? ~/\.sendRedirect$/ : ~/\.sendError$/
kind INTERNAL
errored false
attributes {
}
}
@ -155,8 +154,8 @@ class GrailsTest extends HttpServerTest<ConfigurableApplicationContext> implemen
name "TestController.${endpoint.name().toLowerCase()}"
}
kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
childOf((SpanData) parent)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -4,6 +4,7 @@
*/
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.TraceUtils.runUnderTrace
@ -32,14 +33,14 @@ class UrlConnectionTest extends AgentInstrumentationSpecification {
span(0) {
name "someTrace"
hasNoParent()
errored true
status ERROR
errorEvent ConnectException, String
}
span(1) {
name expectedOperationName("GET")
kind CLIENT
childOf span(0)
errored true
status ERROR
errorEvent ConnectException, String
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"

View File

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

View File

@ -4,6 +4,7 @@
*/
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.runUnderTrace
@ -54,14 +55,12 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) {
name "parent"
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "ExampleGroup.HystrixObservableTest\$1.execute"
childOf span(0)
errored false
attributes {
"hystrix.command" "HystrixObservableTest\$1"
"hystrix.group" "ExampleGroup"
@ -71,7 +70,6 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) {
name "tracedMethod"
childOf span(1)
errored false
attributes {
}
}
@ -148,14 +146,13 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) {
name "parent"
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "ExampleGroup.HystrixObservableTest\$2.execute"
childOf span(0)
errored true
status ERROR
errorEvent(IllegalArgumentException)
attributes {
"hystrix.command" "HystrixObservableTest\$2"
@ -166,7 +163,6 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) {
name "ExampleGroup.HystrixObservableTest\$2.fallback"
childOf span(1)
errored false
attributes {
"hystrix.command" "HystrixObservableTest\$2"
"hystrix.group" "ExampleGroup"
@ -245,13 +241,13 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(0) {
name "parent"
hasNoParent()
errored true
status ERROR
errorEvent(HystrixRuntimeException, "HystrixObservableTest\$3 failed and no fallback available.")
}
span(1) {
name "FailingGroup.HystrixObservableTest\$3.execute"
childOf span(0)
errored true
status ERROR
errorEvent(IllegalArgumentException)
attributes {
"hystrix.command" "HystrixObservableTest\$3"
@ -262,7 +258,7 @@ class HystrixObservableTest extends AgentInstrumentationSpecification {
span(2) {
name "FailingGroup.HystrixObservableTest\$3.fallback"
childOf span(1)
errored true
status ERROR
errorEvent(UnsupportedOperationException, "No fallback available.")
attributes {
"hystrix.command" "HystrixObservableTest\$3"

View File

@ -4,6 +4,7 @@
*/
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.runUnderTrace
@ -38,14 +39,12 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(0) {
name "parent"
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "ExampleGroup.HystrixTest\$1.execute"
childOf span(0)
errored false
attributes {
"hystrix.command" "HystrixTest\$1"
"hystrix.group" "ExampleGroup"
@ -55,7 +54,6 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(2) {
name "tracedMethod"
childOf span(1)
errored false
attributes {
}
}
@ -100,14 +98,13 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(0) {
name "parent"
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "ExampleGroup.HystrixTest\$2.execute"
childOf span(0)
errored true
status ERROR
errorEvent(IllegalArgumentException)
attributes {
"hystrix.command" "HystrixTest\$2"
@ -118,7 +115,6 @@ class HystrixTest extends AgentInstrumentationSpecification {
span(2) {
name "ExampleGroup.HystrixTest\$2.fallback"
childOf span(1)
errored false
attributes {
"hystrix.command" "HystrixTest\$2"
"hystrix.group" "ExampleGroup"

View File

@ -71,17 +71,16 @@ class JdkHttpClientTest extends HttpClientTest<HttpRequest> implements AgentTest
def uri = new URI("https://www.google.com/")
when:
def status = doRequest(method, uri)
def responseCode = doRequest(method, uri)
then:
status == 200
responseCode == 200
assertTraces(1) {
trace(0, 1 + extraClientSpans()) {
span(0) {
hasNoParent()
name expectedOperationName(method)
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${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_METHOD.key}" method
"${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.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.base.HttpClientTest
@ -83,7 +84,7 @@ abstract class JaxRsClientTest extends HttpClientTest<Invocation.Builder> implem
hasNoParent()
name expectedOperationName(method)
kind CLIENT
errored true
status ERROR
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${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.SERVER
import static io.opentelemetry.api.trace.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.runUnderServerTrace
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -74,11 +75,8 @@ abstract class JaxRsFilterTest extends AgentInstrumentationSpecification {
span(0) {
name parentSpanName != null ? parentSpanName : "test.span"
kind SERVER
if (runsOnServer()) {
errored abortNormal
} else {
attributes {
}
if (runsOnServer() && abortNormal) {
status ERROR
}
}
span(1) {

View File

@ -5,6 +5,7 @@
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 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.SUCCESS
@ -173,7 +174,9 @@ abstract class JaxRsHttpServerTest<S> extends HttpServerTest<S> implements Agent
trace.span(index) {
name path
kind SERVER
errored isError
if (isError) {
status ERROR
}
if (parentID != null) {
traceId traceID
parentSpanId parentID
@ -216,8 +219,8 @@ abstract class JaxRsHttpServerTest<S> extends HttpServerTest<S> implements Agent
trace.span(index) {
name "JaxRsTestResource.${methodName}"
kind INTERNAL
errored isError
if (isError) {
status ERROR
errorEvent(Exception, exceptionMessage)
}
childOf((SpanData) parent)

View File

@ -3,14 +3,17 @@
* 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.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTestTrait
import io.opentelemetry.sdk.trace.data.SpanData
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.HelloRequest
import org.eclipse.jetty.server.Server
import org.eclipse.jetty.util.resource.Resource
import org.eclipse.jetty.webapp.WebAppContext
@ -156,8 +159,10 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
trace.span(index) {
hasNoParent()
name operation
kind SpanKind.SERVER
errored exception != null
kind SERVER
if (exception != null) {
status ERROR
}
}
}
@ -169,9 +174,9 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
childOf((SpanData) parentSpan)
}
name "HelloService/" + operation
kind SpanKind.INTERNAL
errored exception != null
kind INTERNAL
if (exception) {
status ERROR
errorEvent(exception.class, exception.message)
}
}
@ -185,9 +190,9 @@ abstract class AbstractJaxWsTest extends AgentInstrumentationSpecification imple
childOf((SpanData) parentSpan)
}
name "HelloServiceImpl." + methodName
kind SpanKind.INTERNAL
errored exception != null
kind INTERNAL
if (exception) {
status ERROR
errorEvent(exception.class, exception.message)
}
attributes {

View File

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

View File

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

View File

@ -199,7 +199,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
hasNoParent()
name destinationName + " receive"
kind CONSUMER
errored false
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
"${SemanticAttributes.MESSAGING_DESTINATION.key}" destinationName
@ -271,7 +270,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
trace.span(index) {
name destinationName + " send"
kind PRODUCER
errored false
hasNoParent()
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
@ -296,7 +294,6 @@ class Jms1Test extends AgentInstrumentationSpecification {
} else {
hasNoParent()
}
errored false
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "jms"
"${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.StatusCode.ERROR
import static io.opentelemetry.instrumentation.test.utils.TraceUtils.basicServerSpan
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -126,7 +127,7 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
// set up form parameter for post
RequestBody formBody = new FormBody.Builder()
.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:submit", "Say hello")
.add("app-form_SUBMIT", "1") // MyFaces
@ -186,7 +187,7 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
// set up form parameter for post
RequestBody formBody = new FormBody.Builder()
.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:submit", "Say hello")
.add("app-form_SUBMIT", "1") // MyFaces
@ -219,8 +220,8 @@ abstract class BaseJsfTest extends AgentInstrumentationSpecification implements
trace.span(index) {
name spanName
kind INTERNAL
errored expectedException != null
if (expectedException != null) {
status ERROR
errorEvent(expectedException.getClass(), expectedException.getMessage())
}
childOf((SpanData) parent)

View File

@ -4,6 +4,7 @@
*/
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.utils.OkHttpUtils
@ -87,7 +88,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/$jspFileName"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -102,7 +102,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /$jspFileName"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -111,7 +110,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /$jspFileName"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -146,7 +144,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/getQuery.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -161,7 +158,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /getQuery.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.getQuery_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -170,7 +166,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /getQuery.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -202,7 +197,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/post.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -217,7 +211,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /post.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.post_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -226,7 +219,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /post.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -255,7 +247,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/$jspFileName"
kind SERVER
errored true
status ERROR
event(0) {
eventName(SemanticAttributes.EXCEPTION_EVENT_NAME)
attributes {
@ -282,7 +274,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /$jspFileName"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -291,7 +282,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /$jspFileName"
errored true
status ERROR
event(0) {
eventName(SemanticAttributes.EXCEPTION_EVENT_NAME)
attributes {
@ -337,7 +328,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/includes/includeHtml.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -352,7 +342,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /includes/includeHtml.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeHtml_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -361,7 +350,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /includes/includeHtml.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -369,7 +357,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.include"
errored false
}
}
}
@ -394,7 +381,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/includes/includeMulti.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -409,7 +395,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /includes/includeMulti.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -418,7 +403,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /includes/includeMulti.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -426,12 +410,10 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.include"
errored false
}
span(4) {
childOf span(3)
name "Compile /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -440,7 +422,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(5) {
childOf span(3)
name "Render /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -448,12 +429,10 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(6) {
childOf span(2)
name "ApplicationDispatcher.include"
errored false
}
span(7) {
childOf span(6)
name "Compile /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -462,7 +441,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(8) {
childOf span(6)
name "Render /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -490,7 +468,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/$jspFileName"
kind SERVER
errored true
status ERROR
errorEvent(JasperException, String)
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -506,7 +484,7 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /$jspFileName"
errored true
status ERROR
errorEvent(JasperException, String)
attributes {
"jsp.classFQCN" "org.apache.jsp.$jspClassNamePrefix$jspClassName"
@ -542,7 +520,6 @@ class JspInstrumentationBasicTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/*"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${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.StatusCode.ERROR
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
import io.opentelemetry.instrumentation.test.utils.OkHttpUtils
@ -85,7 +86,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/$forwardFromFileName"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -100,7 +100,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /$forwardFromFileName"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.$jspForwardFromClassPrefix$jspForwardFromClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -109,7 +108,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /$forwardFromFileName"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -117,12 +115,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.forward"
errored false
}
span(4) {
childOf span(3)
name "Compile /$forwardDestFileName"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.$jspForwardDestClassPrefix$jspForwardDestClassName"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -131,7 +127,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) {
childOf span(3)
name "Render /$forwardDestFileName"
errored false
attributes {
"jsp.forwardOrigin" "/$forwardFromFileName"
"jsp.requestURL" baseUrl + "/$forwardDestFileName"
@ -165,7 +160,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/forwards/forwardToHtml.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -180,7 +174,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /forwards/forwardToHtml.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToHtml_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -189,7 +182,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /forwards/forwardToHtml.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -197,7 +189,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.forward"
errored false
}
}
}
@ -222,7 +213,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/forwards/forwardToIncludeMulti.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -237,7 +227,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /forwards/forwardToIncludeMulti.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToIncludeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -246,7 +235,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /forwards/forwardToIncludeMulti.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -254,12 +242,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.forward"
errored false
}
span(4) {
childOf span(3)
name "Compile /includes/includeMulti.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.includes.includeMulti_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -268,7 +254,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) {
childOf span(3)
name "Render /includes/includeMulti.jsp"
errored false
attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -277,12 +262,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(6) {
childOf span(5)
name "ApplicationDispatcher.include"
errored false
}
span(7) {
childOf span(6)
name "Compile /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -291,7 +274,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(8) {
childOf span(6)
name "Render /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -300,12 +282,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(9) {
childOf span(5)
name "ApplicationDispatcher.include"
errored false
}
span(10) {
childOf span(9)
name "Compile /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.common.javaLoopH2_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -314,7 +294,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(11) {
childOf span(9)
name "Render /common/javaLoopH2.jsp"
errored false
attributes {
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@ -343,7 +322,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/forwards/forwardToJspForward.jsp"
kind SERVER
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -358,7 +336,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /forwards/forwardToJspForward.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToJspForward_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -367,7 +344,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /forwards/forwardToJspForward.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}
@ -375,12 +351,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.forward"
errored false
}
span(4) {
childOf span(3)
name "Compile /forwards/forwardToSimpleJava.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToSimpleJava_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -389,7 +363,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(5) {
childOf span(3)
name "Render /forwards/forwardToSimpleJava.jsp"
errored false
attributes {
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/forwards/forwardToSimpleJava.jsp"
@ -398,12 +371,10 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(6) {
childOf span(5)
name "ApplicationDispatcher.forward"
errored false
}
span(7) {
childOf span(6)
name "Compile /common/loop.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.common.loop_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -412,7 +383,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(8) {
childOf span(6)
name "Render /common/loop.jsp"
errored false
attributes {
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/common/loop.jsp"
@ -441,7 +411,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/forwards/forwardToCompileError.jsp"
kind SERVER
errored true
status ERROR
errorEvent(JasperException, String)
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -457,7 +427,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /forwards/forwardToCompileError.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToCompileError_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -466,7 +435,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /forwards/forwardToCompileError.jsp"
errored true
status ERROR
errorEvent(JasperException, String)
attributes {
"jsp.requestURL" reqUrl
@ -475,13 +444,13 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(3) {
childOf span(2)
name "ApplicationDispatcher.forward"
errored true
status ERROR
errorEvent(JasperException, String)
}
span(4) {
childOf span(3)
name "Compile /compileError.jsp"
errored true
status ERROR
errorEvent(JasperException, String)
attributes {
"jsp.classFQCN" "org.apache.jsp.compileError_jsp"
@ -511,7 +480,7 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
hasNoParent()
name "/$jspWebappContext/forwards/forwardToNonExistent.jsp"
kind SERVER
errored true
status ERROR
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -526,7 +495,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(1) {
childOf span(0)
name "Compile /forwards/forwardToNonExistent.jsp"
errored false
attributes {
"jsp.classFQCN" "org.apache.jsp.forwards.forwardToNonExistent_jsp"
"jsp.compiler" "org.apache.jasper.compiler.JDTCompiler"
@ -535,7 +503,6 @@ class JspInstrumentationForwardTests extends AgentInstrumentationSpecification {
span(2) {
childOf span(0)
name "Render /forwards/forwardToNonExistent.jsp"
errored false
attributes {
"jsp.requestURL" reqUrl
}

View File

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

View File

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

View File

@ -130,7 +130,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(0) {
name STREAM_PENDING + " send"
kind PRODUCER
errored false
hasNoParent()
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -142,7 +141,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(1) {
name STREAM_PENDING + " process"
kind CONSUMER
errored false
childOf span(0)
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -159,7 +157,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(2) {
name STREAM_PENDING + " process"
kind CONSUMER
errored false
childOf span(0)
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -175,7 +172,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(3) {
name STREAM_PROCESSED + " send"
kind PRODUCER
errored false
childOf span(2)
attributes {
"${SemanticAttributes.MESSAGING_SYSTEM.key}" "kafka"
@ -187,7 +183,6 @@ class KafkaStreamsTest extends AgentInstrumentationSpecification {
span(4) {
name STREAM_PROCESSED + " process"
kind CONSUMER
errored false
childOf span(3)
attributes {
"${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.StatusCode.ERROR
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.utils.TraceUtils.basicSpan
@ -172,8 +173,8 @@ class KubernetesClientTest extends AgentInstrumentationSpecification {
name spanName
kind CLIENT
childOf trace.span(0)
errored hasFailed
if (hasFailed) {
status ERROR
errorEvent exception.class, exception.message
}
attributes {

View File

@ -4,6 +4,7 @@
*/
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.RedisClient
@ -116,7 +117,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -149,7 +149,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored true
status ERROR
errorEvent RedisConnectionException, String
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
@ -175,7 +175,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SET"
@ -208,7 +207,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -255,7 +253,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -288,7 +285,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
@ -340,7 +336,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HMSET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
@ -351,7 +346,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HGETALL"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
@ -392,7 +386,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEL"
kind CLIENT
errored true
status ERROR
errorEvent(IllegalStateException, "TestException")
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
@ -428,7 +422,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SADD"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SADD"
@ -449,7 +442,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEBUG"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
@ -470,7 +462,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SHUTDOWN"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${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.StatusCode.ERROR
import com.lambdaworks.redis.ClientOptions
import com.lambdaworks.redis.RedisClient
@ -98,7 +99,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -129,7 +129,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored true
status ERROR
errorEvent RedisConnectionException, String
attributes {
"${SemanticAttributes.NET_PEER_NAME.key}" HOST
@ -154,7 +154,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "SET"
@ -175,7 +174,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -196,7 +194,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "GET"
@ -217,7 +214,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "RANDOMKEY"
@ -238,7 +234,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "LPUSH"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "LPUSH"
@ -259,7 +254,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HMSET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HMSET"
@ -280,7 +274,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HGETALL"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "HGETALL"
@ -300,7 +293,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEBUG"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${SemanticAttributes.DB_STATEMENT.key}" "DEBUG"
@ -320,7 +312,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SHUTDOWN"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.DB_SYSTEM.key}" "redis"
"${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.StatusCode.ERROR
import io.lettuce.core.ClientOptions
import io.lettuce.core.ConnectionFuture
@ -120,7 +121,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
"$SemanticAttributes.NET_PEER_IP.key" PEER_IP
@ -154,7 +154,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored true
status ERROR
errorEvent AbstractChannel.AnnotatedConnectException, String
attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
@ -180,7 +180,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -213,7 +212,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -260,7 +258,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -293,7 +290,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -344,7 +340,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HMSET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HMSET TESTHM firstname ? lastname ? age ?"
@ -355,7 +350,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HGETALL"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM"
@ -396,7 +390,7 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEL"
kind CLIENT
errored true
status ERROR
errorEvent(IllegalStateException, "TestException")
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -432,7 +426,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SADD"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SADD SKEY ? ?"
@ -453,7 +446,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEBUG"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -474,7 +466,6 @@ class LettuceAsyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SHUTDOWN"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"

View File

@ -96,7 +96,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -120,7 +119,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -152,7 +150,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -182,7 +179,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -202,7 +198,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "COMMAND"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "COMMAND"
@ -223,7 +218,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "COMMAND"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "COMMAND"
@ -254,7 +248,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEBUG"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -274,7 +267,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SHUTDOWN"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"
@ -297,14 +289,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) {
span(0) {
name "test-parent"
errored false
attributes {
}
}
span(1) {
name "SET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -314,7 +304,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) {
name "GET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -338,14 +327,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) {
span(0) {
name "test-parent"
errored false
attributes {
}
}
span(1) {
name "SET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -355,7 +342,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) {
name "GET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -380,14 +366,12 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
trace(0, 3) {
span(0) {
name "test-parent"
errored false
attributes {
}
}
span(1) {
name "SET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
@ -397,7 +381,6 @@ class LettuceReactiveClientTest extends AgentInstrumentationSpecification {
span(2) {
name "GET"
kind CLIENT
errored false
childOf span(0)
attributes {
"$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.StatusCode.ERROR
import io.lettuce.core.ClientOptions
import io.lettuce.core.RedisClient
@ -100,7 +101,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
"$SemanticAttributes.NET_PEER_IP.key" PEER_IP
@ -131,7 +131,7 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "CONNECT"
kind CLIENT
errored true
status ERROR
errorEvent AbstractChannel.AnnotatedConnectException, String
attributes {
"$SemanticAttributes.NET_PEER_NAME.key" PEER_NAME
@ -156,7 +156,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SET TESTSETKEY ?"
@ -177,7 +176,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET TESTKEY"
@ -198,7 +196,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "GET NON_EXISTENT_KEY"
@ -219,7 +216,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "RANDOMKEY"
@ -240,7 +236,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "LPUSH"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "LPUSH TESTLIST ?"
@ -261,7 +256,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HMSET"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HMSET user firstname ? lastname ? age ?"
@ -282,7 +276,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "HGETALL"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "HGETALL TESTHM"
@ -302,7 +295,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "DEBUG"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "DEBUG SEGFAULT"
@ -322,7 +314,6 @@ class LettuceSyncClientTest extends AgentInstrumentationSpecification {
span(0) {
name "SHUTDOWN"
kind CLIENT
errored false
attributes {
"$SemanticAttributes.DB_SYSTEM.key" "redis"
"$SemanticAttributes.DB_STATEMENT.key" "SHUTDOWN NOSAVE"

View File

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

View File

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

View File

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

View File

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

View File

@ -6,6 +6,7 @@
package io.opentelemetry.instrumentation.lettuce.v5_1
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 io.lettuce.core.RedisClient
@ -133,7 +134,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -167,7 +167,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "SET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -199,7 +198,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -230,7 +228,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "GET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -261,7 +258,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "RANDOMKEY"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -292,7 +288,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "LPUSH"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -323,7 +318,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "HMSET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -354,7 +348,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "HGETALL"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -390,7 +383,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "EVAL"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -425,7 +417,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
span(0) {
name "MSET"
kind CLIENT
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -456,7 +447,6 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
name "DEBUG"
kind CLIENT
// Disconnect not an actual error even though an exception is recorded.
errored false
attributes {
"${SemanticAttributes.NET_TRANSPORT.key}" "IP.TCP"
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -492,7 +482,7 @@ abstract class AbstractLettuceSyncClientTest extends InstrumentationSpecificatio
kind CLIENT
if (Boolean.getBoolean("testLatestDeps")) {
// Seems to only be treated as an error with Lettuce 6+
errored true
status ERROR
}
attributes {
"${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.StatusCode.ERROR
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.runUnderTrace
@ -108,7 +109,7 @@ class Netty38ClientTest extends HttpClientTest<Request> implements AgentTestTrai
name "CONNECT"
kind CLIENT
childOf span(0)
errored true
status ERROR
Class errorClass = ConnectException
try {
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.StatusCode.ERROR
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.runUnderTrace
@ -105,7 +106,7 @@ class Netty38ClientTest extends HttpClientTest<Request> implements AgentTestTrai
name "CONNECT"
kind CLIENT
childOf span(0)
errored true
status ERROR
Class errorClass = ConnectException
try {
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.StatusCode.ERROR
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.runUnderTrace
@ -118,7 +119,7 @@ class Netty40ClientTest extends HttpClientTest<DefaultFullHttpRequest> implement
name "CONNECT"
kind CLIENT
childOf span(0)
errored true
status ERROR
Class errorClass = ConnectException
try {
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.StatusCode.ERROR
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.runUnderTrace
@ -185,7 +186,7 @@ class Netty41ClientTest extends HttpClientTest<DefaultFullHttpRequest> implement
name "CONNECT"
kind CLIENT
childOf span(0)
errored true
status ERROR
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()
when:
def status = runUnderTrace("parent") {
def responseCode = runUnderTrace("parent") {
annotatedClass.tracedMethod(method)
}
then:
status == 200
responseCode == 200
assertTraces(1) {
trace(0, 4) {
basicSpan(it, 0, "parent")
span(1) {
childOf span(0)
name "tracedMethod"
errored false
attributes {
}
}

View File

@ -3,18 +3,18 @@
* 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.INTERNAL
import static io.opentelemetry.api.trace.SpanKind.PRODUCER
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.utils.TraceUtils
import io.opentelemetry.test.annotation.TracedWithSpan
import java.lang.reflect.Modifier
import java.util.concurrent.CompletableFuture
import net.bytebuddy.ByteBuddy
import net.bytebuddy.ClassFileVersion
import net.bytebuddy.asm.MemberAttributeExtension
@ -38,9 +38,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.otel"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -58,7 +57,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
span(0) {
name "manualName"
hasNoParent()
errored false
attributes {
}
}
@ -77,7 +75,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.oneOfAKind"
kind PRODUCER
hasNoParent()
errored false
attributes {
}
}
@ -96,14 +93,12 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.server"
kind SERVER
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "TracedWithSpan.otel"
childOf span(0)
errored false
attributes {
}
}
@ -122,7 +117,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.nestedServers"
kind SERVER
hasNoParent()
errored false
attributes {
}
}
@ -141,7 +135,6 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
name "TracedWithSpan.nestedClients"
kind CLIENT
hasNoParent()
errored false
attributes {
}
}
@ -168,9 +161,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -193,9 +185,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -214,9 +205,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored true
status ERROR
errorEvent(IllegalArgumentException, "Boom")
attributes {
}
@ -240,9 +231,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored true
status ERROR
errorEvent(IllegalArgumentException, "Boom")
attributes {
}
@ -260,9 +251,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completionStage"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -280,9 +270,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -305,9 +294,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -326,9 +314,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored true
status ERROR
errorEvent(IllegalArgumentException, "Boom")
attributes {
}
@ -352,9 +340,9 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored true
status ERROR
errorEvent(IllegalArgumentException, "Boom")
attributes {
}
@ -372,9 +360,8 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 1) {
span(0) {
name "TracedWithSpan.completableFuture"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
@ -397,11 +384,11 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
.name("GeneratedJava6TestClass")
.implement(Runnable)
.defineMethod("run", void.class, Modifier.PUBLIC).intercept(MethodDelegation.to(new Object() {
@RuntimeType
void intercept(@This Object o) {
TraceUtils.runUnderTrace("intercept", {})
}
}))
@RuntimeType
void intercept(@This Object o) {
TraceUtils.runUnderTrace("intercept", {})
}
}))
.visit(new MemberAttributeExtension.ForMethod()
.annotateMethod(AnnotationDescription.Builder.ofType(WithSpan).build())
.on(ElementMatchers.named("run")))
@ -417,17 +404,15 @@ class WithSpanInstrumentationTest extends AgentInstrumentationSpecification {
trace(0, 2) {
span(0) {
name "GeneratedJava6TestClass.run"
kind SpanKind.INTERNAL
kind INTERNAL
hasNoParent()
errored false
attributes {
}
}
span(1) {
name "intercept"
kind SpanKind.INTERNAL
kind INTERNAL
childOf(span(0))
errored false
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.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -70,8 +71,8 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
trace.span(index) {
name "play.request"
kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
childOf((SpanData) parent)
@ -82,5 +83,4 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
String expectedServerSpanName(ServerEndpoint endpoint) {
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.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -72,9 +73,9 @@ class PlayServerTest extends HttpServerTest<Server> implements AgentTestTrait {
trace.span(index) {
name "play.request"
kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent)
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
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.CONSUMER
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 com.rabbitmq.client.AMQP
@ -350,8 +351,8 @@ class RabbitMQTest extends AgentInstrumentationSpecification {
hasLink((SpanData) linkSpan)
}
errored exception != null
if (exception) {
status ERROR
errorEvent(exception.class, errorMsg)
}

View File

@ -73,7 +73,6 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
name "/$route"
kind SERVER
hasNoParent()
errored false
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -89,7 +88,6 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
name "/$route"
kind INTERNAL
childOf span(0)
errored false
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.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -112,9 +113,9 @@ class RatpackHttpServerTest extends HttpServerTest<EmbeddedApp> implements Agent
trace.span(index) {
name endpoint.status == 404 ? "/" : endpoint == PATH_PARAM ? "/path/:id/param" : endpoint.path
kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent)
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
}

View File

@ -5,6 +5,7 @@
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.runInternalSpan
@ -97,7 +98,7 @@ abstract class AbstractReactorCoreTest extends InstrumentationSpecification {
trace(0, 2) {
span(0) {
name "trace-parent"
errored true
status ERROR
errorEvent(RuntimeException, EXCEPTION_MESSAGE)
hasNoParent()
}
@ -128,7 +129,7 @@ abstract class AbstractReactorCoreTest extends InstrumentationSpecification {
trace(0, workSpans + 2) {
span(0) {
name "trace-parent"
errored true
status ERROR
errorEvent(RuntimeException, EXCEPTION_MESSAGE)
hasNoParent()
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -3,6 +3,7 @@
* 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.runUnderTrace
import static java.util.Collections.emptyEnumeration
@ -108,7 +109,7 @@ class HttpServletResponseTest extends AgentInstrumentationSpecification {
span(1) {
name 'HttpServletResponseTest$2.sendRedirect'
childOf span(0)
errored true
status ERROR
errorEvent(ex.class, ex.message)
}
}

View File

@ -3,6 +3,7 @@
* 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.runUnderTrace
@ -121,7 +122,7 @@ class RequestDispatcherTest extends AgentInstrumentationSpecification {
span(1) {
name "TestDispatcher.$operation"
childOf span(0)
errored true
status ERROR
errorEvent(ex.class, ex.message)
}
basicSpan(it, 2, "$operation-child", span(1))

View File

@ -48,7 +48,6 @@ class SparkJavaBasedTest extends AgentInstrumentationSpecification {
span(0) {
name "/param/:param"
kind SERVER
errored false
hasNoParent()
attributes {
"${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.StatusCode.ERROR
import static java.util.Collections.emptyMap
import io.opentelemetry.instrumentation.test.AgentInstrumentationSpecification
@ -61,7 +62,7 @@ abstract class SpringBatchTest extends AgentInstrumentationSpecification {
name "BatchJob taskletJob.step.Chunk"
kind INTERNAL
childOf span(1)
errored true
status ERROR
errorEvent RuntimeException, "fail"
}
}

View File

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

View File

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

View File

@ -5,6 +5,7 @@
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.utils.OkHttpUtils
@ -161,7 +162,6 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(2) {
name "tracedMethod"
childOf span(0)
errored false
attributes {
}
}
@ -249,7 +249,6 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(2) {
name "tracedMethod"
childOf span(annotatedMethod ? 0 : 1)
errored false
attributes {
}
}
@ -278,7 +277,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
name "/**"
kind SERVER
hasNoParent()
errored true
status ERROR
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
"${SemanticAttributes.NET_PEER_PORT.key}" Long
@ -294,7 +293,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
name "ResourceWebHandler.handle"
kind INTERNAL
childOf span(0)
errored true
status ERROR
errorEvent(ResponseStatusException, String)
attributes {
"spring-webflux.handler.type" "org.springframework.web.reactive.resource.ResourceWebHandler"
@ -370,7 +369,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
span(0) {
name urlPathWithVariables
kind SERVER
errored true
status ERROR
hasNoParent()
attributes {
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
@ -393,7 +392,7 @@ class SpringWebfluxTest extends AgentInstrumentationSpecification {
}
kind INTERNAL
childOf span(0)
errored true
status ERROR
errorEvent(RuntimeException, "bad things happen")
attributes {
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.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -155,7 +156,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) {
name "BasicErrorController.error"
kind INTERNAL
errored false
attributes {
}
}
@ -167,7 +167,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) {
name responseSpanName
kind INTERNAL
errored false
attributes {
}
}
@ -178,7 +177,6 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) {
name "Render RedirectView"
kind INTERNAL
errored false
attributes {
"spring-webmvc.view.type" RedirectView.simpleName
}
@ -194,8 +192,8 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext>
trace.span(index) {
name handlerSpanName
kind INTERNAL
errored endpoint == EXCEPTION
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
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.SUCCESS
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
import io.opentelemetry.instrumentation.test.base.HttpServerTest
@ -84,9 +85,9 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index) {
name "TestController.${endpoint.name().toLowerCase()}"
kind INTERNAL
errored endpoint == EXCEPTION
childOf((SpanData) parent)
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
}
@ -107,7 +108,6 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index) {
name "ApplicationDispatcher.forward"
kind INTERNAL
errored false
childOf((SpanData) parent)
attributes {
}
@ -115,7 +115,6 @@ class ServletFilterTest extends HttpServerTest<ConfigurableApplicationContext> i
trace.span(index + 1) {
name "BasicErrorController.error"
kind INTERNAL
errored false
childOf(trace.span(index))
attributes {
}

View File

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

View File

@ -4,6 +4,7 @@
*/
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 net.spy.memcached.ConnectionFactoryBuilder.Protocol.BINARY
@ -592,7 +593,6 @@ class SpymemcachedTest extends AgentInstrumentationSpecification {
return trace.span(index) {
name parentOperation
hasNoParent()
errored false
attributes {
}
}
@ -606,7 +606,9 @@ class SpymemcachedTest extends AgentInstrumentationSpecification {
name operation
kind CLIENT
errored(error != null && error != "canceled")
if (error != null && error != "canceled") {
status ERROR
}
if (error == "timeout") {
errorEvent(

View File

@ -3,6 +3,7 @@
* 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.EXCEPTION
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.basicSpan
import io.opentelemetry.api.trace.SpanKind
import io.opentelemetry.api.trace.StatusCode
import io.opentelemetry.instrumentation.test.AgentTestTrait
import io.opentelemetry.instrumentation.test.asserts.TraceAssert
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) {
trace.span(index) {
name "GreetingAction.${endpoint.name().toLowerCase()}"
kind SpanKind.INTERNAL
errored endpoint == EXCEPTION
kind INTERNAL
if (endpoint == EXCEPTION) {
status StatusCode.ERROR
errorEvent(Exception, EXCEPTION.body)
}
def expectedMethodName = endpoint.name().toLowerCase()

View File

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

View File

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

View File

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

View File

@ -125,16 +125,6 @@ class SpanAssert {
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) {
errorEvent(errorType, null)
}
@ -158,7 +148,7 @@ class SpanAssert {
void assertDefaults() {
if (!checked.status) {
errored(false)
status(StatusCode.UNSET)
}
if (!checked.kind) {
kind(SpanKind.INTERNAL)

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