Skip to content

Latest commit

 

History

History

php_opcache

Agent Check: php_opcache

Overview

This check monitors PHP OPcache through the Datadog Agent.

Setup

Follow the instructions below to install and configure this check for an Agent running on a host. For containerized environments, see the Autodiscovery Integration Templates for guidance on applying these instructions.

Installation

To install the php_opcache check on your host:

  1. Install the developer toolkit. on any machine.

  2. Run ddev release build php_opcache to build the package.

  3. Download the Datadog Agent.

  4. Upload the build artifact to any host with an Agent and run datadog-agent integration install -w path/to/php_opcache/dist/<ARTIFACT_NAME>.whl.

OPcache Setup

OPcache does not expose metrics by default so this integration includes a metric exporter, located here:

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

You can download the exporter from here.

When you configure your Agent (the instances setting, described next), you can refer to the exporter directly by this file name, or you can configure an alias for it on your web server. For example, if you're using Apache, the alias in the web server configuration file would look like this:

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. Edit the php_opcache.d/conf.yaml file, in the conf.d/ folder at the root of your Agent's configuration directory to start collecting your php_opcache performance data. See the sample php_opcache.d/conf.yaml file for all available configuration options.
    instances
      - url: http://localhost/opcache-status
    
  2. Restart the Agent.

Validation

Run the Agent's status subcommand and look for php_opcache under the Checks section.

Data Collected

Metrics

See metadata.csv for a list of metrics provided by this check.

Service Checks

php_opcache does not include any service checks.

Events

php_opcache does not include any events.

Troubleshooting

Need help? Contact Datadog support.