dd-trace-java icon indicating copy to clipboard operation
dd-trace-java copied to clipboard

Springboot metrics are "duplicated"

Open doumdoum opened this issue 7 months ago • 0 comments

Tracer Version(s)

1.51.1

Java Version(s)

21

JVM Vendor

Eclipse Adoptium / Temurin

Bug Report

If i run the instrumented example from https://github.com/DataDog/apm-tutorial-java-host (springboot application using jersey annotations for controllers declaration), java -javaagent:$HOME/Downloads/dd-java-agent-1.51.1.jar -Ddd.trace.sample.rate=1 -Ddd.service=notes -Ddd.env=dev -Ddd.version=0.0.1 -jar target/notes-0.0.1-SNAPSHOT.jar I get only the servlet.request operation in the service catalog view, see: Image

If now i run the instrumented example from https://github.com/spring-guides/gs-spring-boot/tree/main/complete (springboot application using springboot annotations), java -javaagent:$HOME/Downloads/dd-java-agent-1.51.1.jar -Ddd.trace.sample.rate=1 -Ddd.service=gs -Ddd.env=dev -Ddd.version=0.0.1 -jar target/spring-boot-complete-0.0.1-SNAPSHOT.jar I get servlet.request and spring.handler operations in the service catalog view, see: Image The spring.handler metric is somehow a duplicate of the servlet.request operations and leads to noisy service views where one has the feeling that everything is duplicated.

Expected Behavior

I would expect either the spring.handler metric to not be reported by the dd-java-agent or the service view to report only the servlet.request operation and not all

Reproduction Code

  • Follow the guide: https://docs.datadoghq.com/tracing/trace_collection/automatic_instrumentation/dd_libraries/java/?tab=wget
  • run the instrumented application (with dd-java-agent)
  • execute some requests to populate notes service
  • Login to datadog and goto APM/services page
  • Select notes service
  • it reports only the servlet.request operation
  • Pull https://github.com/spring-guides/gs-spring-boot/tree/main/complete
  • package the application
  • run the instrumented application (with dd-java-agent)
  • execute some requests to populate the service
  • Goto service page: servlet.request and spring.handler operations are reported

doumdoum avatar Jul 22 '25 13:07 doumdoum