php zipkin
1.0.0
Esta es una biblioteca PHP no oficial para OpenZipkin.
Incompleto, solo tiene un transporte con cero integraciones. Esta biblioteca contiene una implementación mínima para simplemente enviar intervalos a zipkin.
La forma recomendada de instalar PHP-Zipkin es a través de Composer
composer require drefined/php-zipkin
<?php
$ client = new GuzzleHttp Client ();
$ logger = new Drefined Zipkin Transport HTTPLogger ( $ client );
$ tracer = new Drefined Zipkin Tracer ( $ logger , 1.0 , true );
$ endpoint = new Drefined Zipkin Core Endpoint ( ' 127.0.0.1 ' , 8080 , ' test-trace ' );
$ trace = new Drefined Zipkin Core Trace ( $ tracer , $ endpoint );
$ trace -> createNewSpan ( ' test-server-trace ' );
$ trace -> record (
[Annotation:: generateServerRecv ()],
[BinaryAnnotation:: generateString ( ' server.request.uri ' , ' /server ' )]
);
$ trace -> record (
[Annotation:: generateServerSend ()],
[BinaryAnnotation:: generateString ( ' server.response ' , 200 )]
);
Agregue middleware y proveedor de servicios en las ubicaciones adecuadas.
<?php // laravel-project/app/Http/Kernel.php
namespace App Http ;
use ...
use Drefined Zipkin Instrumentation Laravel Middleware EnableZipkinTracing ;
class Kernel extends HttpKernel
{
...
protected $ middleware = [
...
EnableZipkinTracing::class,
];
. . .
}
<?php // laravel-project/config/app.php
use Drefined Zipkin Instrumentation Laravel Providers ZipkinTracingServiceProvider ;
return [
...
' providers ' => [
...
ZipkinTracingServiceProvider::class,
],
...
];