tracing-laravel
tracing-laravel copied to clipboard
Are we considering supporting `QueueReport`?
Using a queue can speed up the response time of your site and reduce a lot of risks. For example, if zipkin
crashes, it won't affect the site.
It can be supported with very few code changes, I can provide a PR
.
The reporter can be obtained through dependency injection
.
tracing-laravel/src/Drivers/Zipkin/ZipkinTracer.php
protected function createReporter(): Reporter
{
if (!$this->reporter) {
return new HttpReporter([
'endpoint_url' => sprintf('http://%s:%s/api/v2/spans', $this->host, $this->port),
'timeout' => $this->requestTimeout,
]);
}
return $this->reporter;
}
class QueueReporter implements Reporter
{
public function report(array $spans): void
{
if (count($spans) === 0) {
return;
}
$reporterJob = new ReporterJob(
config('tracing.zipkin.host'),
config('tracing.zipkin.port'),
config('tracing.zipkin.options.request_timeout', 1),
$spans
);
dispatch($reporterJob)->onQueue();
}
}
@KinaneD
Hey @summerKK could you please provide a use case of an architecture were crash in Zipkin could jeopardise your app.