Install via composer.
composer config minimum-stability dev
composer require mindbreak/jaeger-php
$config = Config::getInstance();
$tracer = $config->initTracer('example', '0.0.0.0:6831');
$config->gen128bit();
$spanContext = $tracer->extract(Formats\TEXT_MAP, $_SERVER);
$serverSpan = $tracer->startSpan('example HTTP', ['child_of' => $spanContext]);
$serverSpan->addBaggageItem("version", "2.0.0");
$clientTrace->inject($clientSpan1->spanContext, Formats\TEXT_MAP, $_SERVER);
// tags are searchable in Jaeger UI
$span->setTag('http.status', '200');
// log record
$span->log(['error' => 'HTTP request timeout']);
$config->setDisabled(true);
no support for Distributed context propagation
$config::$propagator = \Jaeger\Constants\PROPAGATOR_ZIPKIN;
$span->finish();
$config->flush();
-
Transports
- via Thrift over UDP
-
Sampling
- ConstSampler
- ProbabilisticSampler