The Rust continuous profiling is currently made across 3 dimensions:
glibc
or musl
)Download the latest ddprof release.
1 2 3curl -Lo ddprof-linux.tar.xz https://github.com/DataDog/ddprof/releases/latest/download/ddprof-<INFRA>-linux.tar.xz tar xvf ddprof-linux.tar.xz mv ddprof/bin/ddprof INSTALLATION_TARGET
INSTALLATION_TARGET
specifies the designated location to store the ddprof binary. The examples bellow assumeINSTALLATION_TARGET
is set to./ddprof
.
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.
Enable the Rust Continuous Profiler by defining these environment variables:
DD_PROFILING_ENABLED=true
: controls the activation of the continuous
profiler.DD_SERVICE=my-rust-app
: sets the application name.DD_TRACE_AGENT_URL=unix:///var/run/blackfire/agent.sock
: has Blackfire
Modify your service invocation to include the continuous profiler.
Your usual command is passed as the last arguments to the ddprof
executable.
1 2 3 4
./ddprof myrustapp --arg1 --arg2
# using a shell builtin
exec ./ddprof myrustapp --arg1 --arg2
There 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.