PHP Integration
Auto-instrument PHP applications with one Composer install. PHP-FPM worker metrics, Laravel and Symfony tracing, PDO query spans, and queue job visibility — zero configuration.
How It Works
Install via Composer
Run composer require tigerops/agent in your project root. The package targets PHP 8.1+ and includes the OpenTelemetry PHP SDK, a PHP-FPM status scraper, and auto-instrumentation patches for PDO, cURL, and popular frameworks.
Load the Agent
For Laravel, publish the config and register the service provider. For bare PHP or Symfony, add require_once vendor/tigerops/agent/auto_prepend.php to your php.ini auto_prepend_file directive for zero-touch instrumentation.
Set Environment Variables
Set TIGEROPS_API_KEY, TIGEROPS_SERVICE_NAME, and TIGEROPS_ENVIRONMENT in your .env file or server environment. The agent reads these at request startup and configures the OTLP exporter.
FPM, Traces & Queries Appear
Within seconds TigerOps displays PHP-FPM active/idle worker counts, request traces with route and controller details, PDO query spans, and Guzzle outbound HTTP traces.
What You Get Out of the Box
PHP-FPM Worker Metrics
Active workers, idle workers, total accepted connections, request duration percentiles, and slow request counts from the PHP-FPM status endpoint. TigerOps alerts on worker pool saturation before requests queue.
Laravel Request Tracing
Route name, controller method, middleware chain timing, and Eloquent query spans — all auto-collected via a Laravel middleware and the Eloquent query listener. Zero configuration beyond the service provider.
Symfony Profiler Integration
HttpKernel event tracing, Doctrine query spans, and Symfony Messenger dispatch traces. The TigerOps bundle subscribes to Symfony events and creates child spans for each sub-operation.
PDO & Slow Query Detection
Every PDO statement is wrapped in a span with normalized query text, affected row count, and execution time. Queries exceeding the configurable slow threshold are flagged and surfaced in the TigerOps query explorer.
Laravel Queue & Horizon
Queue job execution spans with queue name, connection, job class, attempt number, and exception details. Laravel Horizon metrics including throughput, runtime, and wait time per queue.
Guzzle & cURL Tracing
Outbound HTTP calls via Guzzle and raw cURL are auto-instrumented as child spans. W3C TraceContext and B3 propagation headers are injected automatically for distributed tracing across PHP services.
Install & Initialize
One Composer install. One config publish. Full PHP observability.
# Install the TigerOps PHP agent
composer require tigerops/agent
# For Laravel: publish the config
php artisan vendor:publish --tag=tigerops-config
# Set environment variables in .env
TIGEROPS_API_KEY=your-api-key
TIGEROPS_SERVICE_NAME=my-laravel-app
TIGEROPS_ENVIRONMENT=production
# config/tigerops.php (published config)
<?php
return [
'api_key' => env('TIGEROPS_API_KEY'),
'service_name' => env('TIGEROPS_SERVICE_NAME', 'laravel-app'),
'environment' => env('TIGEROPS_ENVIRONMENT', 'production'),
'instrumentation' => [
'eloquent' => true, // ORM query spans
'queue' => true, // Laravel Queue / Horizon
'cache' => true, // Cache hit/miss spans
'http' => true, // Guzzle outbound tracing
'redis' => true,
],
'slow_query_threshold_ms' => 100,
'fpm_status_path' => '/status',
];
# For bare PHP (php.ini)
; auto_prepend_file = /path/to/vendor/tigerops/agent/auto_prepend.php
# Custom span in a PHP service
use TigerOpsAgentTracer;
class CheckoutService
{
public function processOrder(Order $order): void
{
$tracer = Tracer::getInstance();
$span = $tracer->startSpan('checkout.process_order');
$span->setAttribute('order.id', $order->id);
$span->setAttribute('order.total', $order->total);
try {
$this->paymentGateway->charge($order);
$this->inventory->decrement($order->items);
$span->setStatus('ok');
} catch (Throwable $e) {
$span->recordException($e);
$span->setStatus('error', $e->getMessage());
throw $e;
} finally {
$span->end();
}
}
}Common Questions
Which PHP versions and frameworks are supported?
PHP 8.1, 8.2, and 8.3 are fully supported. Laravel 10 and 11, Symfony 6 and 7, Slim 4, and bare Rack-style PHP apps via the auto_prepend_file approach are all supported. PHP 8.0 is supported on a best-effort basis.
Does tigerops/agent work with OPcache and PHP preloading?
Yes. The agent is OPcache-compatible and does not interfere with preloading. The auto-instrumentation patches are applied at request startup after OPcache has served the compiled opcode.
How does TigerOps collect PHP-FPM metrics without a Prometheus exporter?
TigerOps reads the PHP-FPM status page (pm.status_path) via a local FastCGI connection every 15 seconds. No external exporter process is required — the agent handles metric collection and forwarding internally.
Can I use TigerOps with Laravel Octane (Swoole/RoadRunner)?
Yes. The tigerops/agent package has Octane-aware lifecycle hooks that reset trace context between requests. Both Swoole coroutine context and RoadRunner worker context are handled correctly.
Does the agent capture exception details and stack traces?
Yes. Unhandled exceptions and caught exceptions recorded via span.recordException() include the exception class, message, and full stack trace. In Laravel, the exception handler is auto-patched to record all uncaught exceptions.
Full PHP Observability in One Composer Install
PHP-FPM metrics, Laravel tracing, PDO query spans, and queue job visibility — no code changes required.