https://github.com/laravelclo...php
5.x.x
is supported in the most recent version (composer require laravelcloud/lar-trace
)安裝laravelcloud/lar-trace
包:laravel
$ composer require laravelcloud/lar-trace
在 config/app.php
中作以下配置git
'providers' => array( /* * Package Service Providers... */ LaravelCloud\Trace\TraceLaravel\TracingServiceProvider::class, )
建立Trace的配置文件(config/trace.php
)github
$ php artisan vendor:publish --provider="LaravelCloud\Trace\TraceLaravel\TracingServiceProvider"
添加變量至.env
api
TRACE_ENABLED=1 TRACE_ENDPOINT_URL=http://127.0.0.1:9411/api/v2/spans TRACE_RATE=1.0 TRACE_SERVICE_NAME=lar-examples TRACE_SQL_BINDINGS=false
...bash
Dependencies are managed through composer:app
$ composer install
Tests can then be run via phpunit:composer
$ vendor/bin/phpunit