PHP OPcache

Supported OS Linux Mac OS Windows

Intégration0.0.1

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.

Présentation

Ce check permet de surveiller PHP OPcache avec l’Agent Datadog.

Configuration

Suivez les instructions ci-dessous pour installer et configurer ce check lorsque l’Agent est exécuté sur un host. Consultez la documentation relative aux modèles d’intégration Autodiscovery pour découvrir comment appliquer ces instructions à des environnements conteneurisés.

Installation

Pour installer le check php_opcache sur votre host :

  1. Installez le kit de développement. sur n’importe quelle machine.

  2. Exécutez ddev release build php_opcache pour générer le package.

  3. Téléchargez l’Agent Datadog.

  4. Importez l’artefact du build sur tous les hosts avec un Agent et exécutez datadog-agent integration install -w chemin/vers/php_opcache/dist/<NOM_ARTEFACT>.whl.

OPcache

Puisqu’OPcache n’expose pas les métriques par défaut, cette intégration inclut un outil d’exportation de métriques, qui se trouve à l’emplacement suivant :

/opt/datadog-agent/embedded/lib/python3.8/site-packages/datadog_checks/php_opcache/assets/exporter/opcache-dd-handler.php

Vous pouvez télécharger l’outil d’exportation depuis le référentiel integrations-extras de Datadog.

Lors de la configuration de votre Agent, appelez l’outil d’exportation en utilisant directement ce nom de fichier, ou configurez un alias pour celui-ci sur votre serveur Web. SI vous utilisez Apache, voici un exemple d’alias dans le fichier de configuration du serveur 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>

Configuration

  1. Modifiez le fichier php_opcache.d/conf.yaml dans le dossier conf.d/ à la racine du répertoire de configuration de votre Agent pour commencer à recueillir vos données de performance php_opcache. Consultez le fichier d’exemple php_opcache.d/conf.yaml pour découvrir toutes les options de configuration disponibles.
    instances
      - url: http://localhost/opcache-status
    
  2. Redémarrez l’Agent.

Validation

Lancez la sous-commande status de l’Agent et cherchez php_opcache dans la section Checks.

Données collectées

Métriques

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

Événements

L’intégration PHP OPcache n’inclut aucun événement.

Checks de service

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

Dépannage

Besoin d’aide ? Contactez l’assistance Datadog.