nowo-tech / beacon-bundle
Symfony client for self-hosted Symfony Beacon — Envelope ingest via configurable DSN (host, subdomain, port).
Package info
github.com/nowo-tech/BeaconBundle
Type:symfony-bundle
pkg:composer/nowo-tech/beacon-bundle
Requires
- php: >=8.2 <8.6
- psr/clock: ^1.0
- psr/log: ^1.0 || ^2.0 || ^3.0
- symfony/config: ^7.0 || ^8.0
- symfony/dependency-injection: ^7.0 || ^8.0
- symfony/framework-bundle: ^7.0 || ^8.0
- symfony/http-client: ^7.0 || ^8.0
- symfony/http-kernel: ^7.0 || ^8.0
Requires (Dev)
- doctrine/dbal: ^3.8 || ^4.0
- friendsofphp/php-cs-fixer: ^3.0
- monolog/monolog: ^3.0
- nowo-tech/phpstan-frankenphp: ^1.0
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.0 || ^11.0
- rector/rector: ^2.0
- symfony/clock: ^7.0 || ^8.0
- symfony/console: ^7.0 || ^8.0
- symfony/messenger: ^7.0 || ^8.0
- symfony/scheduler: ^7.0 || ^8.0
- symfony/security-core: ^7.0 || ^8.0
- symfony/yaml: ^7.0 || ^8.0
Suggests
- doctrine/dbal: Required for instrumentation.doctrine SQL spans (DBAL middleware).
- monolog/monolog: Enable nowo_beacon.monolog_handler to forward log records to Beacon
- symfony/flex: For automatic Flex recipe installation of config/packages/nowo_beacon.yaml
- symfony/messenger: Required for register_messenger_listener and transport.mode=messenger.
- symfony/scheduler: Optional: attach extra.scheduler on Messenger failures when envelopes carry ScheduledStamp (include_scheduler_context).
- symfony/security-bundle: Enable send.user authenticated context via the security token storage
This package is auto-updated.
Last update: 2026-07-31 14:36:27 UTC
README
⭐ Found this useful? Install from Packagist and give the repo a star on GitHub.
Symfony client for Symfony Beacon, the self-hosted error-tracking server from Nowo. BeaconBundle sends Envelope requests to any Beacon host described by a DSN and provides both manual APIs and an optional automatic exception listener.
This bundle is FrankenPHP worker mode friendly.
Features
- DSN-driven ingest with host, optional port, public key, required secret, and project id
- Empty DSN disables reporting without changing application code
- Envelope transport to
POST /api/{project_id}/envelope/withX-Beacon-Auth+ envelope DSN auth - Delivery modes:
transport.modesync(default),async(finalize on terminate), ormessenger(queue) - Versioned
User-Agent(beacon-bundle/{composer-version}) - Manual APIs through
BeaconClientInterface - Optional
kernel.exceptionlistener for uncaught HTTP exceptions ignore_exceptions/ignore_pathssupport for listener-side filtering (defaults align with Beacon host infra exclusions + Chrome DevTools probe)- Configurable outbound context (
send.*: stacktrace, request, user, PHP/Symfony versions, OS, …) - Message events can include current stacktrace; frames may include source context when files are readable
- HTTP events attach request URL/method (and safe headers) when available
- Breadcrumbs (
addBreadcrumb) and performance transactions (captureTransaction) - Public tags API (
setTag/setTags) and optionalbefore_sendscrubbing hook - Opt-in Doctrine SQL + HttpClient request spans / breadcrumbs (
instrumentation.*) - Optional console / Messenger failure listeners (nested console extras; optional Scheduler
ScheduledStampcontext) and optional Monolog handler - Optional automatic HTTP request transactions (
auto_http_transaction) - Precise timestamps (fractional Unix + ISO-8601 with microseconds)
- Local FrankenPHP demo covering messages, exceptions, full context, fingerprints, breadcrumbs, user, transactions / N+1, auto HTTP tx, Monolog, Messenger failures, and console errors
Installation
composer require nowo-tech/beacon-bundle
Symfony Flex registers the bundle, creates config/packages/nowo_beacon.yaml, and adds an empty BEACON_DSN entry to your env file.
Quick start
Full walkthrough (create a Beacon project, copy the DSN, verify events): Getting started.
BEACON_DSN=https://PUBLIC_KEY:SECRET_KEY@localhost:9444/1
nowo_beacon: enabled: true dsn: '%env(string:default::BEACON_DSN)%' environment: '%kernel.environment%' release: null server_name: null verify_peer: true timeout: 5.0 register_error_listener: true ignore_exceptions: [] send: environment: true release: true server_name: true stacktrace: true request: true user: false # opt-in; may include PII runtime: true # PHP version framework: true # Symfony version os: true
See Configuration for the full send.* reference.
For local self-signed HTTPS only:
when@dev: nowo_beacon: verify_peer: false
use Nowo\BeaconBundle\Client\BeaconClientInterface; final class PaymentService { public function __construct(private readonly BeaconClientInterface $beacon) { } public function charge(): void { try { // ... } catch (\Throwable $exception) { $this->beacon->captureException($exception, ['order_id' => 42]); throw $exception; } } }
DSN format
{scheme}://{public_key}:{secret}@{host}[:{port}]/{project_id}
| Example | Meaning |
|---|---|
https://KEY:SECRET@localhost:9444/1 |
Local HTTPS Beacon on port 9444, project 1 |
https://KEY:SECRET@errors.example.com/3 |
Hosted Beacon over default HTTPS port |
http://KEY:SECRET@beacon.internal:9081/2 |
Internal HTTP Beacon (Docker ingest) |
Generate keys in Beacon project settings, or run make seed in the symfony-beacon repository to create demo data and print a DSN (includes secret).
FrankenPHP worker
The bundled demo uses FrankenPHP. Default FRANKENPHP_MODE=worker; set classic for Caddyfile.dev (hot-reload friendly). See Demo/FrankenPHP.
Documentation
- Installation
- Configuration
- Usage
- Contributing
- Code of Conduct
- Changelog
- Upgrading
- Release
- Security
- Engram
- Spec-driven development
- GitHub Spec Kit
Additional documentation
Tests and coverage
Run the test suite with:
composer test
composer test-coverage
or, in the Docker-based maintainer workflow:
make test
make test-coverage
make test-coverage-100
Coverage (Lines): 100.00% (measured with make test-coverage / PCOV).
| Suite | Status |
|---|---|
| PHP unit + integration | 100.00% Lines |
| TypeScript / Python | N/A (no frontend or Python in this bundle) |