When OpenTelemetry PHP auto-instrumentation fits your production hosts
OpenTelemetry PHP auto-instrumentation fits a production host when your platform team needs traces from Laravel, Symfony or WordPress without rewriting application code, and when the host can run a PHP extension or a supported Linux package. The first decision is which of the two zero-code routes the host can take. The OpenTelemetry PHP zero-code documentation describes auto-instrumentation installed with Composer and a PECL extension, which works on Linux, macOS or Windows, and the PHP Distro, which installs as a deb, rpm or apk package on Linux only and comes with opinionated defaults. Hosts that are not Linux, or that cannot install system packages, point toward the Composer and PECL route. Hosts where your operations team wants a predictable, package-managed setup point toward the distro.
OpenTelemetry is a framework and toolkit for generating, exporting and collecting telemetry, not an observability backend. Whichever route you choose, traces still need a Collector and a backend such as a self-hosted tracing store, so plan that destination before you enable instrumentation on production. Ask your team to confirm which PHP version, web server (for example PHP-FPM or Apache) and operating system each production host runs, then check those against the current zero-code documentation, since support depends on the exact combination. Also confirm whether your WordPress hosts are managed in a way that allows PHP extensions to be installed, because shared or locked-down hosting often rules out the PECL route entirely.
The practical risk is treating zero-code coverage as complete coverage. Auto-instrumentation captures framework and library calls it recognizes, so business operations, queue jobs and custom database logic may still need manual spans. Plan a staging rollout on a host that mirrors production, measure request latency before and after, and agree who owns the extension or package version when PHP or the operating system is patched. Ask any implementation partner to write down the chosen route, the supported version matrix they tested and the rollback steps for each host type before work begins.
Choosing between Composer with PECL and the PHP Distro
The Composer and PECL route is the option that works across the most platforms. OpenTelemetry's PHP zero-code documentation lists it as available on Linux, macOS and Windows. The Composer package supplies the instrumentation libraries that your application loads, while the PECL extension supplies the native component that PHP loads at runtime. Your team installs and maintains both, so the route fits hosts where you control PHP configuration and want the instrumentation to follow the application's dependency lifecycle.
- What it touches: the application's
composer.jsonand vendor tree, plus the PHP extension configuration (php.inior a conf.d drop-in) on each host. - Platforms: Linux, macOS and Windows, which makes it the only route for developer workstations and Windows application servers.
- Defaults: nothing is preconfigured. Exporter endpoints, service names and sampling are set by your team through environment variables or configuration.
- Upgrades: the library version lives in the application repository, so changes move through the same review and deployment path as other code.
- Customized hosts: a host with a custom PHP build, a non-standard extension directory or a pinned PHP version fits this route better than a fixed package.
Confirm with your PHP and extension versions that the PECL build matches each host's PHP build before you roll it out.
The PHP Distro is a Linux-only package, delivered as a deb, rpm or apk, with opinionated defaults. It suits a fleet where every production host runs the same operating system family and the platform team wants one installation method that operations can audit. Because the package carries its own defaults, the application team has fewer settings to decide, and the platform team can manage it with the same tooling used for other system packages.
- What it touches: system package management and the PHP runtime on the host, rather than individual application repositories.
- OS families: deb for Debian-based systems, rpm for Red Hat-based systems and apk for Alpine-based systems. Check the supported distribution versions in the vendor documentation before you standardize on one.
- Defaults: the package ships opinionated settings, so the defaults are part of what you review and accept, not something you assemble yourself.
- Upgrades: package updates follow your existing patch cadence, which helps when auditors ask how a runtime component is kept current.
- Scope: it does not cover macOS or Windows, so hosts on those systems need the Composer and PECL route.
Confirm the distribution and PHP versions the package supports, and review its default exporter and sampling settings against your collector design.
A WordPress host with limited shell access often cannot take either route as written. The PECL extension needs permission to load a native module into PHP, and the Composer route needs a place to add libraries that the WordPress code can reach. On managed or shared hosting, the hosting provider usually controls the PHP build and the file system, so the first question is whether you can change PHP configuration at all. If you cannot, instrumentation may need to happen at the infrastructure layer or in a host where you do control the runtime.
- Shell access: confirm whether you can install a PECL extension and edit PHP configuration. Without both, the PECL route is not available.
- Plugin-based options: a WordPress plugin that adds telemetry runs inside the application and adds its own dependency and review burden, so treat it as a separate decision.
- Hosting model: a self-managed VM where you control PHP is a different case from a shared host, and the answer may differ across a single WordPress estate.
- Packages: the Linux distro route requires root or equivalent package management on the host, which many shared hosts do not grant.
- Ownership: agree who maintains the PHP build after installation, since the hosting provider may update it on their own schedule.
Before choosing, ask your hosting provider in writing which PHP build, extension mechanisms and package installation methods they support.
Configuration options and when each fits
This table compares the Composer and PECL path, the PHP Distro package path and the hybrid case where a team needs both. Read each row against your host type, operating system and PHP version, because the right path depends on what your production hosts allow you to install and how much configuration control you need.
| Decision factor | Composer and PECL | PHP Distro | Hybrid (both paths) |
|---|---|---|---|
| Platform support | Linux, macOS or Windows | Linux only | Linux for the distro, plus the other platforms for the Composer path |
| Install method | Composer packages plus a PECL extension compiled or installed into PHP | deb, rpm or apk package | Package install on Linux, Composer packages in application repositories |
| Defaults | You choose the instrumentation packages and settings | Opinionated defaults set by the distro | Distro defaults for the host, overrides per application |
| Control over configuration | High: per application, per environment, in code and environment variables | Lower: fewer knobs, suited to uniform hosts | High for applications, but two configurations to keep aligned |
| Fit for Laravel and Symfony | Good fit when you deploy from a build pipeline and want versioned dependencies | Possible on Linux app servers with a standard PHP build, confirm PHP version support | Useful when the platform team owns the host and developers own app-level tracing |
| Fit for WordPress hosts | Harder on shared or managed hosting where you cannot install PECL extensions | Fits self-managed Linux hosts where the package manager is available | Confirm which hosts allow package installs before you plan the split |
| Compatibility to confirm | PHP version, extension build and Composer package versions | Distro package version against your PHP and OS release | Both sets of versions, plus which path owns each host |
How to set up PHP instrumentation step by step
This sequence takes a PHP estate from inventory to telemetry in the backend, moving one environment at a time so each stage has a clear check before the next begins. Each step produces a result the operations team can verify.
Inventory PHP versions and hosts
The platform or application owner lists every PHP runtime in scope, including the PHP version, operating system, web server (such as Apache or Nginx with PHP-FPM), and whether each host runs Laravel, Symfony, WordPress or a custom application. Record which hosts are Linux, because the PHP Distro only installs on Linux, while Composer and PECL routes also cover macOS and Windows. Confirm the PHP version against the requirements in the OpenTelemetry PHP zero-code documentation before choosing a path. The step is done when every host has a row in an inventory with runtime, OS, web server and framework, and when unsupported combinations are flagged for a separate decision.
Choose the install path
Decide between the Composer and PECL route and the PHP Distro package on each host group. The Distro suits Linux hosts where you want opinionated defaults installed from a deb, rpm or apk package. The Composer and PECL route suits teams that need to control the extension and library versions per application, or that run on macOS or Windows. Ask the platform team which path your change process can approve and which package sources your hosts are allowed to reach. The step is done when a written decision names the path for each host group and records who owns the package or Composer dependency.
Install the instrumentation on one test host
On a single non-production host, install the chosen package or extension, then enable it for the PHP SAPI that serves the application. For the PECL route, confirm the extension loads with a PHP info or module listing command. For the Distro, confirm the package installed and the service configuration was written as documented. Keep the change in version control or configuration management so it can be repeated. The step is done when the PHP CLI and the web SAPI both report the extension or Distro module as loaded, and the application still serves its health endpoint without errors.
Point the agent at a Collector endpoint
Set the OTLP exporter endpoint, service name and resource attributes so telemetry goes to a Collector your team operates, not directly to a backend. Use environment variables or the PHP configuration file the install path provides, and store any authentication credentials in your secrets store rather than in the web root. Confirm the Collector is listening on the address you configured and that its receiver is reachable from the PHP host. The Collector's default server binding is localhost since v0.110.0, so a gateway serving remote agents needs an explicit bind address. The step is done when the Collector logs show a connection from the test host and no export errors are logged by PHP.
Run a test request and inspect the trace
Send a request that exercises the application's routing, database access and any outbound HTTP call. Use the Collector's debug exporter or logging output to view the spans produced for that request. Check that the root span carries the HTTP method, route and status, that database and outbound client spans appear as children, and that the service name matches your inventory. Note any spans or attributes that expose query text, headers or personal data, since these need redaction before production. The step is done when one request produces a complete trace in the Collector output and the sensitive-data review is recorded.
Confirm spans arrive in the backend
Route the Collector pipeline to your chosen trace backend, then search for the test request by service name and trace ID in that backend. Confirm the span tree matches what the Collector showed, and that the timestamps and durations are plausible. Check for dropped spans in the Collector's own metrics or logs. If your backend is not yet selected, do this step against a temporary backend and record the decision as an open item. The step is done when the operations team can open the same trace in the backend and see the same parent and child relationships as on the test host.
Stage the rollout across environments
Repeat the install in order: development, then test or staging, then a canary group of production hosts, then the remaining production hosts in batches. Use the same configuration management code for every environment, changing only the endpoint and service name. Keep a rollback step that removes the extension or Distro package and restores the prior PHP-FPM configuration, and rehearse it once in staging. Ask the vendor or service provider to confirm any support boundaries for the chosen path before production. The step is done when each environment has a dated record of the install, the canary has run without increased error rates in the application's own monitoring, and the rollback has been tested.
Review and document the running configuration
After the full rollout, compare the running configuration on each host with the approved template and record any drift. Document the install path, package or extension versions, Collector endpoint, service naming convention and the redaction rules applied. Schedule the review of PHP and instrumentation upgrades so they follow the same staged path. The step is done when the configuration baseline is stored in version control, every host matches it, and the upgrade owner is named.
How PHP telemetry flows from the host to the Collector
The path starts at the PHP-FPM or web server process on the application host, where either the Composer package with the PECL extension or the PHP Distro creates spans and metrics. The instrumentation exports them over OTLP to an OpenTelemetry Collector running as an agent on the host or as a gateway on a separate network. The trust boundary sits between the application host and the Collector network, so check what crosses it, how it is authenticated and encrypted, and which backend the client selects.
Request path from PHP-FPM through instrumentation and Collector to the chosen backend, with the host trust boundary.
Securing PHP telemetry before it leaves the host
PHP telemetry leaves the host as soon as the agent or distro exports spans, so the Collector that receives it is part of your attack surface. The cards below cover where configuration lives, how exporter traffic is protected, which server components listen, what data gets stripped, and which Collector components are built in.
Store Collector configuration securely
The Collector configuration holds exporter endpoints, authentication settings and sometimes tokens, so it deserves the same handling as other service secrets. On a PHP host, check who can read the file that the distro or Collector service loads, and confirm that credentials are injected from a secret store rather than written into a configuration file committed to a repository. Review file permissions after every package upgrade, since package scripts can reset them.
Collector security practicesEncrypt and authenticate exporter traffic
Spans sent from PHP-FPM or Apache hosts to a gateway Collector can carry query text, routes and user identifiers, so the connection needs TLS and an identity check. Ask your team to confirm that the exporter endpoint uses TLS and that the Collector authenticates the sender. Collector authenticator extensions, such as OIDC on receivers or the oauth2client extension on exporters, are the supported way to add this without changing PHP code.
Collector configuration docsKeep server components on localhost
Receivers that accept connections from PHP hosts can be exposed to the network if the Collector is installed with broad bind addresses. Since v0.110.0, server components bind to localhost by default rather than 0.0.0.0. Confirm the version in your pinned Collector release, and if a gateway must accept traffic from other hosts, set the bind address explicitly and restrict it with firewall rules to your web tier.
Redact URL and SQL user data
Auto-instrumented spans for Laravel, Symfony and WordPress often record full URLs with query strings and database statements with literal values, which can contain emails, tokens or customer IDs. Use the redaction processor to remove sensitive attributes before export, and test it against real request samples from a staging host. Illustrative example: a password reset link with a token in its query string should not reach your back end unchanged.
Build only the components you need
The contrib distribution includes many receivers and processors, and each one adds code you must patch and review. Use the Collector Builder to produce a binary with only the receivers, processors and exporters your PHP pipelines use. Ask your team to confirm the component list against the PHP instrumentation and the back end you chose, and to keep the build manifest in version control so changes are reviewed.
Verify the artifacts you deploy
Collector release artifacts ship with signed files, SHA256 checksums and SBOM files, which let you confirm the binary you install matches the published release. Add checksum verification to your package or image pipeline and record the SBOM with the deployment. Check the release notes before each upgrade, because component stability differs across Collector components.
Collector release notesQuestions teams ask before hiring help with PHP instrumentation
What drives the cost of hiring help with PHP instrumentation?
The cost depends mostly on how many PHP applications and hosts are in scope, how they are deployed, and how much of the Collector pipeline sits behind the work. A single Laravel app on one Linux host costs less to instrument than a fleet mixing Laravel, Symfony and WordPress across packaged servers and containers. Other drivers include the number of environments to test, whether the team needs custom attributes or dashboards, and how many backends receive data. Ask for a quote that lists each application, host type, environment and deliverable as separate line items, and state which costs are one-time (design, install, verification) and which recur (upgrades, support retainers).
How long does it take to get the first PHP traces?
The first traces usually depend on access and environment rather than on the instrumentation itself. Time goes to confirming hosts, PHP versions, web server and process manager details, and a reachable Collector or backend endpoint. Once those are known, the zero-code path is a short install and configuration step per host, followed by a test request to confirm spans arrive. Ask the provider to set out in the written scope which hosts are covered in the first pass and what the agreed timeline is for each stage, rather than relying on a general estimate.
What does the engagement need from our team?
Your team needs to provide access and decisions that only your organization can make. Typical inputs include:
- Inventory of PHP versions, web servers, process managers and operating systems on each host
- Shell or configuration access to the servers, or a change window to deploy packages
- A destination for telemetry, such as a Collector endpoint or a backend your organization already runs
- Named owners for the application code, the production change process and the data retention rules
- A decision on which request data may leave the host, since PHP traces can capture URLs, query strings and headers
Can our own engineers instrument PHP without a partner?
Yes, a capable platform team can do it internally, and the official documentation covers both paths. The Composer and PECL route suits teams that want to manage the extension inside their existing build and deployment process. The PHP Distro suits Linux hosts where packaged installs and opinionated defaults are preferred. Whether you should do it yourselves depends on how many hosts you run, how consistent your PHP builds are, and whether engineers have time to test changes against production-like traffic. Outside help tends to pay off when the rollout spans many heterogeneous hosts or must be reviewed by security or compliance teams.
How do Laravel, Symfony and WordPress differ for instrumentation?
The framework changes how much of the request path is visible and how the app is deployed, so each needs its own check. Laravel and Symfony applications are typically run behind PHP-FPM and a web server, and their routing, controllers and database calls are the main places to verify spans. WordPress often runs on shared or managed hosting with many plugins, so the first questions are whether the host allows the extension or packaged install, and which plugins generate database and HTTP calls. Confirm coverage for each framework in a test environment, because the signals available depend on the PHP version and the installed libraries.
Which PHP hosts can use the PHP Distro package?
According to the OpenTelemetry documentation, the PHP Distro installs as a deb, rpm or apk package and is supported on Linux only. Hosts running macOS or Windows will need the Composer and PECL route instead. Packaged installs also carry opinionated defaults, so you should confirm that those defaults match your PHP version, your process manager and your data handling rules before rollout. Check the OpenTelemetry PHP zero-code documentation for the current support matrix before you commit to a method.
How is the OpenTelemetry Collector version chosen?
Pick a Collector release that your pipeline configuration and components support, then pin that version across environments. Releases are published with a distribution that includes contrib components, along with signed artifacts, SHA256 checksums and SBOM files you can use for verification. Component stability varies, and each component's README documents its level, so check every receiver, processor and exporter you plan to use. Also confirm that the Collector's default bind behavior fits your network design, since server components bind to localhost by default in recent releases. Ask the provider to record the chosen version, the reasons for it and the upgrade path in the written scope.
What security questions should we settle before rollout?
Start by deciding what PHP telemetry may contain and where it goes. Request paths, query strings, headers and database statements can carry personal or regulated data, so decide which attributes to drop or redact before data leaves the host. Store Collector configuration securely, encrypt connections, and authenticate senders where the Collector supports it. Build the Collector with only the components you need, and confirm that credentials for the backend are managed outside application code. Your security team should review these choices before production traffic is sent.
How DeployOpen scopes PHP instrumentation work
Engagements are fixed-scope, and the scope is agreed in writing before work starts. For PHP instrumentation, the written scope usually covers four things: the install path you choose (Composer and the PECL extension, or the PHP Distro package on Linux), the OpenTelemetry Collector configuration that receives and exports the telemetry, a security review of what the instrumentation captures and where credentials live, and the rollout across each host or container pool that runs Laravel, Symfony or WordPress. Each of these is a deliverable with a named owner on both sides. Ask for the scope to list the PHP versions, web server and PHP-FPM layout, and hosts in the first pass, because those facts decide how many install paths and rollout waves the work contains.
Two other points belong in the scope document before any quote. First, the PHP Distro is Linux-only and ships opinionated defaults, so a mixed fleet with Windows or macOS hosts needs the Composer and PECL route on some hosts. Second, the Collector side has its own items to confirm, such as which receivers are exposed, how the endpoint is authenticated, and whether sensitive attributes are removed before export. Your team should confirm the PHP versions and extension availability on each host with your platform owners, since that check sets the effort more than any other single input.
DeployOpen does not publish a price list, so a quote follows from the written scope. Costs come from the hours needed for each deliverable, the number of host types and environments, the testing and change windows your organization requires, and any access or approval steps your security team runs. Ask each bidder to price the install path, Collector configuration, security review and rollout as separate line items, and to state what is one-time and what recurs. Ongoing support, upgrades and continuous testing are available as retainers, so ask for those to be quoted separately from the initial build.
How DeployOpen delivers OpenTelemetry work
DeployOpen plans and implements self-hosted OpenTelemetry work inside your own infrastructure, including PHP auto-instrumentation and the PHP Distro on the hosts where your Laravel, Symfony or WordPress workloads run. We start from a written scope that states which installation method fits each host and what the Collector side must receive, so your security and operations teams review the same plan before any change reaches production.
How we scope
- Inventory PHP versions, web servers, PHP-FPM setups and hosting models for each production application before choosing an install path.
- Decide between Composer with the PECL extension and the Linux-only PHP Distro package, recording the reason for each host group.
- Agree in writing which frameworks, endpoints, exporters and Collector receivers are in scope, and what is excluded.
- Confirm the backend and data-handling rules that govern span attributes, so sensitive request data stays out of telemetry.
How we build
- Install and configure auto-instrumentation in a non-production environment first, using the same PHP build and extensions as production.
- Test Laravel, Symfony and WordPress request paths for trace completeness, span naming and the effect on request latency.
- Apply attribute filtering and redaction in the Collector pipeline, and secure Collector endpoints with authentication and encryption.
- Roll out host by host with a rollback step recorded for each change window.
How we hand over
- Document the installed versions, extension settings, environment variables and Collector configuration for each host group.
- Provide runbooks covering upgrades, PHP version changes, disabling instrumentation and checking that traces still arrive.
- Walk your platform and security teams through the configuration and the data that leaves each application.
- Deliver the configuration files and build records so your team can review and maintain them without us.
How we support
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
- Ongoing support, upgrades and continuous testing are available as a retainer if your team wants DeployOpen to keep the setup current.
- Ask any partner to confirm how it will verify PHP compatibility for each framework version you run before upgrades.
- Quotes follow from the written scope, so ask for each cost component: installation, Collector work, testing and handover.

