ランタイムメトリクスの収集は、ddtrace-run
環境で実行している場合 DD_RUNTIME_METRICS_ENABLED=true
の環境パラメーターで有効にできます。
ランタイムメトリクスは、Python サービスと相関して表示できます。Datadog のサービス詳細画面を参照してください。
注: ランタイム UI では、ddtrace
>= 0.24.0
がサポートされています。
初期設定では、アプリケーションからのランタイムメトリクスは DogStatsD のポート 8125
から Datadog Agent に送信されます。DogStatsD が Agent に対して有効になっていることを確認してください。
Agent をコンテナとして実行している場合は、DD_DOGSTATSD_NON_LOCAL_TRAFFIC
が true に設定されていること、また Agent 上でポート 8125
が開いていることを確認してください。
Kubernetes では、DogstatsD ポートをホストポートにバインドし、ECS ではタスク定義で適切なフラグを設定します。
以下のメトリクスはランタイムメトリクスを有効にした後、デフォルトで収集されます。
runtime.python.cpu.time.sys (gauge) | Number of seconds executing in the kernel Shown as second |
runtime.python.cpu.time.user (gauge) | Number of seconds executing outside the kernel Shown as second |
runtime.python.cpu.percent (gauge) | CPU utilization percentage Shown as percent |
runtime.python.cpu.ctx_switch.voluntary (gauge) | Number of voluntary context switches Shown as invocation |
runtime.python.cpu.ctx_switch.involuntary (gauge) | Number of involuntary context switches Shown as invocation |
runtime.python.gc.count.gen0 (gauge) | Number of generation 0 objects Shown as resource |
runtime.python.gc.count.gen1 (gauge) | Number of generation 1 objects Shown as resource |
runtime.python.gc.count.gen2 (gauge) | Number of generation 2 objects Shown as resource |
runtime.python.mem.rss (gauge) | Resident set memory Shown as byte |
runtime.python.thread_count (gauge) | Number of threads Shown as thread |
Datadog では、APM サービス詳細画面にこれらのメトリクスを表示し、これらのメトリクスに適用された service
および runtime-id
タグ付きのデフォルトの Python ランタイムダッシュボードを提供します。
このページ