jukylin / jaeger-php
php client for jaeger
Installs: 1 467 325
Dependents: 8
Suggesters: 0
Security: 0
Stars: 225
Watchers: 11
Forks: 81
Open Issues: 23
Requires
- php: >=5.6.0
- opentracing/opentracing: 1.0.0-beta5
- packaged/thrift: 0.10.0
Requires (Dev)
- dev-master
- v2.1.3
- v2.1.3-beta
- v2.1.2-beta
- v2.1.1-beta
- v2.1.0-beta
- v2.0.9-beta
- v2.0.8-beta
- v2.0.7-beta
- v2.0.6-beta
- v2.0.5-beta
- v2.0.4-beta
- v2.0.3-beta
- v2.0.2-beta
- v2.0.1-beta
- v2.0.0-beta
- v1.0.3
- 1.0.2
- 1.0.1
- 1.0.0
- dev-dev_v3
- dev-stable
- dev-hotfix/psr7
- dev-copy_baggage
- dev-fix_bug
- dev-active
- dev-del_setTags
- dev-phpunit
- dev-travis
- dev-imp_op_b5
- dev-apache_2_license
- dev-revert-34-support-unit-testing-autoloading
- dev-for_better_english
- dev-add_zipkin_header
- dev-fix_traceid_len
- dev-require
- dev-refactor
- dev-semantic_conventions
- dev-fix_add_tags
- dev-gen128bit
This package is auto-updated.
Last update: 2024-11-16 16:32:02 UTC
README
jaeger-php
Install
Install via composer.
composer config minimum-stability dev
composer require jukylin/jaeger-php
Init Jaeger-php
$config = Config::getInstance(); $tracer = $config->initTracer('example', '0.0.0.0:6831');
128bit
$config->gen128bit();
Extract from Superglobals
$spanContext = $tracer->extract(Formats\TEXT_MAP, $_SERVER);
Start Span
$serverSpan = $tracer->startSpan('example HTTP', ['child_of' => $spanContext]);
Distributed context propagation
$serverSpan->addBaggageItem("version", "2.0.0");
Inject into Superglobals
$clientTrace->inject($clientSpan1->spanContext, Formats\TEXT_MAP, $_SERVER);
Tags and Log
// tags are searchable in Jaeger UI $span->setTag('http.status', '200'); // log record $span->log(['error' => 'HTTP request timeout']);
Close Tracer
$config->setDisabled(true);
Zipkin B3 Propagation
no support for Distributed context propagation
$config::$propagator = \Jaeger\Constants\PROPAGATOR_ZIPKIN;
Finish span and flush Tracer
$span->finish(); $config->flush();
More example
Features
-
Transports
- via Thrift over UDP
-
Sampling
- ConstSampler
- ProbabilisticSampler