Sentry for local dev without self-hosting Sentry
For local development you do not need to host a Sentry server. Run one Buggregator container and set your DSN to http://sentry@127.0.0.1:8000/1. Your app keeps the Sentry SDK it already uses, and its errors, traces and logs show up in Buggregator on your machine. Only the DSN changes.
Steps
1. Start Buggregator
One container, one port for the UI and for the SDK. No account and no sign-up.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
ghcr.io/buggregator/server:latest2. Change the DSN
The DSN goes into your app's config. Any key before @ works. In Docker Compose, replace 127.0.0.1 with the Buggregator service name, for example http://sentry@buggregator:8000/1.
# your app's .env
SENTRY_DSN=http://sentry@127.0.0.1:8000/1
# Laravel reads this one
SENTRY_LARAVEL_DSN=http://sentry@127.0.0.1:8000/13. Send traces too
Set the trace sample rate to 1.0, or traces are sampled away and never sent. In Python:
import sentry_sdk
sentry_sdk.init(
dsn="http://sentry@127.0.0.1:8000/1",
traces_sample_rate=1.0,
enable_logs=True,
)4. Give each service its own project
With the PHP SDK, put a project key in the DSN path: http://sentry@127.0.0.1:8000/shop. SDKs that accept only a number there take the key before @ instead, for a project that already exists:
SENTRY_DSN=http://billing@127.0.0.1:8000/15. Open the Sentry page
Throw an error and open http://127.0.0.1:8000. Each exception shows its stack trace with code context, breadcrumbs, request, device and app info, tags and loaded modules. The Sentry page has tabs for Exceptions, Traces, Logs and Metrics.
6. Keep data across restarts
By default Buggregator keeps everything in memory. To keep it, give it a database file. This setting is for Buggregator, not for your app.
docker run --pull always \
-p 127.0.0.1:8000:8000 \
-e DATABASE_DSN=/data/buggregator.db \
-v buggregator-data:/data \
ghcr.io/buggregator/server:latestWhy it works
Buggregator accepts the protocol Sentry SDKs speak. The SDK reads the host from the DSN and sends its events there, so pointing the DSN at port 8000 is all it takes. Buggregator stores errors, messages, transactions with their spans, and logs. It does not store sessions, client reports, profiles, replays, attachments or minidumps. To go back, set the DSN to its old value.
Docs: docs.buggregator.dev/config/sentry.html#configuration
Requires Buggregator v2.10.0+
Related tips
- Sentry
Laravel errors in Sentry's UI style, no Sentry account
Set SENTRY_LARAVEL_DSN to Buggregator. Each Laravel exception shows locally with its stack trace, request and breadcrumbs. No account, no limits.
- Sentry
The SENTRY_DSN to use on your own machine
Set SENTRY_DSN=http://sentry@127.0.0.1:8000/1 in any Sentry SDK and errors land in Buggregator. Put a project name in the DSN to keep apps apart.
- Sentry
One Buggregator for all your apps, each in its own project
Give each service its own project key in the Sentry DSN path, the SMTP user name or the profiler URL. One Buggregator keeps their errors and mail apart.
- 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.
Checked on with Buggregator v2.13.0