To find out if this integration is available in your organization, see your Datadog Integrations page or ask your organization administrator.
To initiate an exception request to enable this integration for your organization, email support@ddog-gov.com.
概要
このチェックは、Datadog Agent を通じて PHP OPcache を監視します。
セットアップ
ホストで実行されている Agent 用にこのチェックをインストールおよび構成する場合は、以下の手順に従ってください。コンテナ環境の場合は、オートディスカバリーのインテグレーションテンプレートのガイドを参照してこの手順を行ってください。
インストール
php_opcache チェックをホストにインストールするには
開発ツールキットをインストールします。
どのマシンでも。
ddev -e release build php_opcache を実行してパッケージをビルドします。
Datadog Agent をダウンロードします。
ビルドの成果物を Agent をインストール済みのホストにアップロードし、以下を実行します。
datadog-agent integration install -w path/to/php_opcache/dist/<ARTIFACT_NAME>.whl.
OPcache
OPcache はデフォルトでメトリクスを公開しないため、このインテグレーションには、次の場所にあるメトリクスエクスポーターが含まれます。
/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_opcache/assets/exporter/opcache-dd-handler.php
Datadog integrations-extras リポジトリからエクスポーターをダウンロードできます。
Agent を構成する とき、このファイル名でエクスポーターを直接参照するか、Web サーバーで Agent のエイリアスを構成できます。たとえば、Apache を使用している場合、Web サーバーコンフィギュレーションファイルのエイリアスは次のようになります。
Alias /opcache-status /opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_opcache/assets/exporter/opcache-dd-handler.php
<Location /opcache-status>
Require all denied
Require local
</Location>
構成
php_opcache のパフォーマンスデータの収集を開始するには、Agent のコンフィギュレーションディレクトリのルートにある conf.d/ フォルダーの php_opcache.d/conf.yaml ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル php_opcache.d/conf.yaml ファイルを参照してください。instances
- url: http://localhost/opcache-status
- Agent を再起動します。
検証
Agent の status サブコマンドを実行し、Checks セクションの php_opcache を探します。
収集データ
メトリクス
| |
|---|
php_opcache.opcache_enabled (gauge) | opcache enable flag |
php_opcache.cache_full (gauge) | cache full time |
php_opcache.restart_pending (gauge) | a restart pending |
php_opcache.restart_in_progress (gauge) | restart in progress |
php_opcache.memory_usage.used_memory (gauge) | used memory size Shown as byte |
php_opcache.memory_usage.free_memory (gauge) | free memory Shown as byte |
php_opcache.memory_usage.wasted_memory (gauge) | wasted memory Shown as byte |
php_opcache.memory_usage.current_wasted_percentage (gauge) | current wasted percentage Shown as percent |
php_opcache.interned_strings_usage.buffer_size (gauge) | interned string buffer size Shown as byte |
php_opcache.interned_strings_usage.used_memory (gauge) | interned string used memory Shown as byte |
php_opcache.interned_strings_usage.free_memory (gauge) | interned string free memory Shown as byte |
php_opcache.interned_strings_usage.number_of_strings (gauge) | interned string number of string Shown as byte |
php_opcache.opcache_statistics.num_cached_scripts (gauge) | num cached script Shown as item |
php_opcache.opcache_statistics.num_cached_keys (gauge) | num cached keys Shown as item |
php_opcache.opcache_statistics.max_cached_keys (gauge) | max cached keys Shown as item |
php_opcache.opcache_statistics.hits (gauge) | cache hit Shown as hit |
php_opcache.opcache_statistics.start_time (gauge) | cache start time Shown as time |
php_opcache.opcache_statistics.last_restart_time (gauge) | last restart time Shown as time |
php_opcache.opcache_statistics.oom_restarts (gauge) | oom restart count Shown as occurrence |
php_opcache.opcache_statistics.hash_restarts (gauge) | hash restart count Shown as occurrence |
php_opcache.opcache_statistics.manual_restarts (gauge) | description Shown as occurrence |
php_opcache.opcache_statistics.misses (gauge) | number of cache miss Shown as miss |
php_opcache.opcache_statistics.blacklist_misses (gauge) | number of black list misses Shown as miss |
php_opcache.opcache_statistics.blacklist_miss_ratio (gauge) | percent of black list miss ratio Shown as percent |
php_opcache.opcache_statistics.opcache_hit_rate (gauge) | percent of hit ratio Shown as percent |
イベント
PHP OPcache インテグレーションには、イベントは含まれません。
サービスチェック
php_opcache.can_connect
Returns CRITICAL if the Agent is unable to connect to and collect metrics from the monitored OPcache instance. Returns OK otherwise.
Statuses: ok, critical
トラブルシューティング
ご不明な点は、Datadog のサポートチームまでお問合せください。