yupao/tracing

Customized tracing component based on openzipkin by Yupao

1.1.2 2021-11-03 07:14 UTC

This package is auto-updated.

Last update: 2024-04-04 15:27:40 UTC


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