Skip to main content
info

In March 2023, Grafana Labs acquired Pyroscope, the company behind the eponymous open source continuous profiling project. In September 2023, Grafana Pyroscope v1.0.0 was released.

This documentation covers Pyroscope versions preceding v1.0.0. We're keeping it for the time being, but we recommend that you upgrade to Grafana Pyroscope v1.0.0 or higher and switch to the new Grafana Pyroscope Docs for most up-to-date documentation.

PHP

Pyroscope uses phpspy to collect profiling data.

Supported platforms#

Spy NameTypeLinuxmacOSWindowsDocker
phpspyembedded✅✅

Profiling PHP application#

To start profiling a PHP application, add pyroscope exec before the command:

export PYROSCOPE_APPLICATION_NAME=my.php.appexport PYROSCOPE_SERVER_ADDRESS=http://pyroscope-server:4040
pyroscope exec php main.php

You can also attach pyroscope to already running process using pyroscope connect:

pyroscope connect --pid {my-app-pid}

Refer to Configuration page to learn more about Pyroscope Agent and how to configure it.