beemlabs / beem-symfony
Symfony bundle for the Beem SDK — auto-traces HTTP, Doctrine, Console, Messenger.
Package info
github.com/beemlabs/beem-symfony
Type:symfony-bundle
pkg:composer/beemlabs/beem-symfony
Requires
- php: >=8.2
- beemlabs/beem-php: ^0.1
- symfony/config: ^6.4 || ^7.0
- symfony/console: ^6.4 || ^7.0
- symfony/dependency-injection: ^6.4 || ^7.0
- symfony/event-dispatcher: ^6.4 || ^7.0
- symfony/http-foundation: ^6.4 || ^7.0
- symfony/http-kernel: ^6.4 || ^7.0
Requires (Dev)
- doctrine/dbal: ^3.2 || ^4.0
- friendsofphp/php-cs-fixer: ^3.75
- pestphp/pest: ^3.0
- symfony/framework-bundle: ^6.4 || ^7.0
- symfony/messenger: ^6.4 || ^7.0
Suggests
- doctrine/dbal: For automatic db.query span instrumentation
- symfony/messenger: For queued message instrumentation
README
Symfony 6.4/7 bundle for the Beem SDK — auto-traces HTTP requests, Doctrine queries, console commands, and Messenger messages, and captures unhandled exceptions.
Requirements
- PHP 8.2+
- Symfony 6.4 or 7
beemlabs/beem-php(installed automatically)
Installation
composer require beemlabs/beem-symfony
Register the bundle (skip if Flex does it for you):
// config/bundles.php return [ // ... Beem\SymfonyBundle\BeemSymfonyBundle::class => ['all' => true], ];
Configure the DSN:
# config/packages/beem.yaml beem: dsn: '%env(BEEM_DSN)%'
Configuration
Full reference with defaults:
beem: dsn: '%env(BEEM_DSN)%' # required; empty disables the SDK sample_rate: 1.0 # 0.0–1.0 max_batch_size: 500 flush_timeout_ms: 2000 environment: null # defaults to kernel.environment release: null default_tags: {} instrument_doctrine: true instrument_console: true instrument_messenger: true
What gets traced
- HTTP — one transaction per request, named after the route, with the response status.
- Doctrine — SQL queries become
db.queryspans via a DBAL middleware/logger. - Console — each command runs in its own transaction.
- Messenger — each handled message runs in its own transaction.
- Exceptions — unhandled exceptions are captured and linked to the active transaction.
Manual instrumentation is available through the core SDK's Beem\Beem facade — see the beem-php README.
Development
composer install composer test # Pest composer cs:check # php-cs-fixer (dry-run) composer cs:fix # php-cs-fixer
This repository is a read-only split of the Beem monorepo. Please open issues and pull requests there — direct pushes here are overwritten by the next sync.
License
MIT