One Buggregator for all your apps, each in its own project
Run one Buggregator for all your services and give each one a project key. The key goes in the Sentry DSN path (http://sentry@127.0.0.1:8000/shop), the SMTP user name, or the profiler URL. Each service's errors, mail and profiles then stay in their own project, and the project switcher in the sidebar shows one at a time.
Steps
1. List your projects
Create buggregator.yaml with one entry per service. This step is optional: a new key is also added on its first event card, with the key as its name.
projects:
- key: shop
name: Shop
- key: billing
name: Billing2. Mount the file into the container
Buggregator reads buggregator.yaml from its working directory.
services:
buggregator:
image: ghcr.io/buggregator/server:latest
ports:
- 127.0.0.1:8000:8000
- 127.0.0.1:1025:1025
volumes:
- ./buggregator.yaml:/buggregator.yaml3. Put the key in each service's Sentry DSN
Use the project key as the last part of the DSN path. Inside Compose, use the service name as the host.
# shop service
SENTRY_DSN=http://sentry@buggregator:8000/shop
# billing service
SENTRY_DSN=http://sentry@buggregator:8000/billingA numeric path like /1 sends events to default. If your SDK accepts only a number there, put the key before @ instead, for example http://billing@buggregator:8000/1. That works since server v2.10.0, and only for a project that already exists.
4. Put the key in the SMTP user name
The SMTP user name picks the project; the password can be anything.
MAILER_DSN=smtp://shop:any@buggregator:1025In Laravel, set MAIL_USERNAME=shop and any MAIL_PASSWORD.
5. Other event types
Each module takes the key in its own place:
# XHProf profiler
PROFILER_ENDPOINT=http://profiler:shop@buggregator:8000
# Ray
RAY_HOST=ray:shop@buggregator
RAY_PORT=8000For Monolog, add project to the record's context: $logger->error('Payment failed', ['project' => 'shop']). Records and dumps without it land in default.
6. Switch between projects
Open http://127.0.0.1:8000 and pick a project in the sidebar. You see only that service's events.
Why it works
Every event carries a project key, read from the DSN path, the user name or the context. Without one, it goes to the default project. For Sentry the order is: DSN path, then the X-Buggregator-Project header or Basic Auth, then the DSN public key, then default.
Docs: docs.buggregator.dev/config/projects.html
Requires Buggregator v2.5.0+
Related tips
- Mail
Catch dev email in docker-compose with one service
Add Buggregator as a service in docker-compose.yml and set your app's mail host to its service name. Every email lands in the UI on port 8000.
- Sentry
See a Laravel request's Sentry trace as a waterfall
Turn on Sentry tracing in Laravel and send it to Buggregator. Every span of a request shows on a timeline, and errors link to their trace.
- Mail
Laravel mail to a local inbox, three .env lines
Set MAIL_MAILER, MAIL_HOST and MAIL_PORT in .env and every Laravel email lands in Buggregator with HTML preview and attachments. Nothing is delivered.
- Logs
Laravel logs from web, queue and cron in one live view
Add a socket channel to config/logging.php and set LOG_CHANNEL=socket. Laravel logs from requests, queue workers and cron jobs appear live in Buggregator.
Checked on with Buggregator v2.13.0