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

JVM profiling in combination with existing OpenTelemetry tracing instrumentation

Open jstaffans opened this issue 2 years ago • 2 comments

Similar question to https://github.com/DataDog/dd-trace-java/issues/4507:

is it possible to use this library only for profiling and JVM metrics, rely on the OpenTelemetry Java SDK for tracing instrumentation and have everything happily coexist in Datadog APM?

jstaffans avatar May 17 '23 10:05 jstaffans

Yes, it is possible - you can just enable the profiler and metrics and disable the tracer (-Ddd.profiler.enabled=true -Ddd.jmxfetch.enabled=true -Ddd.tracing.enabled=false and you will get profiling and metrics without tracing. The metrics doesn't depend on the tracer being active at all. Profiling will work, however, there are a number of advanced profiling features which rely on context propagated by the tracer, which don't currently work with OTel, such as:

  • code hotspots
  • endpoint profiling
  • labelling of profiling samples with span attributes
  • currently unannounced profiling features

It may be possible to make these features work with OTel in the future.

richardstartin avatar May 17 '23 10:05 richardstartin

Is the above still the case, or will advanced profiling features now work with OTel instrumentation?

jstaffans avatar Oct 22 '25 06:10 jstaffans