diff --git a/dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy b/dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy index 1690a95836..c88a876149 100644 --- a/dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy +++ b/dd-java-agent/instrumentation/akka-http-10.0/src/lagomTest/groovy/LagomTest.groovy @@ -113,7 +113,6 @@ class LagomTest extends AgentTestRunner { "$Tags.HTTP_URL" "ws://localhost:${server.port()}/error" "$Tags.HTTP_METHOD" "GET" "$Tags.HTTP_STATUS" 500 - "$Tags.ERROR" true defaultTags() } } diff --git a/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy b/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy index 0e04cbe190..133379747e 100644 --- a/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpClientInstrumentationTest.groovy @@ -83,7 +83,6 @@ class AkkaHttpClientInstrumentationTest extends HttpClientTest { tags { "$Tags.COMPONENT" "akka-http-client" "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT - "$Tags.ERROR" true errorTags(NullPointerException) defaultTags() } diff --git a/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy b/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy index b0375b1a8d..74e1ea7e1a 100644 --- a/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy +++ b/dd-java-agent/instrumentation/akka-http-10.0/src/test/groovy/AkkaHttpServerInstrumentationTest.groovy @@ -57,7 +57,6 @@ abstract class AkkaHttpServerInstrumentationTest extends HttpServerTest "$Tags.HTTP_METHOD" method "$Tags.HTTP_STATUS" endpoint.status if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy b/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy index 231e65fd44..c6a4919ca5 100644 --- a/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy +++ b/dd-java-agent/instrumentation/dropwizard/src/test/groovy/DropwizardTest.groovy @@ -118,7 +118,6 @@ class DropwizardTest extends HttpServerTest { "$Tags.HTTP_STATUS" endpoint.status "span.origin.type" ServletHandler.CachedChain.name if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy b/dd-java-agent/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy index 4a968880ae..871890483f 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy +++ b/dd-java-agent/instrumentation/finatra-2.9/src/test/groovy/FinatraServerTest.groovy @@ -51,6 +51,12 @@ class FinatraServerTest extends HttpServerTest { return true } + @Override + boolean testNotFound() { + // Resource name is set to "GET /notFound" + false + } + @Override void stopServer(HttpServer httpServer) { Await.ready(httpServer.close(), TIMEOUT) @@ -81,9 +87,6 @@ class FinatraServerTest extends HttpServerTest { // Finatra doesn't propagate the stack trace or exception to the instrumentation // so the normal errorTags() method can't be used - if (errorEndpoint) { - "$Tags.ERROR" true - } defaultTags() } } diff --git a/dd-java-agent/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala b/dd-java-agent/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala index 6a5503c8a4..b71e82aabe 100644 --- a/dd-java-agent/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala +++ b/dd-java-agent/instrumentation/finatra-2.9/src/test/scala/FinatraController.scala @@ -22,14 +22,6 @@ class FinatraController extends Controller { }) } - any(NOT_FOUND.getPath) { request: Request => - controller(NOT_FOUND, new Closure[Response](null) { - override def call(): Response = { - response.notFound(NOT_FOUND.getBody) - } - }) - } - any(QUERY_PARAM.getPath) { request: Request => controller(QUERY_PARAM, new Closure[Response](null) { override def call(): Response = { diff --git a/dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy b/dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy index 116703b77c..a3c8ff43ca 100644 --- a/dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy +++ b/dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy @@ -112,7 +112,6 @@ class GlassFishServerTest extends HttpServerTest { "servlet.path" endpoint.path "span.origin.type" { it.startsWith("TestServlets\$") || it == DefaultServlet.name } if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/google-http-client/src/test/groovy/AbstractGoogleHttpClientTest.groovy b/dd-java-agent/instrumentation/google-http-client/src/test/groovy/AbstractGoogleHttpClientTest.groovy index 7faf438639..bfb87ff1e8 100644 --- a/dd-java-agent/instrumentation/google-http-client/src/test/groovy/AbstractGoogleHttpClientTest.groovy +++ b/dd-java-agent/instrumentation/google-http-client/src/test/groovy/AbstractGoogleHttpClientTest.groovy @@ -71,7 +71,6 @@ abstract class AbstractGoogleHttpClientTest extends HttpClientTest { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - "$Tags.ERROR" true "$DDTags.ERROR_MSG" "Server Error" defaultTags() } diff --git a/dd-java-agent/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy b/dd-java-agent/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy index 2ac0245f34..f8a2cbe279 100644 --- a/dd-java-agent/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy +++ b/dd-java-agent/instrumentation/grpc-1.5/src/test/groovy/GrpcTest.groovy @@ -162,8 +162,6 @@ class GrpcTest extends AgentTestRunner { "status.description" description if (status.cause != null) { errorTags status.cause.class, status.cause.message - } else { - tag "error", true } defaultTags(true) } @@ -196,7 +194,6 @@ class GrpcTest extends AgentTestRunner { "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT "status.code" "${status.code.name()}" "status.description" description - tag "error", true defaultTags() } } @@ -281,7 +278,6 @@ class GrpcTest extends AgentTestRunner { "$Tags.COMPONENT" "grpc-client" "$Tags.SPAN_KIND" Tags.SPAN_KIND_CLIENT "status.code" "UNKNOWN" - tag "error", true defaultTags() } } diff --git a/dd-java-agent/instrumentation/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java b/dd-java-agent/instrumentation/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java index bbc6eb8966..086eced487 100644 --- a/dd-java-agent/instrumentation/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java +++ b/dd-java-agent/instrumentation/jax-rs-client-1.1/src/main/java/datadog/trace/instrumentation/jaxrs/v1/JaxRsClientV1Instrumentation.java @@ -19,7 +19,6 @@ import com.sun.jersey.api.client.ClientHandler; import com.sun.jersey.api.client.ClientRequest; import com.sun.jersey.api.client.ClientResponse; import datadog.trace.agent.tooling.Instrumenter; -import datadog.trace.api.DDTags; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import java.util.Map; @@ -72,9 +71,7 @@ public final class JaxRsClientV1Instrumentation extends Instrumenter.Default { // WARNING: this might be a chain...so we only have to trace the first in the chain. final boolean isRootClientHandler = null == request.getProperties().get(DD_SPAN_ATTRIBUTE); if (isRootClientHandler) { - final AgentSpan span = - startSpan("jax-rs.client.call") - .setTag(DDTags.RESOURCE_NAME, request.getMethod() + " jax-rs.client.call"); + final AgentSpan span = startSpan("jax-rs.client.call"); DECORATE.afterStart(span); DECORATE.onRequest(span, request); request.getProperties().put(DD_SPAN_ATTRIBUTE, span); diff --git a/dd-java-agent/instrumentation/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java b/dd-java-agent/instrumentation/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java index 439a1ed746..4f36762dde 100644 --- a/dd-java-agent/instrumentation/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java +++ b/dd-java-agent/instrumentation/jax-rs-client-2.0/src/main/java/datadog/trace/instrumentation/jaxrs/ClientTracingFilter.java @@ -6,7 +6,6 @@ import static datadog.trace.bootstrap.instrumentation.api.AgentTracer.startSpan; import static datadog.trace.instrumentation.jaxrs.InjectAdapter.SETTER; import static datadog.trace.instrumentation.jaxrs.JaxRsClientDecorator.DECORATE; -import datadog.trace.api.DDTags; import datadog.trace.bootstrap.instrumentation.api.AgentScope; import datadog.trace.bootstrap.instrumentation.api.AgentSpan; import javax.annotation.Priority; @@ -24,9 +23,7 @@ public class ClientTracingFilter implements ClientRequestFilter, ClientResponseF @Override public void filter(final ClientRequestContext requestContext) { - final AgentSpan span = - startSpan("jax-rs.client.call") - .setTag(DDTags.RESOURCE_NAME, requestContext.getMethod() + " jax-rs.client.call"); + final AgentSpan span = startSpan("jax-rs.client.call"); try (final AgentScope scope = activateSpan(span, false)) { DECORATE.afterStart(span); DECORATE.onRequest(span, requestContext); diff --git a/dd-java-agent/instrumentation/jetty-8/src/test/groovy/JettyHandlerTest.groovy b/dd-java-agent/instrumentation/jetty-8/src/test/groovy/JettyHandlerTest.groovy index e0f71f5be0..0c3386e989 100644 --- a/dd-java-agent/instrumentation/jetty-8/src/test/groovy/JettyHandlerTest.groovy +++ b/dd-java-agent/instrumentation/jetty-8/src/test/groovy/JettyHandlerTest.groovy @@ -66,6 +66,12 @@ class JettyHandlerTest extends HttpServerTest { return "jetty.request" } + @Override + boolean testNotFound() { + // resource name is set to "GET JettyHandlerTest$TestHandler" + false + } + @Override boolean testExceptionBody() { false @@ -139,7 +145,6 @@ class JettyHandlerTest extends HttpServerTest { "$Tags.HTTP_STATUS" endpoint.status "span.origin.type" handlerName if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy b/dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy index 82d3ee5cd3..3f1f0978d2 100644 --- a/dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy +++ b/dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy @@ -320,7 +320,6 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain" "servlet.context" "/$jspWebappContext" "servlet.path" "/$jspFileName" - "error" true "error.type" { String tagExceptionType -> return tagExceptionType == exceptionClass.getName() || tagExceptionType.contains(exceptionClass.getSimpleName()) } @@ -342,7 +341,6 @@ class JSPInstrumentationBasicTests extends AgentTestRunner { "span.origin.type" jspClassName "servlet.context" "/$jspWebappContext" "jsp.requestURL" reqUrl - "error" true "error.type" { String tagExceptionType -> return tagExceptionType == exceptionClass.getName() || tagExceptionType.contains(exceptionClass.getSimpleName()) } diff --git a/dd-java-agent/instrumentation/play-2.4/src/test/groovy/server/PlayServerTest.groovy b/dd-java-agent/instrumentation/play-2.4/src/test/groovy/server/PlayServerTest.groovy index 105032f0d9..a2568cabc6 100644 --- a/dd-java-agent/instrumentation/play-2.4/src/test/groovy/server/PlayServerTest.groovy +++ b/dd-java-agent/instrumentation/play-2.4/src/test/groovy/server/PlayServerTest.groovy @@ -100,9 +100,7 @@ class PlayServerTest extends HttpServerTest { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - if (endpoint == ERROR) { - "$Tags.ERROR" true - } else if (endpoint == EXCEPTION) { + if (endpoint == EXCEPTION) { errorTags(Exception, EXCEPTION.body) } if (endpoint.query) { diff --git a/dd-java-agent/instrumentation/play-2.6/src/test/groovy/server/PlayServerTest.groovy b/dd-java-agent/instrumentation/play-2.6/src/test/groovy/server/PlayServerTest.groovy index de7a5be00e..24fbcde452 100644 --- a/dd-java-agent/instrumentation/play-2.6/src/test/groovy/server/PlayServerTest.groovy +++ b/dd-java-agent/instrumentation/play-2.6/src/test/groovy/server/PlayServerTest.groovy @@ -102,9 +102,7 @@ class PlayServerTest extends HttpServerTest { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - if (endpoint == ERROR) { - "$Tags.ERROR" true - } else if (endpoint == EXCEPTION) { + if (endpoint == EXCEPTION) { errorTags(Exception, EXCEPTION.body) } if (endpoint.query) { @@ -135,7 +133,6 @@ class PlayServerTest extends HttpServerTest { "$Tags.HTTP_URL" "${endpoint.resolve(address)}" "$Tags.HTTP_METHOD" method if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy b/dd-java-agent/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy index 7878d7ef7d..10c95e56ee 100644 --- a/dd-java-agent/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy +++ b/dd-java-agent/instrumentation/ratpack-1.4/src/test/groovy/server/RatpackHttpServerTest.groovy @@ -106,6 +106,12 @@ class RatpackHttpServerTest extends HttpServerTest { true } + @Override + boolean testNotFound() { + // resource name is set by instrumentation, so not changed to 404 + false + } + @Override void handlerSpan(TraceAssert trace, int index, Object parent, ServerEndpoint endpoint = SUCCESS) { trace.span(index) { @@ -122,9 +128,7 @@ class RatpackHttpServerTest extends HttpServerTest { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - if (endpoint == ERROR) { - "$Tags.ERROR" true - } else if (endpoint == EXCEPTION) { + if (endpoint == EXCEPTION) { errorTags(Exception, EXCEPTION.body) } if (endpoint.query) { diff --git a/dd-java-agent/instrumentation/servlet/request-2/src/test/groovy/JettyServlet2Test.groovy b/dd-java-agent/instrumentation/servlet/request-2/src/test/groovy/JettyServlet2Test.groovy index 98176efb93..68c1b0ee0c 100644 --- a/dd-java-agent/instrumentation/servlet/request-2/src/test/groovy/JettyServlet2Test.groovy +++ b/dd-java-agent/instrumentation/servlet/request-2/src/test/groovy/JettyServlet2Test.groovy @@ -107,7 +107,6 @@ class JettyServlet2Test extends HttpServerTest { "servlet.path" endpoint.path "span.origin.type" TestServlet2.Sync.name if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy b/dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy index fb32262b16..e37b41d98c 100644 --- a/dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy +++ b/dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy @@ -96,7 +96,6 @@ abstract class AbstractServlet3Test extends HttpServerTest "span.origin.type" ApplicationFilterChain.name "servlet.path" endpoint.path if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored "error.msg" { it == null || it == EXCEPTION.body } "error.type" { it == null || it == Exception.name } "error.stack" { it == null || it instanceof String } diff --git a/dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy b/dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy index c31801fa24..e2249fe955 100644 --- a/dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy +++ b/dd-java-agent/instrumentation/twilio/src/test/groovy/test/TwilioClientTest.groovy @@ -435,7 +435,6 @@ class TwilioClientTest extends AgentTestRunner { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - "$Tags.ERROR" true defaultTags() } } @@ -589,7 +588,6 @@ class TwilioClientTest extends AgentTestRunner { "$Tags.HTTP_URL" String "$Tags.HTTP_METHOD" String "$Tags.HTTP_STATUS" Integer - "$Tags.ERROR" true defaultTags() } } diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/TagsAssert.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/TagsAssert.groovy index c5cac37b1e..06faaac57b 100644 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/TagsAssert.groovy +++ b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/asserts/TagsAssert.groovy @@ -63,7 +63,6 @@ class TagsAssert { } def errorTags(Class errorType, message) { - tag("error", true) tag("error.type", errorType.name) tag("error.stack", String) diff --git a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy index 16990954b1..67d3fcd5b1 100644 --- a/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy +++ b/dd-java-agent/testing/src/main/groovy/datadog/trace/agent/test/base/HttpServerTest.groovy @@ -538,9 +538,6 @@ abstract class HttpServerTest extends AgentTestRunner { "$Tags.HTTP_URL" "${endpoint.resolve(address)}" "$Tags.HTTP_METHOD" method "$Tags.HTTP_STATUS" endpoint.status - if (endpoint.errored) { - "$Tags.ERROR" endpoint.errored - } if (endpoint.query) { "$DDTags.HTTP_QUERY" endpoint.query } diff --git a/dd-trace-ot/src/main/java/datadog/opentracing/decorators/ErrorFlag.java b/dd-trace-ot/src/main/java/datadog/opentracing/decorators/ErrorFlag.java index 18ea0febbf..3b0c8c56be 100644 --- a/dd-trace-ot/src/main/java/datadog/opentracing/decorators/ErrorFlag.java +++ b/dd-trace-ot/src/main/java/datadog/opentracing/decorators/ErrorFlag.java @@ -6,7 +6,7 @@ import io.opentracing.tag.Tags; public class ErrorFlag extends AbstractDecorator { public ErrorFlag() { super(); - this.setMatchingTag(Tags.ERROR.getKey()); + setMatchingTag(Tags.ERROR.getKey()); } @Override @@ -17,7 +17,6 @@ public class ErrorFlag extends AbstractDecorator { } catch (final Throwable t) { // DO NOTHING } - // TODO: Do we really want an error tag if the error flag is already set? - return true; + return false; } }