- はじめに
- エージェント
- インテグレーション
- Watchdog
- イベント
- ダッシュボード
- モバイルアプリケーション
- インフラストラクチャー
- サーバーレス
- メトリクス
- ノートブック
- アラート設定
- APM & Continuous Profiler
- CI Visibility
- RUM & セッションリプレイ
- データベース モニタリング
- ログ管理
- セキュリティプラットフォーム
- Synthetic モニタリング
- ネットワークモニタリング
- 開発者
- API
- アカウントの管理
- データセキュリティ
- ヘルプ
The profiler is shipped within Datadog tracing libraries. 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.
The Datadog Profiler requires JDK Flight Recorder. The Datadog Profiler library is supported in OpenJDK 11+, Oracle JDK 11+, OpenJDK 8 (version 8u262+) and Azul Zulu 8+ (version 8u212+). It is not supported in OpenJ9 as it doesn’t support the JDK Flight Recorder.
Because non-LTS JDK versions may not contain stability and performance fixes related to the Datadog Profiler library, use versions 8, 11, and 17 of the Long Term Support JDK.
All JVM-based languages, such as Java, Scala, Groovy, Kotlin, and Clojure are supported.
Continuous Profiler is not supported on serverless platforms, such as AWS Lambda.
To begin profiling applications:
If you are already using Datadog, upgrade your Agent to version 7.20.2+ or 6.20.2+. If you don’t have APM enabled to set up your application to send data to Datadog, in your Agent, set the DD_APM_ENABLED
environment variable to true
and listening to the port 8126/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'
Note: Profiler is available in the dd-java-agent.jar
library in versions 0.55+.
Enable the profiler by setting -Ddd.profiling.enabled
flag or DD_PROFILING_ENABLED
environment variable to true
. Specify dd.service
, dd.env
, and dd.version
so you can filter and group your profiles across these dimensions:
Invoke your service:
java \
-javaagent:dd-java-agent.jar \
-Ddd.service=<YOUR_SERVICE> \
-Ddd.env=<YOUR_ENVIRONMENT> \
-Ddd.version=<YOUR_VERSION> \
-Ddd.profiling.enabled=true \
-XX:FlightRecorderOptions=stackdepth=256 \
-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 \
-XX:FlightRecorderOptions=stackdepth=256 \
-jar <YOUR_SERVICE>.jar <YOUR_SERVICE_FLAGS>
Note: The -javaagent
argument needs to be before -jar
, adding it as a JVM option rather than an application argument. For more information, see the Oracle documentation:
# Good:
java -javaagent:dd-java-agent.jar ... -jar my-service.jar -more-flags
# Bad:
java -jar my-service.jar -javaagent:dd-java-agent.jar ...
After a minute or two, you can visualize your profiles on the Datadog APM > Profiling page.
In dd-java-agent v0.84.0+ and Java 15 and lower, the allocation profiler is turned off by default because it can use excessive CPU in allocation-heavy applications. This isn’t common, so you may want to try it in a staging environment to see if it affects your application. To enable it, see Enabling the allocation profiler.
You can configure the profiler using the following environment variables:
Environment variable | Type | Description |
---|---|---|
DD_PROFILING_ENABLED | Boolean | Alternate for -Ddd.profiling.enabled argument. Set to true to enable profiler. |
DD_PROFILING_ALLOCATION_ENABLED | Boolean | Alternate for -Ddd.profiling.allocation.enabled argument. Set to true to enable the allocation profiler. It requires the profiler to be enabled already. |
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 . |
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.