The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
Available profile types:
- CPU
- Wallclock (latency)
- Allocations
- Live heap (memory leak detection)
- Exception profiling
- I/O profiling
| JDK Distribution | Minimum Version | Notes |
|---|---|---|
| OpenJDK | 8u352+, 11.0.17+, 17.0.5+, 21+ | Includes builds from Amazon Corretto, Azul Zulu, Eclipse Temurin, BellSoft Liberica, and other OpenJDK-based distributions |
| Oracle JDK | 8u351+, 11.0.17+, 17.0.5+, 21+ | |
| OpenJ9 JDK | 8u372+, 11.0.18+, 17.0.6+ | Includes Eclipse OpenJ9, IBM JDK, and IBM Semeru Runtime |
| Azul Platform Prime | 23.05.0.0+ |
Available profile types:
- CPU
- Allocations
- I/O profiling
- Exception
| JDK Distribution | Minimum Version | Notes |
|---|---|---|
| OpenJDK | 8u282+, 11.0.17+, 17.0.5+, 21.0.3+ | Includes builds from Amazon Corretto, Azul Zulu, Eclipse Temurin, BellSoft Liberica, and other OpenJDK-based distributions |
| Oracle JDK | 11.0.17+, 17.0.5+, 21.0.3+ | JFR may require commercial license. Oracle JDK 8u40+ supported with limited features (CPU profiling only) |
| Azul Zulu | 8u212+, 11.0.17+, 17.0.5+, 21.0.3+ | |
| GraalVM | 17.0.11+, 21.0.3+ | JIT mode and native-image(AOT) |
- All JVM-based languages, such as Java, Scala, Groovy, Kotlin, and Clojure are supported.
- The profiler supports only actively maintained LTS JDK versions and the most recent General Availability (GA) JDK releases.
- Continuous Profiler is not supported on serverless platforms.
Datadog Profiler support for GraalVM native-image is in Preview. Datadog recommends evaluating the profiler in a non-sensitive environment before deploying in production.
- Minimum version
- GraalVM 17+
- Supported platforms
- Linux, Windows, macOS
- Available profile types
- CPU, Allocations
Installation
To begin profiling applications:
- Install and run Datadog Agent v6+. Datadog recommends using Datadog Agent v7+. If you don't have APM enabled to set up your application to send data to Datadog, in your Agent, set the
DD_APM_ENABLEDenvironment variable totrueand the port to8126/TCP.
Download
dd-java-agent.jar, which contains the Java Agent class files:wget -O dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'curl -Lo dd-java-agent.jar 'https://dtdg.co/latest-java-tracer'ADD 'https://dtdg.co/latest-java-tracer' dd-java-agent.jarEnable the profiler and specify your service, environment, and version:
java \ -javaagent:dd-java-agent.jar \ -Ddd.service=<YOUR_SERVICE> \ -Ddd.env=<YOUR_ENVIRONMENT> \ -Ddd.version=<YOUR_VERSION> \ -Ddd.profiling.enabled=true \ -jar <YOUR_SERVICE>.jar <YOUR_SERVICE_FLAGS>export DD_SERVICE=<YOUR_SERVICE> export DD_ENV=<YOUR_ENV> export DD_VERSION=<YOUR_VERSION> export DD_PROFILING_ENABLED=true java \ -javaagent:dd-java-agent.jar \ -jar <YOUR_SERVICE>.jar <YOUR_SERVICE_FLAGS>The
-javaagentargument needs to be before-jar. This adds it as a JVM option rather than an application argument. For more information, see the Oracle documentation.Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
For more information on available profile types, see Profile Types.
For GraalVM native-image applications, switch the Runtime filter above to GraalVM Native Image.
Follow the Tracer Setup Instructions to build your GraalVM native image with the Datadog Java Profiler instrumentation.
Run with profiling enabled:
export DD_SERVICE=<YOUR_SERVICE> export DD_ENV=<YOUR_ENV> export DD_VERSION=<YOUR_VERSION> export DD_PROFILING_ENABLED=true export DD_PROFILING_DIRECTALLOCATION_ENABLED=true ./my_serviceAfter a couple of minutes, your profiles appear on the Datadog APM > Profiler page.
Limitations
- Only JFR-based profiling is supported for GraalVM native-image applications.
- Wallclock and live heap profiling are not available.
Configuration
In addition to the environment, service, and version variables shown in the installation steps, you can apply custom tags to uploaded profiles with DD_TAGS (a comma-separated list of <key>:<value> pairs such as layer:api, team:intake).
For additional configuration options, see the Configuration reference in the troubleshooting guide.
For profile type configuration options, see the Configuration reference in the Java profiler troubleshooting guide.
The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
- Verify your Python and SDK versions are compatible by reviewing the Python Compatibility Requirements.
- Some features depend on newer Python versions than the minimum required version for the SDK. For more details, read Profile Types.
- The installation requires pip version 18 or above.
- Continuous Profiler support is in Preview for some serverless platforms, such as AWS Lambda.
Installation
To begin profiling applications:
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Install
ddtrace, which provides both tracing and profiling functionalities:pip install ddtraceIf you are using a platform where
ddtracebinary distribution is not available, first install a development environment. For example, on Alpine Linux:apk install gcc musl-dev linux-headersEnable the profiler and specify your service, environment, and version:
DD_PROFILING_ENABLED=true \ DD_ENV=prod \ DD_SERVICE=my-web-app \ DD_VERSION=1.0.3 \ ddtrace-run python app.pyTo manually control the life cycle of the profiler, use the
ddtrace.profiling.Profilerobject:from ddtrace.profiling import Profiler prof = Profiler( env="prod", # if not specified, falls back to environment variable DD_ENV service="my-web-app", # if not specified, falls back to environment variable DD_SERVICE version="1.0.3", # if not specified, falls back to environment variable DD_VERSION ) prof.start() # Should be as early as possible, eg before other imports, to ensure everything is profiledOptional: Set up Source Code Integration to connect your profiling data with your Git repositories.
After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Caveats
When your process forks using os.fork, the profiler is automatically restarted in the child process on supported Python versions. No manual restart is required.
Configuration
You can configure the profiler using the environment variables.
Code provenance
The Python profiler supports code provenance reporting, which provides insight into the library that is running the code. While this is enabled by default, you can turn it off by setting DD_PROFILING_ENABLE_CODE_PROVENANCE=0.
The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
The Datadog Profiler requires one of the latest two major Go releases. These are the major Go releases supported by the Go project.
For the Trace to Profiling integration and Endpoint Profiling, use dd-trace-go version 1.51.0+.
Continuous Profiler is not supported on serverless platforms, such as AWS Lambda.
Installation
To begin profiling applications:
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Install
dd-trace-go:go get github.com/DataDog/dd-trace-go/v2/profilerIf you are using v1 of the Go tracer, see the migration guide to upgrade to v2 and for all future updates and features.
Import the profiler and start it in your application:
import "github.com/DataDog/dd-trace-go/v2/profiler"err := profiler.Start( profiler.WithService("<SERVICE_NAME>"), profiler.WithEnv("<ENVIRONMENT>"), profiler.WithVersion("<APPLICATION_VERSION>"), profiler.WithTags("<KEY1>:<VALUE1>", "<KEY2>:<VALUE2>"), profiler.WithProfileTypes( profiler.CPUProfile, profiler.HeapProfile, // The profiles below are disabled by default to keep overhead // low, but can be enabled as needed. // profiler.BlockProfile, // profiler.MutexProfile, // profiler.GoroutineProfile, ), ) if err != nil { log.Fatal(err) } defer profiler.Stop()Optional: Enable the timeline feature, see prerequisites.
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
By default, only the CPU and Heap profiles are enabled. Use profiler.WithProfileTypes and profile types. For legacy v1 documentation, view profiler.WithProfileTypes to enable additional profile types.
If you automatically instrument your Go application with Orchestrion, it adds the continuous profiler code to your application. To enable the profiler at runtime, set the environment variable DD_PROFILING_ENABLED=true.
Save up to 14% CPU in production with PGO
Starting Go 1.21, the Go compiler supports Profile-Guided Optimization (PGO). PGO enables additional optimizations on code identified as hot by CPU profiles of production workloads. This is compatible with Datadog Go Continuous Profiler and can be used for production builds.
Follow the PGO setup guide to set it up.
Configuration
You can set profiler parameters in code with these functions:
| Function | Type | Description |
|---|---|---|
| WithService | String | The Datadog service name, for example, my-web-app. |
| WithEnv | String | The Datadog environment name, for example, production. |
| WithVersion | String | The version of your application. |
| WithTags | List of strings | A list of tags to apply to an uploaded profile. Tags must be of the format <KEY>:<VALUE>. |
Alternatively you can set profiler configuration using environment variables:
| Environment variable | Type | Description |
|---|---|---|
DD_ENV | String | The environment name, for example, production. |
DD_SERVICE | String | The service name, for example, web-backend. |
DD_VERSION | String | The version of your service. |
DD_TAGS | String | Tags to apply to an uploaded profile. Must be a list of <key>:<value> separated by commas such as: layer:api,team:intake. |
Showing C function calls in CPU profiles
By default, Go's CPU profiler only shows detailed information for Go code. If your program calls C code, the time spent running C code is reflected in the profile, but the call stacks only show Go function calls.
To add detailed C function call information to CPU profiles, you may opt to use a library such as ianlancetaylor/cgosymbolizer. To use this library:
Download the package:
go get github.com/ianlancetaylor/cgosymbolizer@latestAdd the following import anywhere in your program:
import _ "github.com/ianlancetaylor/cgosymbolizer"
This library is considered experimental. It can cause (infrequent) deadlocks in programs that use C++ exceptions, or that use libraries such as tcmalloc, which also collect call stacks.
The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
The Datadog Profiler requires Ruby 2.5+ (Ruby 3.2.3+ or later is recommended). JRuby and TruffleRuby are not supported.
The following operating systems and architectures are supported:
- Linux (GNU libc) x86-64, aarch64
- Alpine Linux (musl libc) x86-64, aarch64
Versions of the datadog gem older than 2.30 also need either the pkg-config or the pkgconf system utility installed. This is no longer needed on modern versions.
Continuous Profiler is not supported on serverless platforms, such as AWS Lambda. Additionally, Single Step APM Instrumentation cannot be used to set up the Ruby Profiler.
Installation
To begin profiling applications:
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Add the
datadoggem to yourGemfileorgems.rbfile and install withbundle install:gem 'datadog', '~> 2.30'Enable the profiler:
export DD_PROFILING_ENABLED=true export DD_ENV=prod export DD_SERVICE=my-web-app export DD_VERSION=1.0.3Datadog.configure do |c| c.profiling.enabled = true c.env = 'prod' c.service = 'my-web-app' c.version = '1.0.3' endFor Rails applications, create a
config/initializers/datadog.rbfile with the code configuration above.Add the
ddprofrb execcommand to your Ruby application start command:bundle exec ddprofrb exec ruby myapp.rbRails example:
bundle exec ddprofrb exec bin/rails sIf starting the application with
ddprofrb execis not an option (for example, when using the Phusion Passenger web server), you can alternatively start the profiler by adding the following to your application entry point (such asconfig.ru, for a web application):require 'datadog/profiling/preload'Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Configuration
These settings apply to the latest profiler release.
You can configure the profiler using the following environment variables:
| Environment variable | Type | Description |
|---|---|---|
DD_PROFILING_ENABLED | Boolean | If set to true, enables the profiler. Defaults to false. |
DD_PROFILING_ALLOCATION_ENABLED | Boolean | Set to true to enable allocation profiling. It requires the profiler to be enabled already. Defaults to false. |
DD_PROFILING_MAX_FRAMES | Integer | Maximum backtrace (stack) depth gathered by the profiler. Stacks deeper than this value get truncated. Defaults to 400. |
DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED | Boolean | Set to true to enable heap live objects profiling. It requires that allocation profiling is enabled as well. Defaults to false. |
DD_PROFILING_EXPERIMENTAL_HEAP_SIZE_ENABLED | Boolean | Set to true to enable heap live size profiling. It requires that heap live objects profiling is enabled as well. Defaults to the same value as DD_PROFILING_EXPERIMENTAL_HEAP_ENABLED. |
DD_PROFILING_NO_SIGNALS_WORKAROUND_ENABLED | Boolean | Automatically enabled when needed, can be used to force enable or disable this feature. See Profiler Troubleshooting for details. |
DD_PROFILING_PREVIEW_OTEL_CONTEXT_ENABLED | String | Set to only when using profiling directly with opentelemetry-sdk, or true for auto-detection of the correct context to read from. Defaults to false. |
DD_ENV | String | The environment name, for example: production. |
DD_SERVICE | String | The service name, for example, web-backend. |
DD_VERSION | String | The version of your service. |
DD_TAGS | String | Tags to apply to an uploaded profile. Must be a list of <key>:<value> separated by commas such as: layer:api, team:intake. |
Alternatively, you can set profiler parameters in code with these functions, inside a Datadog.configure block. Parameters provided in code take precedence over those provided as environment variables.
| Environment variable | Type | Description |
|---|---|---|
c.profiling.enabled | Boolean | If set to true, enables the profiler. Defaults to false. |
c.profiling.allocation_enabled | Boolean | Set to true to enable allocation profiling. It requires the profiler to be enabled already. Defaults to false. |
c.profiling.advanced.max_frames | Integer | Maximum backtrace (stack) depth gathered by the profiler. Stacks deeper than this value get truncated. Defaults to 400. |
c.profiling.advanced.experimental_heap_enabled | Boolean | Set to true to enable heap live objects profiling. It requires that allocation profiling is enabled as well. Defaults to false. |
c.profiling.advanced.experimental_heap_size_enabled | Boolean | Set to true to enable heap live size profiling. It requires that heap live objects profiling is enabled as well. Defaults to the same value as experimental_heap_size_enabled. |
c.profiling.advanced.no_signals_workaround_enabled | Boolean | Automatically enabled when needed, can be used to force enable or disable this feature. See Profiler Troubleshooting for details. |
c.profiling.advanced.preview_otel_context_enabled | String | Set to only when using profiling directly with opentelemetry-sdk, or true for auto-detection of the correct context to read from. Defaults to false. |
c.env | String | The environment name, for example: production. |
c.service | String | The service name, for example, web-backend. |
c.version | String | The version of your service. |
c.tags | Hash | Tags to apply to an uploaded profile. |
The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
The Datadog Profiler requires at least Node.js 18.
Continuous Profiler support is in Preview for some serverless platforms, such as AWS Lambda.
Continuous Profiler support is in Preview for Google Cloud Run.
Installation
To begin profiling applications:
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Install
dd-trace:npm install --save dd-trace@latestEnable the profiler:
export DD_PROFILING_ENABLED=true export DD_ENV=prod export DD_SERVICE=my-web-app export DD_VERSION=1.0.3If you're already using Datadog APM, you are already calling
initand don't need to do so again. If you are not, make sure the SDK and the profiler are loaded together:node -r dd-trace/init app.jsconst tracer = require('dd-trace').init({ profiling: true, env: 'prod', service: 'my-web-app', version: '1.0.3' })If you're already using Datadog APM, you are already calling
initand don't need to do so again. If you are not, make sure the SDK and the profiler are loaded together:const tracer = require('dd-trace/init')After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
Optional: Upload Source Maps (Preview).
Join the Preview!
Profiler support for uploaded source maps is in Preview.
If you deploy source maps with your application, the profiler reads them and produces mapped locations in profiles. Source maps in
.mapfiles and inline source maps are both supported. To reduce deployment sizes (for example, in serverless environments), you can choose not to deploy source maps and instead upload them to Datadog.Uploaded source maps require dd-trace version 5.93.0 or newer. Your deployed source files must also contain the
@sourceMappingURLannotation so the profiler knows to use the uploaded maps.
The profiler is shipped within Datadog SDKs. If you are already using APM to collect traces for your application, you can skip installing the library and go directly to enabling the profiler.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
- Supported operating systems for .NET Framework
- Windows 10
Windows Server starting from version 2012 - Supported operating systems for .NET Core and .NET 5+
- Linux with glibc 2.17+ (for example, CentOS 7+) and musl-based (Alpine)
Windows 10
Windows Server starting from version 2012 - Serverless
- Azure App Service Windows and Linux - Web Apps only, Function Apps are not supported
- Supported .NET runtimes (64-bit applications)
- .NET Framework 4.6.1+
.NET Core 2.1, 3.1
.NET 5
.NET 6
.NET 7
.NET 8
.NET 9
.NET 10
For containers, more than one core is required. Read the Troubleshooting documentation for more details.
- Supported languages
- Any language that targets the .NET runtime, such as C#, F#, and Visual Basic.
The following profiling features are available in the following minimum versions of the dd-trace-dotnet library:
| Feature | Required dd-trace-dotnet version | Required .NET Runtime versions |
|---|---|---|
| Wall time profiling | 2.7.0+ | All supported runtime versions. |
| CPU profiling | 2.15.0+ | All supported runtime versions. |
| GC CPU consumption | 3.19.0+ | .NET 5+ |
| Exceptions profiling | 2.31.0+ | All supported runtime versions. |
| Allocations profiling | 3.12.0+ / 3.28.0+ | .NET Framework (requires Datadog Agent 7.51+ and 3.12.0+) / .NET 6+ (requires 2.18.0+ but Datadog recommends .NET10 with 3.28+). |
| Lock Contention profiling | 2.49.0+ | .NET Framework (requires Datadog Agent 7.51+) and .NET 5+ |
| Live heap profiling | 3.28.0+ | .NET 7+ but Datadog recommends .NET 10+. |
| Trace to Profiling integration | 2.30.0+ | All supported runtime versions. |
| Endpoint Profiling | 2.15.0+ | All supported runtime versions. |
| Timeline | 2.30.0+ (and 3.19.0+ for outgoing HTTP requests longer than 50 ms in beta and thread start/end events) | All supported runtime versions (except .NET 5+ required for garbage collection details and .NET 7+ required for outgoing HTTP requests). |
| Memory Leak investigation | 3.33.0+ | .NET 6+ (in preview) |
- Allocations and Lock Contention profiling for .NET Framework requires that the Datadog Agent and the profiled applications are running on the same machine.
- Due to a limitation of the .NET Framework, Allocations profiling does not show the size of the allocations. Instead, it only shows the count.
- Allocations and Live Heap profiling are available in .NET 10. For other previous versions of .NET, the statistical distribution of allocations sampling might not be accurate, so expect larger objects to be represented more often
- Continuous Profiler is not supported for AWS Lambda.
- Continuous Profiler does not support ARM64.
Unlike APM, Continuous Profiler is not activated by default when the APM package is installed. You must explicitly enable it for the applications you want to profile.
Installation
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+. The profiler ships together with the SDK (beginning with v2.8.0), so if you are already using APM to collect traces for your application, you can skip installing the library and go directly to Enabling the Profiler.
Otherwise, install the profiler using the following steps, depending on your operating system.
Datadog's automatic instrumentation relies on the .NET CLR Profiling API. Since this API allows only one subscriber, run only one APM solution in your application environment.
You can install the Datadog .NET Profiler machine-wide so that any services on the machine can be instrumented, or you can install it on a per-application basis to allow developers to manage the instrumentation through the application's dependencies. To see machine-wide installation instructions, click the Windows or Linux tab. To see per-application installation instructions, click the NuGet tab.
- With Single Step APM Instrumentation, there is nothing else to install. Go to Enabling the Profiler to see how to activate the profiler for an application.
If APM was already manually installed, you must uninstall it by removing the following environment variables:
CORECLR_ENABLE_PROFILINGCORECLR_PROFILERCORECLR_PROFILER_PATH- The value that points to
Datadog.Linux.ApiWrapper.x64.soinLD_PRELOAD
For example, if you are setting these environment variables in your dockerfile for a service, you should remove them to avoid conflicts with Single Step Instrumentation. If these environment variables are still set, the corresponding previously installed version is silently used instead of the one installed with Single Step Instrumentation.
To install the .NET Profiler machine-wide:
Download the latest .NET Tracer package that supports your operating system and architecture.
Run one of the following commands to install the package and create the .NET log directory
/var/log/datadog/dotnetwith the appropriate permissions:- Debian or Ubuntu
sudo dpkg -i ./datadog-dotnet-apm_<TRACER_VERSION>_amd64.deb && sudo /opt/datadog/createLogPath.sh- CentOS 7+ or Fedora
sudo rpm -Uvh datadog-dotnet-apm<TRACER_VERSION>-1.x86_64.rpm && sudo /opt/datadog/createLogPath.sh- Alpine or other musl-based distributions
sudo tar -C /opt/datadog -xzf datadog-dotnet-apm<TRACER_VERSION>-musl.tar.gz && sudo sh /opt/datadog/createLogPath.sh- Other distributions
sudo tar -C /opt/datadog -xzf datadog-dotnet-apm-<TRACER_VERSION>.tar.gz && sudo /opt/datadog/createLogPath.sh
To install the .NET Profiler machine-wide:
Install or upgrade to the latest version, using the .NET Monitoring MSI installer. Continuous Profiler supports 64-bit Windows, so you need the file like
datadog-dotnet-apm-<VERSION>-x64.msi.Run the installer with administrator privileges.
This installation does not instrument applications running in IIS. For applications running in IIS, follow the Windows machine-wide installation process.
To install the .NET Profiler per-application:
- Add the
Datadog.Trace.BundleNuGet package to your application.
Only Web Apps are supported. Functions are not supported.
To install the .NET Profiler per-webapp:
- Install the Azure App Service Datadog APM Extension for Windows or use the Linux setup for your webapp.
Enabling the Profiler
Datadog does not recommend enabling the profiler at machine-level or for all IIS applications. If you have enabled it machine-wide, read the Troubleshooting documentation for information about reducing the overhead that is associated with enabling the profiler for all system applications.
With Single Step APM Instrumentation, only DD_PROFILING_ENABLED must be set to activate the profiler for an application.
DD_PROFILING_ENABLED=1
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
Here are the supported values for DD_PROFILING_ENABLED environment variable:
| Value | Description |
|---|---|
1 or true | Activate the profiler. |
Auto | Activate the profiler if and only if (1) a trace has been created and (2) the application lasts more than 30 seconds. |
0 or false | Disable the profiler. |
The Auto value is aimed to avoid short lived processes without any trace. This feature is in Preview.
Set the following required environment variables for automatic instrumentation to attach to your application:
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH=/opt/datadog/Datadog.Trace.ClrProfiler.Native.so
DD_DOTNET_TRACER_HOME=/opt/datadog
LD_PRELOAD=/opt/datadog/continuousprofiler/Datadog.Linux.ApiWrapper.x64.so
DD_PROFILING_ENABLED=1
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
For standalone applications, manually restart the application as you normally would.
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
A couple of minutes after you start your application, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Set needed environment variables to configure and enable Profiler. To enable the Profiler for IIS applications, it is required to set the DD_PROFILING_ENABLED environment variable in the Registry under HKLM\System\CurrentControlSet\Services\WAS and HKLM\System\CurrentControlSet\Services\W3SVC nodes.
Starting v2.14.0, you don't need to set CORECLR_PROFILER or COR_PROFILER if you installed the SDK using the MSI.
With the Registry Editor:
In the Registry Editor, modify the multi-string value called Environment in the HKLM\System\CurrentControlSet\Services\WAS and HKLM\System\CurrentControlSet\Services\W3SVC nodes and set the value data as follows:
For .NET Core and .NET 5+:
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
For .NET Framework:
COR_ENABLE_PROFILING=1
COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
The environment variables are applied for all IIS applications. Starting with IIS 10, you can set environment variables for each IIS application in the C:\Windows\System32\inetsrv\config\applicationhost.config file. Read the Microsoft documentation for more details.
Completely stop and start IIS by running the following commands as an administrator:
net stop /y was
net start w3svc
Use stop and start commands. A reset or restart does not always work.
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
A couple of minutes after you start your application, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Set needed environment variables to configure and enable Profiler. To enable the Profiler for your service, it is required to set the DD_PROFILING_ENABLED environment variable in the Registry key associated to the service. If the profiler is running alone (the SDK is deactivated), you can optionally add the DD_SERVICE, DD_ENV and DD_VERSION environment variables.
Starting v2.14.0, you don't need to set CORECLR_PROFILER or COR_PROFILER if you installed the SDK using the MSI.
With the Registry Editor:
In the Registry Editor, create a multi-string value called Environment in the HKLM\System\CurrentControlSet\Services\MyService key and set the value data to:
For .NET Core and .NET 5+:
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
DD_SERVICE=MyService
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
For .NET Framework:
COR_ENABLE_PROFILING=1
COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
DD_PROFILING_ENABLED=1
DD_SERVICE=MyService
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
With a PowerShell script:
For .NET Core and .NET 5+:
[string[]] $v = @(
"CORECLR_ENABLE_PROFILING=1",
"CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
"DD_PROFILING_ENABLED=1",
"DD_SERVICE=MyService",
"DD_ENV=production",
"DD_VERSION=1.2.3"
)
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\MyService -Name Environment -Value $v
For .NET Framework:
[string[]] $v = @(
"COR_ENABLE_PROFILING=1",
"COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}",
"DD_PROFILING_ENABLED=1",
"DD_SERVICE=MyService",
"DD_ENV=production",
"DD_VERSION=1.2.3"
)
Set-ItemProperty HKLM:SYSTEM\CurrentControlSet\Services\MyService -Name Environment -Value $v
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
A couple of minutes after you start your application, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Starting v2.14.0, you don't need to set CORECLR_PROFILER or COR_PROFILER if you installed the SDK using the MSI.
Set needed environment variables to configure and enable Profiler for a non-service application, such as console, ASP.NET (Core), Windows Forms, or WPF. To enable the Profiler for Standalone applications, it is required to set the DD_PROFILING_ENABLED environment variable. If the profiler is running alone (the SDK is deactivated), you can optionally set the DD_SERVICE, DD_ENV and DD_VERSION environment variables. The recommended approach is to create a batch file that sets these and starts the application, and run your application using the batch file.
For .NET Core and .NET 5+:
SET CORECLR_ENABLE_PROFILING=1
SET CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET DD_PROFILING_ENABLED=1
SET DD_SERVICE=MyService
REM other optional environment variables
SET DD_ENV=production
SET DD_VERSION=1.2.3
REM start the application here
For .NET Framework:
SET COR_ENABLE_PROFILING=1
SET COR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
SET DD_PROFILING_ENABLED=1
SET DD_SERVICE=MyService
REM other optional environment variables
SET DD_ENV=production
SET DD_VERSION=1.2.3
REM start the application here
Optional: Set up Source Code Integration to connect your profiling data with your Git repositories.
A couple of minutes after you start your application, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Set the following required environment variables for profiling to attach to your application:
CORECLR_ENABLE_PROFILING=1
CORECLR_PROFILER={846F5F1C-F9AE-4B07-969E-05C26BC060D8}
CORECLR_PROFILER_PATH=<System-dependent path>
DD_PROFILING_ENABLED=1
LD_PRELOAD=<System-dependent path>
DD_SERVICE=MyService
# other optional environment variables
DD_ENV=production
DD_VERSION=1.2.3
DD_DOTNET_TRACER_HOME=<APP_DIRECTORY>/datadog
The value for the <APP_DIRECTORY> placeholder is the path to the directory containing the application's .dll files. The value for the CORECLR_PROFILER_PATH environment variable varies based on the system where the application is running:
| Operating System and Process Architecture | CORECLR_PROFILER_PATH Value | LD_PRELOAD Value |
|---|---|---|
| Alpine Linux x64 | <APP_DIRECTORY>/datadog/linux-musl-x64/Datadog.Trace.ClrProfiler.Native.so | <APP_DIRECTORY>/datadog/linux-musl-x64/Datadog.Linux.ApiWrapper.x64.so |
| Linux x64 | <APP_DIRECTORY>/datadog/linux-x64/Datadog.Trace.ClrProfiler.Native.so | <APP_DIRECTORY>/datadog/linux-x64/Datadog.Linux.ApiWrapper.x64.so |
| Linux ARM64 | <APP_DIRECTORY>/datadog/linux-arm64/Datadog.Trace.ClrProfiler.Native.so | <APP_DIRECTORY>/datadog/linux-arm64/Datadog.Linux.ApiWrapper.x64.so |
| Windows x64 | <APP_DIRECTORY>\datadog\win-x64\Datadog.Trace.ClrProfiler.Native.dll | N/A |
| Windows x86 | <APP_DIRECTORY>\datadog\win-x86\Datadog.Trace.ClrProfiler.Native.dll | N/A |
For Docker images running on Linux, configure the image to run the createLogPath.sh script:
RUN /<APP_DIRECTORY>/datadog/createLogPath.sh
Docker examples are available in the dd-trace-dotnet repository.
For standalone applications, manually restart the application.
Configuration
You can configure the profiler using the following environment variables. Most of these settings also apply to the Tracer configuration. Restart the application after any of these settings is changed.
| Environment variable | Type | Description |
|---|---|---|
DD_ENV | String | The environment name, for example, production. If not set, will be unspecified-environment |
DD_SERVICE | String | The service name, for example, web-backend. If this is not specified, the .NET Profiler tries to determine the service name automatically from the application name (process entry assembly or process name). |
DD_VERSION | String | The version of your service. If not set, will be unspecified-version |
DD_TAGS | String | Tags to apply to an uploaded profile. Must be a list of <key>:<value> separated by commas such as: layer:api,team:intake. |
DD_AGENT_HOST | String | Sets the host where profiles are sent (the host running the Agent). Can be a hostname or an IP address. Ignored if DD_TRACE_AGENT_URL is set. Defaults to localhost. |
DD_TRACE_AGENT_PORT | String | Sets the port where profiles are sent (the port where the Agent is listening for connections). Ignored if DD_TRACE_AGENT_URL is set. Defaults to 8126. |
DD_TRACE_AGENT_URL | String | Sets the URL endpoint where profiles are sent. Overrides DD_AGENT_HOST and DD_TRACE_AGENT_PORT if set. Defaults to http://<DD_AGENT_HOST>:<DD_TRACE_AGENT_PORT>. |
DD_TRACE_DEBUG | Boolean | Enables or disables debug logging (Could help in case of troubleshooting investigation). Valid values are: true or false. Defaults to false. |
DD_PROFILING_LOG_DIR | String | Sets the directory for .NET Profiler logs. Defaults to %ProgramData%\Datadog .NET Tracer\logs\. (Prior to v2.24, the default directory was %ProgramData%\Datadog-APM\logs\) |
DD_PROFILING_ENABLED | Boolean | If set to true, enables the .NET Profiler. Defaults to false. |
DD_PROFILING_WALLTIME_ENABLED | Boolean | If set to false, disables the Wall time profiling. Defaults to true. |
DD_PROFILING_CPU_ENABLED | Boolean | If set to false, disables the CPU profiling. Defaults to true. |
DD_PROFILING_EXCEPTION_ENABLED | Boolean | If set to true, enables Exception profiling. Defaults to false. |
DD_PROFILING_ALLOCATION_ENABLED | Boolean | If set to true, enables Allocation profiling (in Preview). Defaults to false. |
DD_PROFILING_LOCK_ENABLED | Boolean | If set to true, enables Lock Contention profiling. Defaults to false. |
DD_PROFILING_HEAP_ENABLED | Boolean | If set to true, enables Live Heap profiling (in Preview). Defaults to false. |
DD_PROFILING_GC_ENABLED | Boolean | If set to false, disables Garbage Collection profiling used in Timeline user interface. Defaults to true. |
DD_PROFILING_HTTP_ENABLED | Boolean | If set to true, enables outgoing HTTP request profiling used in Timeline user interface. Defaults to false. |
DD_PROFILING_HEAPSNAPSHOT_ENABLED | Boolean | If set to true, enables the regular generation of a heap snapshot when an increase in memory consumption is detected. This is used in the Memory Leak user interface. Defaults to false. |
For IIS applications, you must set environment variables in the Registry (under HKLM\System\CurrentControlSet\Services\WAS and HKLM\System\CurrentControlSet\Services\W3SVC nodes) as shown in the Windows Service tab, above. The environment variables are applied for all IIS applications. Starting with IIS 10, you can set environment variables for each IIS application in the C:\Windows\System32\inetsrv\config\applicationhost.config file. Read the Microsoft documentation for more details.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
The Datadog Profiler requires at least PHP 7.1, on 64-bit Linux.
PHP ZTS builds are supported since dd-trace-php version 0.99+, while PHP debug builds are not supported.
An operating system with glibc 2.17 or newer is required. The following versions or newer meet this requirement:
- CentOS 7
- Debian 8
- Ubuntu 14.04
The operating system versions above have all reached end of life (EOL), Datadog recommends running more recent versions.
Version 3.13 or newer of Alpine Linux is required because the profiler is built against musl v1.2.
Additionally, you need to install libgcc_s with:
apk add libgcc
The following profiling features are available in the following minimum versions of the dd-trace-php library:
| Feature | Required dd-trace-php version |
|---|---|
| Trace to Profiling integration | 0.89.0+ |
| Endpoint Profiling | 0.79.0+ |
| Timeline | 0.98.0+ |
| Source Code Integration | 1.13.0+ |
Continuous Profiler is not supported on serverless platforms, such as AWS Lambda.
Installation
To begin profiling applications:
Make sure Datadog Agent v6+ is installed and running. Datadog recommends using Datadog Agent v7+.
Download and run the
datadog-setup.phpinstaller:curl --proto '=https' --tlsv1.2 -sSfLO \ https://github.com/DataDog/dd-trace-php/releases/latest/download/datadog-setup.phpphp datadog-setup.php --enable-profiling --php-bin=allThis script is interactive and asks which of the detected PHP locations it should install to. At the end of the script, it outputs the non-interactive version of the command arguments for future use.
Configure the profiler:
php datadog-setup.php config set \ -d datadog.service=app-name \ -d datadog.env=prod \ -d datadog.version=1.3.2Apache, PHP-FPM, FrankenPHP, and other servers require a restart after changing the INI settings. See the configuration docs for more INI settings.
Validate the profiler extension is loaded by running
php -vand checking fordatadog-profilingin the output:PHP 8.4.13 (cli) (built: Sep 5 2025 11:52:54) (ZTS) Copyright (c) The PHP Group Zend Engine v4.4.13, Copyright (c) Zend Technologies with Zend OPcache v8.4.13, Copyright (c), by Zend Technologies with datadog-profiling v1.13.0, Copyright Datadog, by DatadogOptional: Set up Source Code Integration to connect your profiling data with your Git repositories.
After a couple of minutes, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
ddprof is in Preview. Datadog recommends evaluating the profiler in a non-sensitive environment before deploying in production.
The native profiler for compiled languages (ddprof) uses OS level APIs to collect profiling data. It is ideally suited for applications written in compiled languages, such as C, C++, or Rust. Profiles sent from ddprof show up under the native runtime in the Datadog web app.
Requirements
For a summary of the minimum and recommended runtime and tracer versions across all languages, read Supported Language and Tracer Versions.
- Supported operating systems
- Linux (glibc or musl)
- Supported architecture
amd64orarm64processors- Serverless
ddprofis not supported on serverless platforms, such as AWS Lambda.- OS Settings
perf_event_paranoidkernel setting is 2 or less (see Troubleshooting)- Debugging information
- Symbols should be available. The profiler cannot provide human-readable function names if the symbol table is stripped.
Installation
The profiler can be used either as a standalone executable or as a library. Skip to library installation instructions if you want to use it as a library.
Standalone
Download the latest
ddprofrelease. For example, here is one way to pull the latest release for anamd64(also known asx86_64) platform:curl -Lo ddprof-linux.tar.xz https://github.com/DataDog/ddprof/releases/latest/download/ddprof-amd64-linux.tar.xz tar xvf ddprof-linux.tar.xz mv ddprof/bin/ddprof INSTALLATION_TARGETWhere
INSTALLATION_TARGETspecifies the location you'd like to store theddprofbinary. The examples that follow assumeINSTALLATION_TARGETis set to./ddprof.Use
arm64instead ofamd64foraarch64platform.Modify your service invocation to include the profiler. Your usual command is passed as the last arguments to the
ddprofexecutable.export DD_ENV=prod export DD_SERVICE=my-web-app export DD_VERSION=1.0.3 ./ddprof myapp --arg1 --arg2If you usually launch your application using a shell builtin, for example:
exec myapp --arg1 --arg2Then you must invoke
ddprofwith that builtin instead:export DD_ENV=prod export DD_SERVICE=my-web-app export DD_VERSION=1.0.3 exec ./ddprof myapp --arg1 --arg2./ddprof --environment prod --service my-web-app --service_version 1.0.3 myapp --arg1 --arg2If you usually launch your application using a shell builtin, for example:
exec myapp --arg1Then you must invoke
ddprofwith that builtin instead:exec ./ddprof --environment prod --service my-web-app --service_version 1.0.3 myapp --arg1 --arg2A couple of minutes after you start your application, your profiles appear on the Datadog APM > Profiler page. If they do not, see the Troubleshooting guide.
Library
The library exposes a C API.
Download a release of ddprof with library support (v0.8.0 or later) and extract the tarball. For example:
curl -Lo ddprof-linux.tar.xz https://github.com/DataDog/ddprof/releases/latest/download/ddprof-amd64-linux.tar.xz tar xvf ddprof-linux.tar.xz --directory /tmpIn your code, start the profiler using the
ddprof_start_profiling()interface, defined in the_dd_profiling.h_header provided by the release. The profiler stops automatically when your program closes. To stop the profiler manually, useddprof_stop_profiling(ms)with themsparameter indicating the maximum block time of the function in milliseconds. Here is a standalone example (profiler_demo.c) in C:#include <stdlib.h> #include "dd_profiling.h" int foo(void) { int n = 0; for (int i = 0; i < 1000; i++) { n += 1; } return n; } int main(void) { // Initialize and start the Datadog profiler. Uses agent defaults if not // specified setenv("DD_ENV", "prod", 1); setenv("DD_SERVICE", "c_testservice", 1); setenv("DD_VERSION", "1.0.3", 1); ddprof_start_profiling(); // Do some work for (int i = 0; i < 1e6; i++) { foo(); } return 0; }Pass the
includeandlibsubdirectories of the extracted directory to your build system and link againstlibdd_profiling. For the above example:gcc -I/tmp/ddprof/include -L/tmp/ddprof/lib profiler_demo.c -o profiler_demo -ldd_profiling
Deploying the shared library
The shared library must be present in the system's library search path. Otherwise, the application will fail to start. Using the example from before:
./profiler_demo
./profiler_demo: error while loading shared libraries: libdd_profiling.so: cannot open shared object file: No such file or directory
Avoid this by linking against the static library.
Installing the library
Add the library to the search path by copying it to any existing search directory. To find out what your search directories are, on Linux systems, run:
ld --verbose | grep SEARCH_DIR | tr -s ' ;' \\n
Appending a search directory
Use the LD_LIBRARY_PATH environment variable to add additional search paths to the runtime linker. For example, using the directory layout from before:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/tmp/ddprof/lib
Configuration
The environment, service, and service_version settings are recommended, as they are used by the Profiling UI.
See the full list of parameters or use the command line.
ddprof --help
Logging
You can configure logging to one of several endpoints:
stdoutprints the logs to standard output stream (the default).stderrprints the logs to the standard error stream.syslogpublishes the logs to syslog, attempting to adhere to the specification in RFC 3164.disabledisables the logs entirely.- Any other value is treated as a file path, with a leading
/designating an absolute path.
Global
If you want to instrument all running process, you can try out the --global option. Global mode is intended for debug purposes. This requires elevated permissions. Depending on your setup, this can mean running as root, granting CAP_PERFMON, CAP_SYSADMIN, or setting perf_event_paranoid to -1.
./ddprof --environment staging --global --service_version full-host-profile
For most configurations, this consists of all processes visible within the profiler's PID namespace.
Not sure what to do next?
The Getting Started with Profiler guide takes a sample service with a performance problem and shows you how to use Continuous Profiler to understand and fix the problem.
Further reading
Additional helpful documentation, links, and articles:



