Supported OS Linux Mac OS Windows

インテグレーションバージョン3.0.0

概要

プロセスチェックを使用して、以下のことができます。

  • 任意のホスト上で実行されている特定プロセスのリソース使用状況メトリクスを収集できます。たとえば、CPU、メモリ、I/O、スレッド数などです。
  • プロセスモニターを使用して、実行されなければならない特定プロセスのインスタンス数にしきい値を設定し、そのしきい値が満たされない場合にアラートを発行します (下のサービスのチェックを参照)。

セットアップ

インストール

プロセスチェックは Datadog Agent パッケージに含まれています。サーバーに追加でインストールする必要はありません。

コンフィギュレーション

他の多くのチェックとは異なり、デフォルトのプロセスチェックは、特に役立つ監視を行いません。どのプロセスを監視するかを構成する必要があります。

標準的なデフォルトのチェックコンフィギュレーションはありませんが、以下に SSH/SSHD 処理を監視する process.d/conf.yaml の例を示します。使用可能なすべての構成オプションの詳細については、サンプル process.d/conf.yaml を参照してください。

init_config:
instances:
- name: ssh
  search_string:
    - ssh
    - sshd

: 構成の変更後は、必ず Agent を再起動してください。

一部のプロセスメトリクスを取得するには、Datadog コレクターを監視対象プロセスのユーザーとして実行するか、特権的なアクセスを与えて実行する必要があります。Unix プラットフォームの open_file_descriptors メトリクスについては、追加の構成オプションがあります。conf.yaml ファイルで try_sudotrue に設定すると、プロセスチェックは sudo を使用して open_file_descriptors メトリクスの収集を試みることができます。この構成オプションを使用するには、/etc/sudoers で適切な sudoers ルールを設定する必要があります。

dd-agent ALL=NOPASSWD: /bin/ls /proc/*/fd/

検証

Agent の status サブコマンドを実行し、Checks セクションで process を探します。

メトリクスに関するメモ

以下のメトリクスは、Linux および macOS では使用できません。

  • Agent が読み取るファイル (/proc//io) はプロセスのオーナーのみ読み取り可能であるため、Process I/O メトリクスは Linux または macOS では使用できません。詳しくは、Agent FAQ をご参照ください

以下のメトリクスは、Windows では使用できません。

  • system.cpu.iowait
  • system.processes.mem.page_faults.minor_faults
  • system.processes.mem.page_faults.children_minor_faults
  • system.processes.mem.page_faults.major_faults
  • system.processes.mem.page_faults.children_major_faults

: Windows でページフォールトメトリクスを収集するには、WMI チェックを使用します。

すべてのメトリクスは process.yaml で構成された instance ごとに収集され、process_name:<instance_name> のタグが付きます。

このチェックにより送信される system.processes.cpu.pct メトリクスは、30 秒間以上存在する処理でのみ正確です。 それ以下の短い処理の場合、その値は正確でない場合があります。

メトリクスの完全なリストについては、メトリクスセクションを参照してください。

収集データ

メトリクス

system.processes.cpu.pct
(gauge)
The CPU utilization of a process.
Shown as percent
system.processes.cpu.normalized_pct
(gauge)
The normalized CPU utilization of a process.
Shown as percent
system.processes.involuntary_ctx_switches
(gauge)
The number of involuntary context switches performed by this process.
Shown as event
system.processes.ioread_bytes
(gauge)
The number of bytes read from disk by this process. In Windows: the number of bytes read.
Shown as byte
system.processes.ioread_bytes_count
(count)
The number of bytes read from disk by this process. In Windows: the number of bytes read.
Shown as byte
system.processes.ioread_count
(gauge)
The number of disk reads by this process. In Windows: the number of reads by this process.
Shown as read
system.processes.iowrite_bytes
(gauge)
The number of bytes written to disk by this process. In Windows: the number of bytes written by this process.
Shown as byte
system.processes.iowrite_bytes_count
(count)
The number of bytes written to disk by this process. In Windows: the number of bytes written by this process.
Shown as byte
system.processes.iowrite_count
(gauge)
The number of disk writes by this process. In Windows: the number of writes by this process.
Shown as write
system.processes.mem.page_faults.minor_faults
(gauge)
In Unix/Linux and macOS: The number of minor page faults per second for this process.
Shown as occurrence
system.processes.mem.page_faults.children_minor_faults
(gauge)
In Unix/Linux and macOS: The number of minor page faults per second for children of this process.
Shown as occurrence
system.processes.mem.page_faults.major_faults
(gauge)
In Unix/Linux and macOS: The number of major page faults per second for this process.
Shown as occurrence
system.processes.mem.page_faults.children_major_faults
(gauge)
In Unix/Linux and macOS: The number of major page faults per second for children of this process.
Shown as occurrence
system.processes.mem.pct
(gauge)
The process memory consumption.
Shown as percent
system.processes.mem.real
(gauge)
The non-swapped physical memory a process has used and cannot be shared with another process (Linux only).
Shown as byte
system.processes.mem.rss
(gauge)
The non-swapped physical memory a process has used. aka "Resident Set Size".
Shown as byte
system.processes.mem.vms
(gauge)
The total amount of virtual memory used by the process. aka "Virtual Memory Size".
Shown as byte
system.processes.number
(gauge)
The number of processes.
Shown as process
system.processes.open_file_descriptors
(gauge)
The number of file descriptors used by this process (only available for processes run as the dd-agent user)
system.processes.open_handles
(gauge)
The number of handles used by this process.
system.processes.threads
(gauge)
The number of threads used by this process.
Shown as thread
system.processes.voluntary_ctx_switches
(gauge)
The number of voluntary context switches performed by this process.
Shown as event
system.processes.run_time.avg
(gauge)
The average running time of all instances of this process
Shown as second
system.processes.run_time.max
(gauge)
The longest running time of all instances of this process
Shown as second
system.processes.run_time.min
(gauge)
The shortest running time of all instances of this process
Shown as second

イベント

プロセスチェックには、イベントは含まれません。

サービスのチェック

process.up
Returns OK if the check is within the warning thresholds, CRITICAL if it’s outside of the critical thresholds, and WARNING if it’s outside of the warning thresholds.
Statuses: ok, warning, critical

トラブルシューティング

ご不明な点は、Datadog のサポートチームまでお問合せください。

その他の参考資料

プロセスのリソース消費を監視する方法 (または理由) について理解するには、こちらのブログ記事を参照してください。