Beta availability of PHP deep monitoring

Over the past few weeks the Dynatrace team has run an early-access program for PHP deep monitoring for Apache and PHP FPM. It’s now time to release the beta version of Dynatrace PHP monitoring support to the public.

Beginning with OneAgent, v1.79, PHP monitoring can be manually enabled either for all or individual hosts. To enable PHP monitoring for all hosts in your environment:

  1. Confirm that you’re running a version of OneAgent no older than v1.79.
  2. Go to Settings > Monitored technologies.
  3. Set the PHP slider to the On position.
  4. To enable detection and monitoring of PHP services, you must perform a complete restart of your Apache instances that run PHP and your FPM processes.

To enable PHP monitoring for individual hosts:

  1. Confirm that you’re running a version of OneAgent no older than v1.79.
  2. From the Dynatrace homepage, click the Hosts tile.
  3. Select the host you want to configure.
  4. Click Edit on the menu bar.
  5. Set the PHP slider to the On position.

What you get with PHP deep monitoring

Once you restart the Apache web server that runs PHP, select your Web Request service for analysis in Dynatrace. Once the service receives a PHP request, you’ll see a small PHP logo appear next to the Apache logo. Depending on what your PHP code does, once PHP monitoring is successfully enabled, you may also notice that your Apache Web request service now calls databases and/or other services that are called from within PHP.

PHP deep monitoring

Now select a PHP request from the Top web requests list. Then click the View response time hotspots button on the following page.

PHP deep monitoring

PHP response time analysis

Notice that database requests are now visible. Every SQL statement executed from within PHP is tracked, just as they are for Java, .NET, and Node.js. If your PHP code makes HTTP requests to other systems, you’ll see those as well.

Further down the page in the Breakdown of service execution time section Dynatrace shows you how much time Apache spends processing the selected request. Besides showing you Apache module times, Dynatrace also tells you how much Total execution time and CPU time your application spent compiling PHP files for this request. Click the PHP compilation entry to view any hotspots that were encountered in compiling the files. Such information can help you tune your caches and ensure that PHP compilation time doesn’t slow down your web page.

Dynatrace also tells you how much Total execution time and CPU time your PHP database interactions take. Click the Database activity entry to view database method-level details.

PHP deep monitoring

PHP CPU hot spot analysis

Another thing that’s new is CPU hotspot analysis for PHP and Apache requests. When you see a CPU intensive requests finding on a service page it means that Dynatrace has determined that a request is consuming considerably more CPU then other requests. Click any CPU intensive requests entry to view that request’s CPU consumption chart. You can in fact view a CPU consumption chart for any request: Just click Show all requests and select the request you’re interested in.

PHP deep monitoring PHP deep monitoring

PHP deep monitoring

What’s new is that Dynatrace now provides CPU hotspot analysis for Apache web request monitoring, which includes PHP. Click the View method hotspots button to view the analysis.

PHP deep monitoring

Hotspots analysis immediately shows you where a request consumes CPU: Apache internals, PHP compilation, or PHP execution.

Dynatrace database support

Dynatrace currently supports the following databases in PHP:

  • Oracle
  • PostgreSQL
  • MySQL/MariaDB (via mysql and mysqli drivers)
  • All databases from PDO drivers

What about FPM and Nginx?

Dynatrace automatically injects into FPM and fully supports Nginx/FPM and other FPM setups. Dynatrace automatically tracks all calls from your Nginx to specific FPM pools.

Each FPM pool is its own service. In the example below, the pool’s name is www. The pool hosts a Magento store. Dynatrace automatically discovers all requests and also identifies the most CPU-intensive and slowest requests

You can analyze the Response time and CPU consumption of individual requests. To view response time hotspots and understand what makes specific requests slow or resource intensive, click the View response time hotspots button.

Supported environments

Dynatrace supports PHP 5.3 and above on Linux platforms. Dynatrace supports FPM and mod_php in Apache.

Dynatrace currently doesn’t support the older fast-cgi in Apache, but we will add this support soon.

Known Issues

  • Automatic monitoring doesn’t currently work unless a php.ini is defined. Simply creating a default php.ini file works to solve this problem.

Stay updated