Download the PHP package lucagiardina/lara-zipkin without Composer
On this page you can find all versions of the php package lucagiardina/lara-zipkin. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package lara-zipkin
Lara-Zipkin
Wrapper for Laravel and Lumen using php-zipking
Getting Started
In .env you should set
Lumen Setup
edit app.php
if you want to use the middleware to auto track requests add to $app->middleware([]);
Laravel Setup
edit app.php
if you want to use the middleware to auto track requests edit Kernel.php
LaraZipkinTerminateMiddleware send spans to Zipkin after the response is sent (so it doesn't affect performances)
the Middleware tracks the requests trying to create low cardinality span (ex /route/{param}/and/{id}
)
I suggest you to give names to the routes so you will never have a problem! https://laravel.com/docs/5.8/routing#named-routes
N.B. if you are going to use the Middleware to create the main span and want to track the other middlewares using the LaraZipkinClient object I suggest you to add the middleware that creates the main span into the protected $middlewarePriority array: https://laravel.com/docs/5.7/middleware#sorting-middleware
Using the ZipkinClient object
The LaraZipkinServiceProvider creates into the app container an object:
Methods
getNextSpan
This method allows you to create a main span. By default the Middleware creates a span named with the route name or with the route pattern (ex. /your/route/66) or if there is no route name nor route pattern it will use the request url.
Use this method only if you want to create a new main span and change the context or if you are not going to use the Middleware.
track
This method will create a child span into the main span named $spanName
of the kind $kind
if $spanName
doesn't exists already.
If $method
is set it adds an annotation into the childspan: "$method . '_starts'"
finishTrack
This method will finish the span named $spanName.
If $method
is set it adds an annotation into the childspan: $method . '_starts'
trackCall
This method will create a child span into the span named $spanName
of the kind $kind
.
The name for the new child span will be $callName
and it will add a note $callName . '_starts'
to the child span
If $method
is set it adds an annotation into the childspan: "$method . '_starts'"
trackEndCall
This method will finish the span named $callName
into $spanName
.
tagBy
This method allows to add a tag to the main span in order to search by tag
N.B.
It's possible to use the core object itself as detailed at https://github.com/openzipkin/zipkin-php using the method
The Middleware add Tags in the main span for: