|
7 | 7 | * @link https://www.hyperf.io |
8 | 8 | * @document https://doc.hyperf.io |
9 | 9 | |
10 | | - * @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE |
| 10 | + * @license https://github.com/hyperf/hyperf/blob/master/LICENSE |
11 | 11 | */ |
12 | 12 |
|
13 | 13 | use Zipkin\Samplers\BinarySampler; |
14 | 14 |
|
15 | 15 | return [ |
16 | | - 'default' => 'zikpin', |
| 16 | + 'default' => env('TRACER_DRIVER', 'zipkin'), |
17 | 17 | 'enable' => [ |
18 | | - 'guzzle' => false, |
19 | | - 'redis' => false, |
20 | | - 'db' => false, |
21 | | - 'method' => false, |
| 18 | + 'guzzle' => env('TRACER_ENABLE_GUZZLE', false), |
| 19 | + 'redis' => env('TRACER_ENABLE_REDIS', false), |
| 20 | + 'db' => env('TRACER_ENABLE_DB', false), |
| 21 | + 'method' => env('TRACER_ENABLE_METHOD', false), |
22 | 22 | ], |
23 | 23 | 'tracer' => [ |
24 | 24 | 'zipkin' => [ |
| 25 | + 'driver' => Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, |
25 | 26 | 'app' => [ |
26 | 27 | 'name' => env('APP_NAME', 'skeleton'), |
27 | 28 | // Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null |
|
34 | 35 | 'timeout' => env('ZIPKIN_TIMEOUT', 1), |
35 | 36 | ], |
36 | 37 | 'sampler' => BinarySampler::createAsAlwaysSample(), |
37 | | - 'driver' => Hyperf\Tracer\Adapter\ZipkinTracerFactory::class, |
| 38 | + ], |
| 39 | + 'jaeger' => [ |
| 40 | + 'driver' => Hyperf\Tracer\Adapter\JaegerTracerFactory::class, |
| 41 | + 'name' => env('APP_NAME', 'skeleton'), |
| 42 | + 'options' => [ |
| 43 | + /* |
| 44 | + * You can uncomment the sampler lines to use custom strategy. |
| 45 | + * |
| 46 | + * For more available configurations, |
| 47 | + * @see https://github.com/jonahgeorge/jaeger-client-php |
| 48 | + */ |
| 49 | + // 'sampler' => [ |
| 50 | + // 'type' => \Jaeger\SAMPLER_TYPE_CONST, |
| 51 | + // 'param' => true, |
| 52 | + // ],, |
| 53 | + 'local_agent' => [ |
| 54 | + 'reporting_host' => env('JAEGER_REPORTING_HOST', 'localhost'), |
| 55 | + 'reporting_port' => env('JAEGER_REPORTING_PORT', 5775), |
| 56 | + ], |
| 57 | + ], |
38 | 58 | ], |
39 | 59 | ], |
40 | 60 | ]; |
0 commit comments