All Integrations
LanguagesComposer package

Symfony Integration

Instrument Symfony applications with one Composer install. Kernel event tracing, Doctrine ORM query spans, Messenger bus monitoring, and PHP-FPM metrics — zero configuration.

Setup

How It Works

01

Install via Composer

Run composer require tigerops/symfony-bundle. The bundle uses Symfony Flex for zero-config auto-registration. It bundles opentelemetry-php, a TigerOps OTLP exporter, and Doctrine DBAL instrumentation compatible with Symfony 6.x and 7.x.

02

Register the Bundle

With Symfony Flex, the bundle registers itself automatically in config/bundles.php. For manual registration, add TigerOps\Bundle\TigerOpsBundle::class => ["all" => true] to bundles.php. The bundle attaches kernel event listeners on boot.

03

Configure via YAML or Environment

Set TIGEROPS_API_KEY, TIGEROPS_SERVICE_NAME, and TIGEROPS_ENVIRONMENT in your .env file. The bundle reads these via Symfony's %env()% syntax. All configuration keys are available under the tigerops: YAML block in config/packages/tigerops.yaml.

04

Traces, Doctrine Queries & Messenger Events

Within seconds TigerOps receives Symfony kernel request spans, Doctrine DBAL query traces with normalized SQL, Messenger dispatch and handler spans, and PHP-FPM process metrics from your Symfony application.

Capabilities

What You Get Out of the Box

Symfony Kernel Event Tracing

HttpKernel events (kernel.request, kernel.controller, kernel.response, kernel.terminate) are each measured as child spans. Controller class name, action method, route name, and firewall name are recorded on the root request span.

Doctrine ORM Query Spans

Every SQL query executed via Doctrine DBAL or ORM becomes a child span with normalized SQL, connection name, entity class name, execution time, and row count. Doctrine migrations and schema diffs are traced as long-running operations.

Messenger Bus Monitoring

Symfony Messenger message dispatch, routing, and handler execution create linked spans. Message class name, transport name, retry count, and handler execution time are recorded. Failed messages and DLQ routing events are flagged.

Security & Firewall Traces

Symfony Security firewall authentication, voter evaluation, and access decision timing are measured as child spans. Voter class names, access decisions (ACCESS_GRANTED/DENIED), and authentication provider durations are recorded.

Cache & Redis Pool Spans

Cache adapter operations (get, set, delete, getItem) using Symfony Cache with Redis, Memcached, APCu, or filesystem backends create child spans with cache key (hashed), pool name, hit/miss status, and operation latency.

PHP-FPM & OPcache Metrics

PHP-FPM worker count, request duration, idle workers, and max children reached events are collected from the FPM status endpoint. OPcache hit rate, used memory, and interned strings usage are emitted as OTLP metrics.

Configuration

Install & Initialize

One Composer require. One YAML block. Full Symfony observability.

terminal + tigerops.yaml
# Install the TigerOps Symfony bundle
composer require tigerops/symfony-bundle

# .env
TIGEROPS_API_KEY=your-api-key
TIGEROPS_SERVICE_NAME=my-symfony-app
TIGEROPS_ENVIRONMENT=production

# config/packages/tigerops.yaml
tigerops:
  api_key:      '%env(TIGEROPS_API_KEY)%'
  service_name: '%env(TIGEROPS_SERVICE_NAME)%'
  environment:  '%env(TIGEROPS_ENVIRONMENT)%'
  doctrine:
    enabled: true
    slow_query_threshold_ms: 100
  messenger:
    enabled: true
  cache:
    enabled: true

# Custom span in a controller
use TigerOps\Tracing\Tracer;

class OrderController extends AbstractController
{
    public function __construct(private Tracer $tracer) {}

    #[Route('/orders', methods: ['POST'])]
    public function create(Request $request): JsonResponse
    {
        $span = $this->tracer->startSpan('order.create');
        $span->setAttribute('order.items',
            count($request->toArray()['items']));

        $order = $this->orderService->create($request->toArray());
        $span->end();

        return $this->json($order, 201);
    }
}
FAQ

Common Questions

Which Symfony and PHP versions are supported?

Symfony 6.4 LTS and 7.x are fully supported on PHP 8.2 and 8.3. PHP 8.1 is supported in compatibility mode without named arguments. The bundle is compatible with Symfony applications using php-fpm, roadrunner, swoole, and frankenphp runtimes.

Does TigerOps instrument API Platform resources?

Yes. API Platform operations built on Symfony HttpKernel are auto-traced. The resource class, operation type (get_collection, create, update, delete), and IRI are recorded on spans. Custom state providers and processors create child spans automatically.

How does TigerOps integrate with Symfony Profiler in development?

In the dev environment (APP_ENV=dev), TigerOps adds a Symfony Profiler panel showing traces collected during the current request. No API key is needed for local profiling. Set TIGEROPS_ENV_EXPORT=false to disable OTLP export in dev.

Can TigerOps trace asynchronous Messenger handlers on separate worker processes?

Yes. Trace context is serialized into the Messenger envelope using TigerOps\Messenger\TraceStamp. Worker processes running php bin/console messenger:consume restore the parent trace context from the stamp before executing the handler.

How does TigerOps handle Symfony's request/response caching with HttpCache?

TigerOps instruments the Symfony HttpCache reverse proxy kernel. Cache HIT, MISS, and STALE responses are recorded as span attributes with the cache key, TTL, and age. Cached responses still create root spans with zero downstream controller spans.

Get Started

Full Symfony Observability in One Composer Install

Kernel event traces, Doctrine query spans, Messenger bus monitoring, and PHP-FPM metrics — no code changes required.