Add span.origin.type for JSP too.
Might be slightly redundant given `jsp.requestURL` but consistent with other instrumentation.
MODIFY
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JSPInstrumentation.java
dd-java-agent/instrumentation/jsp-2.3/src/main/java/datadog/trace/instrumentation/jsp/JSPInstrumentation.java
@@ -57,12 +57,14 @@ public final class JSPInstrumentation extends Instrumenter.Default {
public static class HttpJspPageAdvice {
@Advice.OnMethodEnter(suppress = Throwable.class)
- public static Scope startSpan(@Advice.Argument(0) final HttpServletRequest req) {
+ public static Scope startSpan(
+ @Advice.This final Object obj, @Advice.Argument(0) final HttpServletRequest req) {
final Scope scope =
GlobalTracer.get()
.buildSpan("jsp.render")
.withTag(Tags.SPAN_KIND.getKey(), Tags.SPAN_KIND_SERVER)
.withTag(DDTags.SPAN_TYPE, DDSpanTypes.WEB_SERVLET)
+ .withTag("span.origin.type", obj.getClass().getSimpleName())
.withTag("servlet.context", req.getContextPath())
.startActive(true);

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
@@ -98,6 +98,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -114,6 +115,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" jspClassName
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -175,6 +177,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -191,6 +194,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "getQuery_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -249,6 +253,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -265,6 +270,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "post_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -320,6 +326,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 500
errorTags(JasperException, String)
@@ -337,6 +344,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" jspClassName
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
errorTags(exceptionClass, errorMessage)
@@ -398,6 +406,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -414,6 +423,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "includeHtml_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -468,6 +478,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -484,6 +495,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "includeMulti_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -500,6 +512,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "javaLoopH2_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -533,6 +546,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "javaLoopH2_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -604,6 +618,7 @@ class JSPInstrumentationBasicTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 500
errorTags(JasperException, String)

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
@@ -96,6 +96,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -112,6 +113,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" jspForwardFromClassName
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -128,6 +130,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" jspForwardDestClassName
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/$forwardFromFileName"
"jsp.requestURL" baseUrl + "/$forwardDestFileName"
@@ -205,6 +208,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -221,6 +225,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToHtml_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -275,6 +280,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -291,6 +297,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToIncludeMulti_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -307,6 +314,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "includeMulti_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@@ -324,6 +332,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "javaLoopH2_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@@ -358,6 +367,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "javaLoopH2_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/forwards/forwardToIncludeMulti.jsp"
"jsp.requestURL" baseUrl + "/includes/includeMulti.jsp"
@@ -447,6 +457,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 200
defaultTags()
@@ -463,6 +474,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToJspForward_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()
@@ -479,6 +491,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToSimpleJava_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/forwards/forwardToSimpleJava.jsp"
@@ -496,6 +509,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "loop_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.forwardOrigin" "/forwards/forwardToJspForward.jsp"
"jsp.requestURL" baseUrl + "/common/loop.jsp"
@@ -585,6 +599,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 500
errorTags(JasperException, String)
@@ -602,6 +617,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToCompileError_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
errorTags(JasperException, String)
@@ -677,6 +693,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "java-web-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"servlet.context" "/$jspWebappContext"
"http.status_code" 404
defaultTags()
@@ -693,6 +710,7 @@ class JSPInstrumentationForwardTests extends AgentTestRunner {
"span.kind" "server"
"component" "jsp-http-servlet"
"span.type" DDSpanTypes.WEB_SERVLET
+ "span.origin.type" "forwardToNonExistent_jsp"
"servlet.context" "/$jspWebappContext"
"jsp.requestURL" reqUrl
defaultTags()

MODIFY
dd-java-agent/instrumentation/spring-web/src/test/groovy/test/SpringBootBasedTest.groovy
dd-java-agent/instrumentation/spring-web/src/test/groovy/test/SpringBootBasedTest.groovy
@@ -43,6 +43,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 200
defaultTags()
@@ -70,6 +71,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 200
defaultTags()
@@ -101,6 +103,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 404
defaultTags()
@@ -120,6 +123,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 404
defaultTags()
@@ -153,6 +157,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 500
errorTags NestedServletException, "Request processing failed; nested exception is java.lang.RuntimeException: qwerty"
@@ -173,6 +178,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "GET"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 500
"error" true
@@ -201,6 +207,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "POST"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 200
defaultTags()
@@ -234,6 +241,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "POST"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 400
"error" false
@@ -257,6 +265,7 @@ class SpringBootBasedTest extends AgentTestRunner {
"http.method" "POST"
"span.kind" "server"
"span.type" "web"
+ "span.origin.type" "org.apache.catalina.core.ApplicationFilterChain"
"component" "java-web-servlet"
"http.status_code" 400
defaultTags()

Add span.origin.type for JSP too.

Might be slightly redundant given `jsp.requestURL` but consistent with other instrumentation.