beacon-laravel maintained by trustportidentity
trustportidentity/beacon-laravel
Official TrustPort Beacon APM SDK for Laravel.
Install
composer require trustportidentity/beacon-laravel
Package discovery auto-registers BeaconServiceProvider and the Beacon facade.
Configure
BEACON_INGEST_URL=https://beacon-api.trustportidentity.com
BEACON_API_KEY=tb_live_your_tenant_key
BEACON_SERVICE_NAME=billing-api
BEACON_ENVIRONMENT=production
Register the middleware
// app/Http/Kernel.php
use TrustPortIdentity\Beacon\BeaconMiddleware;
protected $middleware = [
BeaconMiddleware::class,
];
Custom spans
use TrustPortIdentity\Beacon\Beacon;
$span = Beacon::span('db.mysql.select_invoices', 'database');
$invoices = Invoice::where('status', 'pending')->get();
$span->setTag('rows', $invoices->count())->end();
See the full guide at beacon.trustportidentity.com/help/laravel.