- 重要な情報
- はじめに
- 用語集
- ガイド
- エージェント
- インテグレーション
- OpenTelemetry
- 開発者
- API
- CoScreen
- アプリ内
- Service Management
- インフラストラクチャー
- アプリケーションパフォーマンス
- 継続的インテグレーション
- ログ管理
- セキュリティ
- UX モニタリング
- 管理
ランタイムメトリクスの収集は、ddtrace-run
環境で実行している場合 DD_RUNTIME_METRICS_ENABLED=true
の環境パラメーターで有効にできます。
ddtrace-run
を使用していない場合は、コードでランタイムメトリクスの収集を有効にできます。
from ddtrace.runtime import RuntimeMetrics
RuntimeMetrics.enable()
ランタイムメトリクスは、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 |
APM サービス詳細画面にこれらのメトリクスを表示するだけでなく、Datadog はデフォルトの Python ランタイムメトリクスダッシュボードを提供します。