Skip to content

Commit 62a640a

Browse files
authored
Merge pull request #25 from 98P/patch-1
Update Zipkin tracer config
2 parents 0a5dcad + 9597e02 commit 62a640a

File tree

1 file changed

+30
-16
lines changed

1 file changed

+30
-16
lines changed

installer/resources/tracer/opentracing.php

Lines changed: 30 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,30 +7,44 @@
77
* @link https://www.hyperf.io
88
* @document https://doc.hyperf.io
99
* @contact [email protected]
10-
* @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
10+
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
1111
*/
1212

1313
use Zipkin\Samplers\BinarySampler;
1414

1515
return [
16+
'default' => env('TRACER_DRIVER', 'zipkin'),
1617
'enable' => [
17-
'guzzle' => false,
18-
'redis' => false,
19-
'db' => false,
20-
'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),
2122
],
22-
'zipkin' => [
23-
'app' => [
24-
'name' => env('APP_NAME', 'skeleton'),
25-
// Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null
26-
'ipv4' => '127.0.0.1',
27-
'ipv6' => null,
28-
'port' => 9501,
23+
'tracer' => [
24+
'zipkin' => [
25+
'driver' => \Hyperf\Tracer\Adapter\ZipkinTracerFactory::class,
26+
'app' => [
27+
'name' => env('APP_NAME', 'skeleton'),
28+
// Hyperf will detect the system info automatically as the value if ipv4, ipv6, port is null
29+
'ipv4' => '127.0.0.1',
30+
'ipv6' => null,
31+
'port' => 9501,
32+
],
33+
'options' => [
34+
'endpoint_url' => env('ZIPKIN_ENDPOINT_URL', 'http://localhost:9411/api/v2/spans'),
35+
'timeout' => env('ZIPKIN_TIMEOUT', 1),
36+
],
37+
'sampler' => BinarySampler::createAsAlwaysSample(),
2938
],
30-
'options' => [
31-
'endpoint_url' => env('ZIPKIN_ENDPOINT_URL', 'http://localhost:9411/api/v2/spans'),
32-
'timeout' => env('ZIPKIN_TIMEOUT', 1),
39+
'jaeger' => [
40+
'driver' => \Hyperf\Tracer\Adapter\JaegerTracerFactory::class,
41+
'name' => env('APP_NAME', 'skeleton'),
42+
'options' => [
43+
'local_agent' => [
44+
'reporting_host' => env('JAEGER_REPORTING_HOST', 'localhost'),
45+
'reporting_port' => env('JAEGER_REPORTING_PORT', 5775),
46+
],
47+
],
3348
],
34-
'sampler' => BinarySampler::createAsAlwaysSample(),
3549
],
3650
];

0 commit comments

Comments
 (0)