The Java continuous profiling is currently made across 3 dimensions:
Download the latest ddprof Java release:
1
wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'
Alternatively, add the following to your Dockerfile
if you are using Docker:
1
ADD 'https://dtdg.co/latest-java-tracer' dd-java-agent.jar
Blackfire utilizes the open source Datadog profiler to collect continuous profiling traces and, via its agent, sends it directly to Blackfire's ingesters where we process and analyze the data for your observability needs.
Update your Java application start command:
1 2 3
java \
-javaagent:dd-java-agent.jar \
-jar <YOUR_SERVICE>.jar <YOUR_SERVICE_FLAGS>
Enable the Java Continuous Profiler by defining these environment variables:
DD_PROFILING_ENABLED=true
: controls the activation of the continuous
profiler.DD_PROFILING_DDPROF_ENABLED=false
: disables native profilingDD_SERVICE=my-java-app
: sets the application name.DD_TRACE_AGENT_URL=unix:///var/run/blackfire/agent.sock
: has Blackfire
Agent collect traces.DD_PROFILING_ALLOCATION_ENABLED=true
: enables allocation profilingDD_PROFILING_ENABLED_EVENTS="jdk.ObjectAllocationInNewTLAB,jdk.ObjectAllocationOutsideTLAB"
:
enables Object allocationThere is also some additional configuration that can be done using environment variables:
BLACKFIRE_LOG_FILE
: Sets the log file. The default is logging to stderr
.BLACKFIRE_LOG_LEVEL
: Sets the log level. The default is logging only errors.