Closed sivachandran closed 5 days ago
Hi @sivachandran - you are right, those events may be missing since we may be using datadog specific events to record CPU, wallclock and allocation profiles, depending on the Java version, architecture etc.
Also, I want to point out that Datadog profiler is not a generic Java profiler (see https://github.com/DataDog/java-profiler?tab=readme-ov-file#disclaimer) and if you want to profile your Java application but not use Datadog UI you should rather use async-profiler
(which you seem to be using already, considering that you tried the converter tool) which is a full-fledged command line Java profiler.
Appreciate your reply!
I figured if I disable ddprof(DD_PROFILING_DDPROF_ENABLED=false
) then I'm getting the jdk.ExecutionSample
and jdk.ObjectAllocationSample
events. I believe it is because the profiler uses JFR profiler internally. Do you see any problem with such usage? Are there any plan to drop JFR profiler support in the future?
No, we are not planning to drop JFR (however, on certain systems, eg. J9, it is not available). Also, there is no problem with such usage, but honestly, I would go for async-profiler if you are not using DD infrastructure anyway. There is no upside to using DD profiler instead of async-profiler as a general CLI profiling tool.
I want to stick with DD profiler as its ability to send the profiles to the configured agent nicely fits with my existing architecture. I believe I need to write a wrapper for async-profiler to achieve the same.
Yes, I see. As I said, there is no problem with such usage.
An alternative to disabling the dd profiler is to make your pipeline aware of datadog.ExecutionSample
(CPU profiler), datadog.MethodSample
(Wallclock profiler) and datadog.ObjectSample
(allocation profiler) events.
Will explore the possibilit to support datadog events.
Once again, thank you for your replies.
Hi,
I profiled a simple Java application with dd-trace-dd 1.39.0 using OpenJDK 21. The resultant JFR has less no. of
jdk.ExecutionSample
and nojdk.ObjectAllocationSample
. When I tried to convert the JFR into pprof using async-profiler'sconverter.jar
the resultant profile is empty which confirms the missing events.jfr
cli tool also confirms there are nojdk.ObjectAllocationSample
and just 76jdk.ExecutionSample
events for 2mins profile.The problem is only with OpenJDK 21. The same setup with OpenJDK 17 works fine and produces JFR with both of these events.
Attached the JFR for your reference. jfr-profile-openjdk-21-missing-events.jfr.gz