Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove span type decorators #38

Merged
merged 1 commit into from
Dec 13, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ class LagomTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "akka-http.request"
spanType DDSpanTypes.HTTP_SERVER
errored false
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "akka-http-server"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_SERVER
"$Tags.HTTP_URL" "ws://localhost:${server.port()}/echo"
Expand Down Expand Up @@ -102,9 +102,9 @@ class LagomTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "akka-http.request"
spanType DDSpanTypes.HTTP_SERVER
errored true
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_SERVER
"$Tags.COMPONENT" "akka-http-server"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_SERVER
"$Tags.HTTP_URL" "ws://localhost:${server.port()}/error"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import akka.http.javadsl.model.headers.RawHeader
import akka.stream.ActorMaterializer
import datadog.trace.agent.test.base.HttpClientTest
import datadog.trace.api.DDSpanTypes
import datadog.trace.api.DDTags
import datadog.trace.instrumentation.akkahttp.AkkaHttpClientDecorator
import datadog.trace.instrumentation.api.Tags
import spock.lang.Shared
Expand Down Expand Up @@ -68,9 +69,9 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest<AkkaHttpClientDec
span(0) {
parent()
operationName "akka-http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "akka-http-client"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
errorTags(NullPointerException)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import datadog.trace.agent.test.asserts.TraceAssert
import datadog.trace.agent.test.base.HttpServerTest
import datadog.trace.api.DDSpanTypes
import datadog.trace.api.DDTags
import datadog.trace.instrumentation.akkahttp.AkkaHttpServerDecorator
import datadog.trace.instrumentation.api.Tags

Expand Down Expand Up @@ -38,7 +39,6 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
void serverSpan(TraceAssert trace, int index, BigInteger traceID = null, BigInteger parentID = null, String method = "GET", ServerEndpoint endpoint = SUCCESS) {
trace.span(index) {
operationName expectedOperationName()
spanType DDSpanTypes.HTTP_SERVER
errored endpoint.errored
if (parentID != null) {
traceId traceID
Expand All @@ -47,6 +47,7 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest<Object,
parent()
}
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_SERVER
"$Tags.COMPONENT" serverDecorator.component()
"$Tags.SPAN_KIND" Tags.SPAN_KIND_SERVER
"$Tags.HTTP_URL" "${endpoint.resolve(address)}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,12 +129,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored false
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "$server.address/"
Expand All @@ -149,10 +149,10 @@ class AWSClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored false
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -202,12 +202,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "http://localhost:${UNUSABLE_PORT}/"
Expand All @@ -222,10 +222,10 @@ class AWSClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -264,12 +264,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "S3.HeadBucket"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "https://s3.amazonaws.com/"
Expand Down Expand Up @@ -310,12 +310,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "S3.GetObject"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "$server.address/"
Expand All @@ -335,10 +335,10 @@ class AWSClientTest extends AgentTestRunner {
(1..4).each {
span(it) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored false
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "$server.address/"
Expand All @@ -119,10 +119,10 @@ class AWSClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored false
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -172,12 +172,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "http://localhost:${UNUSABLE_PORT}/"
Expand All @@ -192,10 +192,10 @@ class AWSClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -234,12 +234,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "S3.GetObject"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "https://s3.amazonaws.com/"
Expand Down Expand Up @@ -280,12 +280,12 @@ class AWSClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "S3.GetObject"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "$server.address/"
Expand All @@ -301,10 +301,10 @@ class AWSClientTest extends AgentTestRunner {
(1..4).each {
span(it) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,12 +76,12 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored false
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -109,10 +109,10 @@ class AwsClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored false
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -192,12 +192,12 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 1) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored false
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "$service.$operation"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -228,10 +228,10 @@ class AwsClientTest extends AgentTestRunner {
trace(1, 1) {
span(0) {
operationName "netty.client.request"
spanType DDSpanTypes.HTTP_CLIENT
errored false
parent()
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "netty-client"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down Expand Up @@ -312,12 +312,12 @@ class AwsClientTest extends AgentTestRunner {
trace(0, 5) {
span(0) {
operationName "aws.http"
spanType DDSpanTypes.HTTP_CLIENT
errored true
parent()
tags {
"$DDTags.SERVICE_NAME" "java-aws-sdk"
"$DDTags.RESOURCE_NAME" "S3.GetObject"
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "java-aws-sdk"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand All @@ -335,10 +335,10 @@ class AwsClientTest extends AgentTestRunner {
(1..4).each {
span(it) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
errored true
childOf(span(0))
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner {
void assertCouchbaseCall(TraceAssert trace, int index, String name, String bucketName = null, Object parentSpan = null) {
trace.span(index) {
operationName "couchbase.call"
spanType DDSpanTypes.COUCHBASE
errored false
if (parentSpan == null) {
parent()
Expand All @@ -148,6 +147,7 @@ abstract class AbstractCouchbaseTest extends AgentTestRunner {
tags {
"$DDTags.SERVICE_NAME" "couchbase"
"$DDTags.RESOURCE_NAME" name
"$DDTags.SPAN_TYPE" DDSpanTypes.COUCHBASE
"$Tags.COMPONENT" "couchbase-client"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.DB_TYPE" "couchbase"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ class CouchbaseSpanUtil {
static void assertCouchbaseCall(TraceAssert trace, int index, String name, String bucketName = null, Object parentSpan = null) {
trace.span(index) {
operationName "couchbase.call"
spanType DDSpanTypes.COUCHBASE
errored false
if (parentSpan == null) {
parent()
Expand All @@ -20,6 +19,7 @@ class CouchbaseSpanUtil {
tags {
"$DDTags.SERVICE_NAME" "couchbase"
"$DDTags.RESOURCE_NAME" name
"$DDTags.SPAN_TYPE" DDSpanTypes.COUCHBASE
"$Tags.COMPONENT" "couchbase-client"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,14 @@ class CassandraClientTest extends AgentTestRunner {
def cassandraSpan(TraceAssert trace, int index, String statement, String keyspace, boolean renameService, Object parentSpan = null, Throwable exception = null) {
trace.span(index) {
operationName "cassandra.query"
spanType DDSpanTypes.CASSANDRA
if (parentSpan == null) {
parent()
} else {
childOf((DDSpan) parentSpan)
}
tags {
"$DDTags.SERVICE_NAME" renameService && keyspace ? keyspace : "cassandra"
"$DDTags.SPAN_TYPE" DDSpanTypes.CASSANDRA
"$Tags.COMPONENT" "java-cassandra"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
trace(0, 2) {
span(0) {
operationName "elasticsearch.rest.query"
spanType DDSpanTypes.ELASTICSEARCH
parent()
tags {
"$DDTags.SERVICE_NAME" "elasticsearch"
"$DDTags.SPAN_TYPE" DDSpanTypes.ELASTICSEARCH
"$Tags.COMPONENT" "elasticsearch-java"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.PEER_HOSTNAME" "localhost"
Expand All @@ -98,9 +98,9 @@ class Elasticsearch6RestClientTest extends AgentTestRunner {
}
span(1) {
operationName "http.request"
spanType DDSpanTypes.HTTP_CLIENT
childOf span(0)
tags {
"$DDTags.SPAN_TYPE" DDSpanTypes.HTTP_CLIENT
"$Tags.COMPONENT" "apache-httpasyncclient"
"$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT
"$Tags.HTTP_URL" "_cluster/health"
Expand Down
Loading