Add servlet.path tag
MODIFY
dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy
dd-java-agent/instrumentation/glassfish/src/test/groovy/GlassFishServerTest.groovy
@@ -101,6 +101,7 @@ class GlassFishServerTest extends HttpServerTest<GlassFish, Servlet3Decorator> {
}
tags {
"servlet.context" "/$context"
+ "servlet.path" endpoint.path
"span.origin.type" { it.startsWith("TestServlets\$") || it == DefaultServlet.name }
defaultTags(true)

MODIFY
dd-java-agent/instrumentation/jetty-8/src/main/java/datadog/trace/instrumentation/jetty8/JettyDecorator.java
dd-java-agent/instrumentation/jetty-8/src/main/java/datadog/trace/instrumentation/jetty8/JettyDecorator.java
@@ -56,6 +56,7 @@ public class JettyDecorator
assert span != null;
if (request != null) {
span.setTag("servlet.context", request.getContextPath());
+ span.setTag("servlet.path", request.getServletPath());
}
return super.onRequest(span, request);
}

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationBasicTests.groovy
@@ -102,6 +102,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/$jspFileName"
"http.status_code" 200
defaultTags()
}
@@ -177,6 +178,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/getQuery.jsp"
"http.status_code" 200
defaultTags()
}
@@ -249,6 +251,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/post.jsp"
"http.status_code" 200
defaultTags()
}
@@ -318,6 +321,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/$jspFileName"
"http.status_code" 500
"error" true
"error.type" { String tagExceptionType ->
@@ -408,6 +412,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/includes/includeHtml.jsp"
"http.status_code" 200
defaultTags()
}
@@ -476,6 +481,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/includes/includeMulti.jsp"
"http.status_code" 200
defaultTags()
}
@@ -600,6 +606,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/$jspFileName"
"http.status_code" 500
errorTags(JasperException, String)
defaultTags()

MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
dd-java-agent/instrumentation/jsp-2.3/src/test/groovy/JSPInstrumentationForwardTests.groovy
@@ -101,6 +101,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/$forwardFromFileName"
"http.status_code" 200
defaultTags()
}
@@ -203,6 +204,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/forwards/forwardToHtml.jsp"
"http.status_code" 200
defaultTags()
}
@@ -271,6 +273,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/forwards/forwardToIncludeMulti.jsp"
"http.status_code" 200
defaultTags()
}
@@ -426,6 +429,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/forwards/forwardToJspForward.jsp"
"http.status_code" 200
defaultTags()
}
@@ -552,6 +556,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/forwards/forwardToCompileError.jsp"
"http.status_code" 500
errorTags(JasperException, String)
defaultTags()
@@ -637,6 +642,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"component" "java-web-servlet"
"span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
+ "servlet.path" "/forwards/forwardToNonExistent.jsp"
"http.status_code" 404
defaultTags()
}

MODIFY
dd-java-agent/instrumentation/servlet/request-2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java
dd-java-agent/instrumentation/servlet/request-2/src/main/java/datadog/trace/instrumentation/servlet2/Servlet2Decorator.java
@@ -62,6 +62,7 @@ public class Servlet2Decorator
assert span != null;
if (request != null) {
span.setTag("servlet.context", request.getContextPath());
+ span.setTag("servlet.path", request.getServletPath());
}
return super.onRequest(span, request);
}

MODIFY
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java
dd-java-agent/instrumentation/servlet/request-3/src/main/java/datadog/trace/instrumentation/servlet3/Servlet3Decorator.java
@@ -57,6 +57,7 @@ public class Servlet3Decorator
assert span != null;
if (request != null) {
span.setTag("servlet.context", request.getContextPath());
+ span.setTag("servlet.path", request.getServletPath());
}
return super.onRequest(span, request);
}

MODIFY
dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy
dd-java-agent/instrumentation/servlet/request-3/src/test/groovy/AbstractServlet3Test.groovy
@@ -83,6 +83,7 @@ abstract class AbstractServlet3Test<SERVER, CONTEXT> extends HttpServerTest<SERV
}
tags {
"servlet.context" "/$context"
+ "servlet.path" endpoint.path
"span.origin.type" { it == servlet.name || it == ApplicationFilterChain.name }
defaultTags(true)

MODIFY
dd-java-agent/instrumentation/spring-webmvc-3.1/src/test/groovy/test/SpringBootBasedTest.groovy
dd-java-agent/instrumentation/spring-webmvc-3.1/src/test/groovy/test/SpringBootBasedTest.groovy
@@ -126,6 +126,7 @@ class SpringBootBasedTest extends HttpServerTest<ConfigurableApplicationContext,
}
tags {
"span.origin.type" ApplicationFilterChain.name
+ "servlet.path" endpoint.path
defaultTags(true)
"$Tags.COMPONENT" serverDecorator.component()

Add servlet.path tag