Download the PHP package trustportidentity/beacon-laravel without Composer
On this page you can find all versions of the php package trustportidentity/beacon-laravel. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download trustportidentity/beacon-laravel
More information about trustportidentity/beacon-laravel
Files in trustportidentity/beacon-laravel
Package beacon-laravel
Short Description Official TrustPort Beacon APM and Telemetry SDK for Laravel
License MIT
Informations about the package beacon-laravel
trustportidentity/beacon-laravel
Official TrustPort Beacon APM SDK for Laravel.
Install
Package discovery auto-registers BeaconServiceProvider and the Beacon facade.
Configure
Register the middleware
Custom spans
Controlling ingest volume
Every trace is already batched (BEACON_BATCH_SIZE) instead of one network call per
request. In high-traffic services, also set BEACON_SAMPLE_RATE (0.0–1.0, default 1.0) to
trace only a fraction of requests — this is what actually keeps you inside your plan's
monthly quota. Exceptions are always sent regardless of sampling.
See the full guide at beacon.trustportidentity.com/help/laravel.
Migrating from Laravel Nightwatch
Beacon registers itself the way Nightwatch does: install the package, set the env vars, done.
composer remove laravel/nightwatchthencomposer require trustportidentity/beacon-laravel:^1.2-
In
.env, replace theNIGHTWATCH_*variables with: - Stop the Nightwatch agent (
php artisan nightwatch:agent): Beacon has no agent process. php artisan config:clearandphp artisan queue:restart.
What you get with no code changes: every HTTP request (route, status, redacted headers, the signed-in user from any
guard including Sanctum), database queries with slow-query / N+1 / duplicate detection, queue jobs, cache hits and
misses, and log lines as breadcrumbs, plus unhandled exceptions. Health checks (up, health, api/health) are not
traced; change with BEACON_IGNORE_PATHS. Set BEACON_AUTO_MIDDLEWARE=false if you register
TrustPortIdentity\Beacon\BeaconMiddleware yourself.
Errors: what is captured (v1.2+)
| Situation | Captured as |
|---|---|
| Exception in a web request (including ones Laravel turns into a 500 page/JSON) | The request trace, with the user, route and stack trace |
| Exception in a queue job | A QUEUE trace with the failure |
| Exception in artisan / scheduler / console code | A CLI trace |
Exceptions you report($e) or that Laravel logs |
Same as above, marked handled |
| PHP fatals: memory exhausted, max execution time, parse errors | A FatalError trace, flushed from a shutdown handler |
| 404, validation, auth exceptions Laravel does not report | Not sent (no noise) |
Opt out with BEACON_CAPTURE_EXCEPTIONS=false / BEACON_CAPTURE_FATALS=false. Errors are never sampled away.
Sampling, noise and privacy
- Sampling:
BEACON_SAMPLE_RATE(0-1) applies to normal requests. Requests that throw are always sent. Low-traffic apps should use1; a low rate means most requests never appear in the dashboard. - Noisy endpoints (cron pings, webhooks): exclude with
BEACON_IGNORE_PATHS, comma separated,*wildcard, e.g.up,health,api/health,api/send_*_mails. - Always redacted, no setting needed:
Authorization,Cookie,Set-Cookie,X-Api-Key, CSRF/XSRF headers, and the value of any query parameter whose name containstoken,secret,password,auth,signature,sessionor is a key (key,cron_key,api_key). Other parameters (page,keyword) are kept. BEACON_SANITIZE_PII=trueadditionally scrubs card-number-like values from URLs and messages.
Troubleshooting
| Symptom | Check |
|---|---|
| Only a few requests show up | Sample rate below 1, or the path is in BEACON_IGNORE_PATHS |
| Nothing shows up | BEACON_API_KEY unset, config cached (php artisan config:clear), or the server cannot reach BEACON_INGEST_URL |
| A fatal/exception is missing | Upgrade to ^1.2; fatals need BEACON_CAPTURE_FATALS not false |
| Requests have no user | The app authenticates in a way Laravel's guards do not see; call Beacon::identify(...) yourself |
| Works locally, not in a queue worker | Run php artisan queue:restart after changing .env |
Telemetry is silent until BEACON_API_KEY is set, so the package can ship to every environment safely.
Run the package tests with composer install && ./vendor/bin/phpunit.
All versions of beacon-laravel with dependencies
ext-curl Version *
illuminate/support Version ^10.0 || ^11.0 || ^12.0
illuminate/http Version ^10.0 || ^11.0 || ^12.0