yupao / tracing
Customized tracing component based on openzipkin by Yupao
1.1.2
2021-11-03 07:14 UTC
Requires
- php: >=7.2
- ext-curl: *
- ext-json: *
- ext-openssl: *
- hyperf/contract: ~2.2.0
- hyperf/di: ~2.2.0
- hyperf/guzzle: ~2.2.0
- hyperf/http-server: ~2.2.0
- hyperf/rpc: ~2.2.0
- hyperf/rpc-client: ^2.2
- hyperf/utils: ~2.2.0
- psr/http-message: ^1.0
Suggests
- hyperf/event: Required to use DbQueryExecutedListener.
- jonahgeorge/jaeger-client-php: Required (^0.6) to use jaeger tracing.
README
English | 中文
tracing
Customized tracing component based on openzipkin by Yupao
quickstart
install dependency
composer require yupao/tracing
(optional) delete existing opentracing config file
rm -f {$project_dir}/config/autoload/opentracing.php
publish config file
php bin/hyperf.php vendor:publish yupao/tracing
change aspect configuration
# config/autoload/aspects.php return [ Yupao\Tracing\Hyperf\Aspect\JsonRpcAspect::class, ];
middlewares configuration
# config/autoload/middlewares.php return [ 'http' => [ Yupao\Tracing\Hyperf\Middleware\TraceMiddleware::class ], ];
customization
change customized trace header name
If you are using a customized HTTP header for tracing. In the project configuration .env file,
set CUSTOMIZED_TRACE_ID_NAME
to that name.
# edit .env
CUSTOMIZED_TRACE_ID_NAME=x-request-id