InvergeDocs
Telescope

Telescope for Symfony

Register the Nexus bundle — requests, commands, Doctrine DBAL queries and Messenger messages are recorded.

Install

composer require inverge/nexus

Register Inverge\Nexus\Symfony\NexusBundle (Flex does it for you) and configure:

config/packages/nexus.yaml
nexus:
    api_key: '%env(NEXUS_API_KEY)%'
    telescope:
        service: 'orders-api'
        # release: '%env(GIT_SHA)%'
        # sample_rate: 0.2            # null = the console's sample rate
        # timeout: 3.0
        # ignore_paths: ['/_wdt*', '/_profiler*', '/health*']
        # ignore_commands: ['messenger:consume', 'cache:*', 'assets:*', 'debug:*', 'lint:*']
        # redact_keys: []
        # capture_response_bodies: true
        # body_size_limit: 64          # KB
        # doctrine: true               # record Doctrine DBAL queries
        # messenger: true              # record Messenger messages as jobs

Telescope is on by default once the bundle is registered; NEXUS_TELESCOPE_ENABLED=false switches it off.

What is recorded

  • Requests — route, controller, headers, payload, response, user, exceptions — via a kernel event subscriber.
  • Console commands as their own journeys.
  • Doctrine DBAL queries, through a DBAL middleware (DBAL 3 and 4).
  • Messenger messages: dispatching stamps the message with the current trace (TraceStamp), and handling it — on any worker — is recorded as a job in the same trace.
  • Exceptions, filed in Nexus Errors.

Duplicate detection and Doctrine

Doctrine prepared statements don't always expose their bindings. Nexus skips duplicate-query detection for those queries rather than reporting every lookup as a duplicate; N+1 detection still works.

Your own entries

Inject Inverge\Nexus\Telescope\Telescope:

public function __construct(private Telescope $telescope) {}

$this->telescope->span('render pdf', fn () => $this->pdf->render($invoice));
$this->telescope->tag('vip');

On this page