Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Adds Buggregator as a tool #334

Merged
merged 8 commits into from
Mar 11, 2024
Merged

Adds Buggregator as a tool #334

merged 8 commits into from
Mar 11, 2024

Conversation

tonysm
Copy link
Contributor

@tonysm tonysm commented Mar 10, 2024

Added


Hat tip to @gcavanunez for pointing me to Buggregator.

Usage:

takeout enable buggregator

After answering the prompted questions (about where the web UI, the VarDumper server, the Monolog server port, and network alias), the service should run at localhost:8000 (unless you change the default port).

VarDumper Server

To start sending dump() calls to Buggregator, you may set the following configs on the Laravel app:

VAR_DUMPER_FORMAT=server
VAR_DUMPER_SERVER=127.0.0.1:9912
# VAR_DUMPER_SERVER=buggregator:9912 # If you're on Sail

Ray

First, on the Laravel app, require the Ray PHP client:

composer require spatie/laravel-ray --dev

Next, set the following configs:

RAY_HOST=ray@127.0.0.1
# RAY_HOST=ray@buggregator # If you're on Sail
RAY_PORT=8000

SMTP Server

To send emails, you may set the following configs on the Laravel app:

MAIL_MAILER=smtp
MAIL_HOST=127.0.0.1
# MAIL_HOST=buggregator # If you're on Sail
MAIL_PORT=1025

Profiler

Buggregator ships with an XHProf profiler. To use it, first install the xhprof extension via pecl:

pecl install xhprof

Then add the extension=xhprof.so to the php.ini. On Sail, you can do that with:

echo "extension=xhprof.so" >> /etc/php/8.3/cli/php.ini

Then, install the package:

composer require --dev maantje/xhprof-buggregator-laravel

Then, configure the profiler envs:

PROFILER_ENDPOINT=http://profiler@127.0.0.1:8000
# PROFILER_ENDPOINT=http://profiler@buggregator:8000 # If you're on Sail
PROFILER_APP_NAME="${APP_NAME}"
XHPROF_ENABLED=true

Sentry

First, install the package following sentry's docs.

Then, configure the Sentry DNS on the .env of your Laravel app:

SENTRY_LARAVEL_DSN=http://sentry@127.0.0.1:8000/1
# SENTRY_LARAVEL_DSN=http://sentry@buggregator:8000/1 # If you're on sail

These should serve as examples. There's also a nice monolog service, an inspector, and an HTTP dump server.

Notes on Sail

If you're using Takeout in combination with Sail, you can use the network_alias configured as the hostname (which defaults to buggregator) instead of 127.0.0.1. The Laravel app container must be added to the Takeout network. For more info, check out Matt's blog.

@mattstauffer mattstauffer merged commit 95911f1 into main Mar 11, 2024
10 checks passed
@mattstauffer
Copy link
Member

Oh, this is hot.

@mattstauffer mattstauffer deleted the tm/buggregator branch March 11, 2024 16:44
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants