removing jaeger exporters (#890)

Jaeger has dropped support for the jaeger exporter in favour of opentelemetry exporter. The upstream repos are now archived.
Support has been dropped from the opentelemetry collector, and other SIGs should follow soon.
ref: https://github.com/open-telemetry/opentelemetry-specification/pull/2858 and https://github.com/open-telemetry/opentelemetry-specification/issues/2859
This commit is contained in:
Brett McBride 2022-12-09 14:25:42 +11:00 committed by GitHub
parent f5698c8864
commit 5a51249c6b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
122 changed files with 20 additions and 10693 deletions

View File

@ -8,8 +8,6 @@ project_url: "https://github.com/open-telemetry/opentelemetry-php.git"
splits:
- prefix: "proto/otel"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/gen-otlp-protobuf.git"
- prefix: "thrift/jaeger"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/gen-jaeger-thrift.git"
- prefix: "src/Context"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/context.git"
- prefix: "src/SemConv"
@ -20,8 +18,6 @@ splits:
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/sdk.git"
- prefix: "src/Contrib"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/sdk-contrib.git"
- prefix: "src/Contrib/Jaeger"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/exporter-jaeger.git"
- prefix: "src/Contrib/Newrelic"
target: "https://${GH_TOKEN}@github.com/opentelemetry-php/exporter-newrelic.git"
- prefix: "src/Contrib/Otlp"

View File

@ -319,7 +319,6 @@ return [
'exclude_analysis_directory_list' => [
'vendor/',
'proto/',
'thrift/',
],
// Enable this to enable checks of require/include statements referring to valid paths.
@ -370,8 +369,6 @@ return [
'src',
'proto/otel/GPBMetadata',
'proto/otel/Opentelemetry',
'thrift',
'vendor/packaged/thrift',
'vendor/composer',
'vendor/grpc/grpc/src/lib',
'vendor/guzzlehttp',

View File

@ -59,7 +59,6 @@ smoke-test-exporter-examples: FORCE ## Run (some) exporter smoke test examples
# Note this does not include every exporter at the moment
$(DOCKER_COMPOSE) up -d --remove-orphans
$(DC_RUN_PHP) php ./examples/traces/features/exporters/zipkin.php
$(DC_RUN_PHP) php ./examples/traces/features/exporters/jaeger.php
$(DC_RUN_PHP) php ./examples/traces/features/parent_span_example.php
# The following examples do not use the DC_RUN_PHP global because they need environment variables.
$(DOCKER_COMPOSE) run -e NEW_RELIC_ENDPOINT -e NEW_RELIC_INSERT_KEY --rm php php ./examples/traces/features/exporters/newrelic.php
@ -87,8 +86,6 @@ fiber-ffi-example:
@$(DOCKER_COMPOSE) -f docker-compose.fiber-ffi.yaml -p opentelemetry-php_fiber-ffi-example up -d web
protobuf: ## Generate protobuf files
./script/proto_gen.sh
thrift: ## Generate thrift files
./script/thrift_gen.sh
bash: ## bash shell into container
$(DC_RUN_PHP) bash
style: ## Run style check/fix

View File

@ -59,8 +59,6 @@ The [open-telemetry/opentelemetry](https://packagist.org/packages/open-telemetry
This repository also hosts and distributes generated client code used by individual components as separate packages. These packages are:
- Generated [OTLP](https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/protocol/otlp.md) ProtoBuf files:
[open-telemetry/gen-otlp-protobuf](https://packagist.org/packages/open-telemetry/gen-otlp-protobuf)
- Generated [Jaeger](https://github.com/jaegertracing/jaeger-idl) Thrift files:
[open-telemetry/gen-jaeger-thrift](https://packagist.org/packages/open-telemetry/gen-jaeger-thrift)
For now the generated code packages are meant to be only used by library components internally.
@ -308,7 +306,7 @@ See [examples/traces/demo](examples/traces/demo) for a working example.
### Trace examples
You can use the [zipkin](/examples/traces/exporters/zipkin.php) or [jaeger](/examples/traces/exporters/jaeger.php) example to test out the reference
You can use the [zipkin](/examples/traces/exporters/zipkin.php) example to test out the reference
implementations. This example performs a sample trace with a grouping of 5 spans and exports the result
to a local zipkin or jaeger instance.

View File

@ -12,7 +12,6 @@
"cloudevents/sdk-php": "^v1.0.1",
"google/protobuf": "^3.3.0",
"grpc/grpc": "^1.30",
"packaged/thrift": "^0.15.0",
"php-http/async-client-implementation": "^1.0",
"php-http/discovery": "^1.14",
"promphp/prometheus_client_php": "^2.2.1",
@ -47,7 +46,6 @@
"replace": {
"open-telemetry/api": "self.version",
"open-telemetry/context": "self.version",
"open-telemetry/gen-jaeger-thrift": "self.version",
"open-telemetry/gen-otlp-protobuf": "self.version",
"open-telemetry/sdk": "self.version",
"open-telemetry/sdk-contrib": "self.version",
@ -57,8 +55,7 @@
"psr-4": {
"OpenTelemetry\\": "src/",
"Opentelemetry\\Proto\\": "proto/otel/Opentelemetry/Proto/",
"GPBMetadata\\Opentelemetry\\": "proto/otel/GPBMetadata/Opentelemetry/",
"Jaeger\\Thrift\\": "thrift/jaeger/"
"GPBMetadata\\Opentelemetry\\": "proto/otel/GPBMetadata/Opentelemetry/"
},
"files": [
"src/Context/fiber/initialize_fiber_handler.php",
@ -112,7 +109,6 @@
"suggest": {
"ext-gmp": "To support unlimited number of synchronous metric readers",
"ext-grpc": "To use the OTLP GRPC Exporter",
"ext-protobuf": "For more performant protobuf/grpc exporting",
"ext-sockets": "To use the Thrift UDP Exporter for the Jaeger Agent"
"ext-protobuf": "For more performant protobuf/grpc exporting"
}
}

View File

@ -13,7 +13,6 @@ deptrac:
paths:
- ./src
- ./proto
- ./thrift
- ./tests
exclude_files:
- '#.*test.*#'
@ -80,14 +79,6 @@ deptrac:
collectors:
- type: className
regex: ^Composer\\*
- name: Thrift
collectors:
- type: className
regex: ^Thrift\\*
- name: JaegerThrift
collectors:
- type: className
regex: ^Jaeger\\Thrift\\*
ruleset:
Context:
@ -107,12 +98,8 @@ deptrac:
- +OtelProto
- Grpc
- Prometheus
- Thrift
- JaegerThrift
Extension:
- +API
OtelProto:
- GoogleProtobuf
- Grpc
JaegerThrift:
- Thrift

View File

@ -1,64 +0,0 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../../../vendor/autoload.php';
use OpenTelemetry\Contrib\Jaeger\Exporter as JaegerExporter;
use OpenTelemetry\SDK\Common\Export\Http\PsrTransportFactory;
use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProvider;
$exporter = new JaegerExporter(
'AlwaysOnJaegerExample',
PsrTransportFactory::discover()->create('http://jaeger:9412/api/v2/spans')
);
$tracerProvider = new TracerProvider(
new SimpleSpanProcessor($exporter),
new AlwaysOnSampler(),
);
echo 'Starting Jaeger example';
$tracer = $tracerProvider->getTracer('io.opentelemetry.contrib.php');
$rootSpan = $tracer->spanBuilder('root')->startSpan();
$scope = $rootSpan->activate();
for ($i = 0; $i < 5; $i++) {
// start a span, register some events
$span = $tracer->spanBuilder('session.generate.span-' . $i)->startSpan();
echo sprintf(
PHP_EOL . 'Exporting Trace: %s, Parent: %s, Span: %s',
$span->getContext()->getTraceId(),
$span->getParentContext()->getSpanId() ?: 'None',
$span->getContext()->getSpanId()
);
$span->setAttribute('remote_ip', '1.2.3.4')
->setAttribute('country', 'USA');
$span->addEvent('found_login' . $i, [
'id' => $i,
'username' => 'otuser' . $i,
]);
$span->addEvent('generated_session', [
'id' => md5((string) microtime(true)),
]);
try {
throw new Exception('Record exception test event');
} catch (Exception $exception) {
$span->recordException($exception);
}
$span->end();
}
$scope->detach();
$rootSpan->end();
echo PHP_EOL . 'Jaeger example complete! See the results at http://localhost:16686/';
echo PHP_EOL;
$tracerProvider->shutdown();

View File

@ -1,72 +0,0 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../../../vendor/autoload.php';
use Monolog\Handler\StreamHandler;
use Monolog\Logger;
use OpenTelemetry\Contrib\Jaeger\AgentExporter;
use OpenTelemetry\SDK\Common\Log\LoggerHolder;
use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProvider;
use Psr\Log\LogLevel;
$logger = new Logger('otel-php', [new StreamHandler(STDOUT, LogLevel::DEBUG)]);
LoggerHolder::set($logger);
$exporter = new AgentExporter('jaeger-thrift', 'jaeger:6831');
$tracerProvider = new TracerProvider(
new SimpleSpanProcessor($exporter),
new AlwaysOnSampler(),
);
echo 'Starting Jaeger Thrift example';
$tracer = $tracerProvider->getTracer('io.opentelemetry.contrib.php');
$rootSpan = $tracer->spanBuilder('root')->startSpan();
$rootSpan->activate();
echo PHP_EOL . sprintf(
'Root Span: %s, Parent: %s, Span: %s',
$rootSpan->getContext()->getTraceId(),
$rootSpan->getParentContext()->getSpanId(),
$rootSpan->getContext()->getSpanId()
) . PHP_EOL;
for ($i = 0; $i < 1; $i++) {
// start a span, register some events
$span = $tracer->spanBuilder('session.generate.span-' . $i)->startSpan();
echo sprintf(
PHP_EOL . 'Exporting Trace: %s, Parent: %s, Span: %s',
$span->getContext()->getTraceId(),
$span->getParentContext()->getSpanId() ?: 'None',
$span->getContext()->getSpanId()
) . PHP_EOL;
$span->setAttribute('remote_ip', '1.2.3.4')
->setAttribute('country', 'USA');
$span->addEvent('found_login' . $i, [
'id' => $i,
'username' => 'otuser' . $i,
]);
$span->addEvent('generated_session', [
'id' => md5((string) microtime(true)),
]);
try {
throw new Exception('Record exception test event');
} catch (Exception $exception) {
$span->recordException($exception);
}
$span->end();
}
$rootSpan->end();
echo PHP_EOL . 'Jaeger Thrift example complete! See the results at http://localhost:16686/';
echo PHP_EOL;
$tracerProvider->shutdown();

View File

@ -10,7 +10,6 @@ use OpenTelemetry\SDK\Trace\TracerProvider;
$transport = PsrTransportFactory::discover()->create('http://zipkin:9411/api/v2/spans', 'application/json');
$zipkinExporter = new ZipkinExporter(
'alwaysOnZipkinExample',
$transport
);
$tracerProvider = new TracerProvider(

View File

@ -3,11 +3,9 @@
declare(strict_types=1);
require __DIR__ . '/../../../vendor/autoload.php';
use OpenTelemetry\Contrib\Jaeger\Exporter as JaegerExporter;
use OpenTelemetry\Contrib\Zipkin\Exporter as ZipkinExporter;
use OpenTelemetry\SDK\Common\Export\Http\PsrTransportFactory;
use OpenTelemetry\SDK\Trace\Sampler\AlwaysOnSampler;
use OpenTelemetry\SDK\Trace\Span;
use OpenTelemetry\SDK\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProvider;
@ -20,16 +18,9 @@ $zipkinExporter = new ZipkinExporter(
PsrTransportFactory::discover()->create('http://zipkin:9411/api/v2/spans')
);
// jaeger exporter
$jaegerExporter = new JaegerExporter(
$serviceName,
PsrTransportFactory::discover()->create('http://jaeger:9411/api/v2/spans')
);
$tracerProvider = new TracerProvider(
[
new SimpleSpanProcessor($zipkinExporter),
new SimpleSpanProcessor($jaegerExporter),
],
$sampler
);
@ -74,7 +65,6 @@ echo ' - ' . $rootSpan->getContext()->getTraceId() . PHP_EOL;
echo ' - ' . $secondRootSpan->getContext()->getTraceId() . PHP_EOL;
echo PHP_EOL;
echo 'See the results at' . PHP_EOL;
echo 'Jaeger: http://localhost:16686/' . PHP_EOL;
echo 'Zipkin: http://localhost:9411/' . PHP_EOL;
$tracerProvider->shutdown();

View File

@ -14,7 +14,7 @@ require __DIR__ . '/../../../vendor/autoload.php';
* will be the last log entry
*/
use OpenTelemetry\Contrib\Jaeger\Exporter as JaegerExporter;
use OpenTelemetry\Contrib\Zipkin\Exporter as ZipkinExporter;
use OpenTelemetry\SDK\Common\Export\Http\PsrTransportFactory;
use OpenTelemetry\SDK\Common\Time\ClockFactory;
use OpenTelemetry\SDK\Logs\SimplePsrFileLogger;
@ -35,14 +35,13 @@ if (!is_dir($logDir) && !mkdir($logDir, 0744, true) && !is_dir($logDir)) {
/**
* Create the Exporter.
*/
$exporterEndpoint = 'http://jaeger:9412/api/v2/spans';
$exporterEndpoint = 'http://zipkin:9411/api/v2/spans';
/**
* If you want to simulate a connection error, uncomment the next line
*/
//$exporterEndpoint = 'http://example.com:9412/api/v2/spans';
$exporter = new JaegerExporter(
'alwaysOnJaegerExample',
PsrTransportFactory::discover()->create('http://jaeger:9412/api/v2/spans', 'application/json'),
//$exporterEndpoint = 'http://example.com:9411/api/v2/spans';
$exporter = new ZipkinExporter(
PsrTransportFactory::discover()->create($exporterEndpoint, 'application/json'),
);
/**
* Decorate the Exporter

View File

@ -4,8 +4,7 @@
],
"exclude": [
"tests",
"proto",
"thrift"
"proto"
],
"report": {
"html": "var/metrics",

View File

@ -1,28 +0,0 @@
#!/bin/sh
set -e
cd "$(dirname "$0")/.."
# checkout jaeger thrift files
rm -rf jaeger-idl
git clone https://github.com/jaegertracing/jaeger-idl
# define thrift cmd
THRIFT="docker run -u $(id -u) -v '${PWD}:/data' jaegertracing/thrift:0.13 thrift -o /data/jaeger-idl"
THRIFT_CMD="${THRIFT} --gen php"
# generate php files
FILES=$(find jaeger-idl/thrift -type f -name \*.thrift)
for f in ${FILES}; do
echo "${THRIFT_CMD} "/data/${f}""
eval $THRIFT_CMD "/data/${f}"
done
# move generated files
rm -rf thrift
mkdir -p thrift
mv jaeger-idl/gen-php/Jaeger/Thrift thrift/jaeger
# remove thrift files
rm -rf jaeger-idl

View File

@ -1,57 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use OpenTelemetry\SDK\Resource\ResourceInfoFactory;
use OpenTelemetry\SDK\Trace\Behavior\SpanExporterTrait;
use OpenTelemetry\SDK\Trace\SpanExporterInterface;
use OpenTelemetry\SemConv\ResourceAttributes;
/**
* @package OpenTelemetry\Exporter
*/
class AgentExporter implements SpanExporterInterface
{
use SpanExporterTrait;
private SpanConverter $spanConverter;
private JaegerTransport $jaegerTransport;
private string $defaultServiceName;
public function __construct(
string $endpointUrl
) {
$parsedEndpoint = (new ParsedEndpointUrl($endpointUrl))
->validateHost() //This is because the host is required downstream
->validatePort(); //This is because the port is required downstream
$this->spanConverter = new SpanConverter();
$this->jaegerTransport = new JaegerTransport($parsedEndpoint);
$this->defaultServiceName = ResourceInfoFactory::defaultResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME);
}
public function closeAgentConnection(): void
{
$this->jaegerTransport->close();
}
public function doExport(iterable $spans): bool
{
// UDP Transport begins here after converting to thrift format span
foreach ($spans as $span) {
$serviceName = $span->getResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME)
??
$this->defaultServiceName;
$this->jaegerTransport->append(
$this->spanConverter->convert([$span])[0],
$serviceName
);
}
return true;
}
}

View File

@ -1,23 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger\BatchAdapter;
use Jaeger\Thrift\Batch;
use Thrift\Protocol\TProtocol;
class BatchAdapter implements BatchAdapterInterface
{
private Batch $batchInstance;
public function __construct(array $values)
{
$this->batchInstance = new Batch($values);
}
public function write(TProtocol $output): void
{
$this->batchInstance->write($output);
}
}

View File

@ -1,13 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger\BatchAdapter;
class BatchAdapterFactory implements BatchAdapterFactoryInterface
{
public function create(array $values): BatchAdapterInterface
{
return new BatchAdapter($values);
}
}

View File

@ -1,10 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger\BatchAdapter;
interface BatchAdapterFactoryInterface
{
public function create(array $values): BatchAdapterInterface;
}

View File

@ -1,12 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger\BatchAdapter;
use Thrift\Protocol\TProtocol;
interface BatchAdapterInterface
{
public function write(TProtocol $output): void;
}

View File

@ -1,11 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use OpenTelemetry\Contrib\Zipkin;
class Exporter extends Zipkin\Exporter
{
}

View File

@ -1,44 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use OpenTelemetry\SDK\Trace\Behavior\SpanExporterTrait;
use OpenTelemetry\SDK\Trace\Behavior\UsesSpanConverterTrait;
use OpenTelemetry\SDK\Trace\SpanExporterInterface;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
class HttpCollectorExporter implements SpanExporterInterface
{
use UsesSpanConverterTrait;
use SpanExporterTrait;
private HttpSender $sender;
public function __construct(
string $endpointUrl,
ClientInterface $client,
RequestFactoryInterface $requestFactory,
StreamFactoryInterface $streamFactory
) {
$parsedEndpoint = (new ParsedEndpointUrl($endpointUrl))
->validateHost(); //This is because the host is required downstream
$this->sender = new HttpSender(
$client,
$requestFactory,
$streamFactory,
$parsedEndpoint
);
}
public function doExport(iterable $spans): bool
{
$this->sender->send($spans);
return true;
}
}

View File

@ -1,130 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use Jaeger\Thrift\Process;
use OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterFactory;
use OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterFactoryInterface;
use OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterInterface;
use OpenTelemetry\Contrib\Jaeger\TagFactory\TagFactory;
use OpenTelemetry\SDK\Behavior\LogsMessagesTrait;
use OpenTelemetry\SDK\Resource\ResourceInfo;
use OpenTelemetry\SDK\Resource\ResourceInfoFactory;
use OpenTelemetry\SemConv\ResourceAttributes;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Thrift\Protocol\TBinaryProtocol;
use Thrift\Protocol\TProtocol;
class HttpSender
{
use LogsMessagesTrait;
private TProtocol $protocol;
private BatchAdapterFactoryInterface $batchAdapterFactory;
private string $defaultServiceName;
public function __construct(
ClientInterface $client,
RequestFactoryInterface $requestFactory,
StreamFactoryInterface $streamFactory,
ParsedEndpointUrl $parsedEndpoint,
BatchAdapterFactoryInterface $batchAdapterFactory = null
) {
$this->protocol = new TBinaryProtocol(
new ThriftHttpTransport(
$client,
$requestFactory,
$streamFactory,
$parsedEndpoint
)
);
$this->batchAdapterFactory = $batchAdapterFactory ?? new BatchAdapterFactory();
$this->defaultServiceName = ResourceInfoFactory::defaultResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME);
}
public function send(iterable $spans): void
{
$batches = $this->createBatchesPerResource(
self::groupSpansByResource($spans)
);
foreach ($batches as $batch) {
$this->sendBatch($batch);
}
}
private static function groupSpansByResource(iterable $spans): array
{
$spansGroupedByResource = [];
foreach ($spans as $span) {
/** @var ResourceInfo */
$resource = $span->getResource();
$resourceAsKey = $resource->serialize();
if (!isset($spansGroupedByResource[$resourceAsKey])) {
$spansGroupedByResource[$resourceAsKey] = [
'spans' => [],
'resource' => $resource,
];
}
$spansGroupedByResource[$resourceAsKey]['spans'][] = $span;
}
return $spansGroupedByResource;
}
private function createBatchesPerResource(array $spansGroupedByResource): array
{
$batches = [];
foreach ($spansGroupedByResource as $unused => $dataForBatch) {
$batch = $this->batchAdapterFactory->create([
'spans' => (new SpanConverter())->convert(
$dataForBatch['spans']
),
'process' => $this->createProcessFromResource(
$dataForBatch['resource']
),
]);
$batches[] = $batch;
}
return $batches;
}
private function createProcessFromResource(ResourceInfo $resource): Process
{
//Defaulting to (what should be) the default resource's service name
$serviceName = $this->defaultServiceName;
$tags = [];
foreach ($resource->getAttributes() as $key => $value) {
if ($key === ResourceAttributes::SERVICE_NAME) {
$serviceName = (string) $value;
continue;
}
$tags[] = TagFactory::create($key, $value);
}
return new Process([
'serviceName' => $serviceName,
'tags' => $tags,
]);
}
private function sendBatch(BatchAdapterInterface $batch): void
{
$batch->write($this->protocol);
$this->protocol->getTransport()->flush();
}
}

View File

@ -1,41 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
/**
* An implementation of the section of the spec around converting OTEL's span/trace id representations to Thrift's format
* https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/jaeger.md#ids
*/
class IdConverter
{
public static function convertOtelToJaegerTraceIds(string $traceId): array
{
$traceIdLow = self::convert16CharHexStringToSignedInt(substr($traceId, 16, 32));
$traceIdHigh = self::convert16CharHexStringToSignedInt(substr($traceId, 0, 16));
return [
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
];
}
public static function convertOtelToJaegerSpanId(string $spanId): int
{
return self::convert16CharHexStringToSignedInt($spanId);
}
/**
* PHP has the limitation to correctly convert int64 from the 16 character hex only
* @param string $hex
* @return int
*/
private static function convert16CharHexStringToSignedInt(string $hex): int
{
$hi = intval(substr($hex, -16, -8), 16);
$lo = intval(substr($hex, -8, 8), 16);
return $hi << 32 | $lo;
}
}

View File

@ -1,114 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use Jaeger\Thrift\Agent\AgentClient;
use Jaeger\Thrift\Batch;
use Jaeger\Thrift\Process;
use Jaeger\Thrift\Span;
use OpenTelemetry\SDK\Behavior\LogsMessagesTrait;
use Thrift\Exception\TTransportException;
use Thrift\Protocol\TCompactProtocol;
// @phan-file-suppress PhanUndeclaredClassMethod
final class JaegerTransport implements TransportInterface
{
use LogsMessagesTrait;
// DEFAULT_BUFFER_SIZE indicates the default maximum buffer size, or the size threshold
// at which the buffer will be flushed to the agent.
const DEFAULT_BUFFER_SIZE = 1;
private $transport;
private $client;
private array $buffer = [];
private $process = null;
private int $maxBufferSize = 0;
public function __construct(ParsedEndpointUrl $parsedEndpoint, $maxBufferSize = 0)
{
$this->transport = new ThriftUdpTransport($parsedEndpoint);
$p = new TCompactProtocol($this->transport);
$this->client = new AgentClient($p, $p);
$this->maxBufferSize = ($maxBufferSize > 0 ? $maxBufferSize : self::DEFAULT_BUFFER_SIZE);
}
/**
* Submits a new span to collectors, possibly delayed and/or with buffering.
*
* @param Span $span
*/
public function append(Span $span, $serviceName): int
{
// Grab a copy of the process data, if we didn't already.
if ($this->process == null) {
$this->process = new Process([
'serviceName' => $serviceName,
'tags' => $span->tags,
]);
}
$this->buffer[] = $span;
// TODO(tylerc): Buffer spans and send them in as few UDP packets as possible.
return $this->flush();
}
/**
* Flush submits the internal buffer to the remote server. It returns the
* number of spans flushed.
*
* @param bool $force - force a flush, even on a partial buffer
*/
public function flush($force = false): int
{
$spans = count($this->buffer);
// buffer not full yet
if (!$force && $spans < $this->maxBufferSize) {
return 0;
}
// no spans to flush
if ($spans <= 0) {
return 0;
}
try {
// emit a batch
$this->client->emitBatch(new Batch([
'process' => $this->process,
'spans' => $this->buffer,
]));
// flush the UDP data
$this->transport->flush();
// reset the internal buffer
$this->buffer = [];
// reset the process tag
$this->process = null;
} catch (TTransportException $e) {
self::logError('jaeger: transport failure', ['exception' => $e]);
return 0;
}
return $spans;
}
/**
* Does a clean shutdown of the reporter, flushing any traces that may be
* buffered in memory.
*/
public function close(): void
{
$this->flush(true); // flush all remaining data
$this->transport->close();
}
}

View File

@ -1,65 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use InvalidArgumentException;
class ParsedEndpointUrl
{
private string $endpointUrl;
private array $parsedDsn;
public function __construct(string $endpointUrl)
{
$this->endpointUrl = $endpointUrl;
$this->parsedDsn = parse_url($this->endpointUrl);
if (!is_array($this->parsedDsn)) {
throw new InvalidArgumentException('Unable to parse provided DSN for url: ' . $this->endpointUrl);
}
}
public function getEndpointUrl(): string
{
return $this->endpointUrl;
}
public function validateHost(): self
{
$this->validateUrlComponent('host');
return $this;
}
public function getHost(): string
{
$this->validateHost();
return $this->parsedDsn['host'];
}
public function validatePort(): self
{
$this->validateUrlComponent('port');
return $this;
}
public function getPort(): int
{
$this->validatePort();
return $this->parsedDsn['port'];
}
private function validateUrlComponent(string $componentName): void
{
if (!isset($this->parsedDsn[$componentName])) {
throw new InvalidArgumentException($this->endpointUrl . ' is missing the ' . $componentName);
}
}
}

View File

@ -1,11 +0,0 @@
# OpenTelemetry Jaeger Exporter
A Jaeger exporter for OpenTelemetry.
## Usage
### HTTP (Zipkin)
https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/traces/features/exporters/jaeger.php
### Thrift
https://github.com/open-telemetry/opentelemetry-php/blob/main/examples/traces/features/exporters/jaeger_thrift.php

View File

@ -1,237 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use Jaeger\Thrift\Log;
use Jaeger\Thrift\Span as JTSpan;
use Jaeger\Thrift\SpanRef;
use Jaeger\Thrift\SpanRefType;
use OpenTelemetry\API\Trace\SpanKind;
use OpenTelemetry\API\Trace\StatusCode;
use OpenTelemetry\Contrib\Jaeger\TagFactory\TagFactory;
use OpenTelemetry\SDK\Common\Time\Util as TimeUtil;
use OpenTelemetry\SDK\Trace\EventInterface;
use OpenTelemetry\SDK\Trace\LinkInterface;
use OpenTelemetry\SDK\Trace\SpanConverterInterface;
use OpenTelemetry\SDK\Trace\SpanDataInterface;
use RuntimeException;
class SpanConverter implements SpanConverterInterface
{
const STATUS_CODE_TAG_KEY = 'otel.status_code';
const STATUS_OK = 'OK';
const STATUS_ERROR = 'ERROR';
const KEY_ERROR_FLAG = 'error';
const STATUS_DESCRIPTION_TAG_KEY = 'otel.status_description';
const KEY_INSTRUMENTATION_SCOPE_NAME = 'otel.scope.name';
const KEY_INSTRUMENTATION_SCOPE_VERSION = 'otel.scope.version';
const KEY_SPAN_KIND = 'span.kind';
const JAEGER_SPAN_KIND_CLIENT = 'client';
const JAEGER_SPAN_KIND_SERVER = 'server';
const JAEGER_SPAN_KIND_CONSUMER = 'consumer';
const JAEGER_SPAN_KIND_PRODUCER = 'producer';
const EVENT_ATTRIBUTE_KEY_NAMED_EVENT = 'event';
const JAEGER_KEY_EVENT = 'event';
public function __construct()
{
self::checkIfPHPSupports64BitIntegers();
}
private static function checkIfPHPSupports64BitIntegers(): void
{
if (PHP_INT_SIZE < 8) {
$humanReadableIntSize = PHP_INT_SIZE*8;
throw new RuntimeException("Integrating with Jaeger requires usage of 64 bit integers, but your current platform is $humanReadableIntSize bit. See https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/jaeger.md#ids for more information.");
}
}
public function convert(iterable $spans): array
{
$aggregate = [];
foreach ($spans as $span) {
$aggregate[] = $this->convertSpan($span);
}
return $aggregate;
}
private function convertSpan(SpanDataInterface $span): JTSpan
{
[
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
'spanId' => $spanId,
'parentSpanId' => $parentSpanId,
] = self::convertOtelToJaegerIds($span);
$startTime = TimeUtil::nanosToMicros($span->getStartEpochNanos());
$duration = TimeUtil::nanosToMicros($span->getEndEpochNanos() - $span->getStartEpochNanos());
$tags = self::convertOtelSpanDataToJaegerTags($span);
$logs = self::convertOtelEventsToJaegerLogs($span);
$references = self::convertOtelLinksToJaegerSpanReferences($span);
return new JTSpan([
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
'spanId' => $spanId,
'parentSpanId' => $parentSpanId,
'operationName' => $span->getName(),
'flags' => $span->getContext()->getTraceFlags(),
'startTime' => $startTime,
'duration' => ($duration < 0) ? 0 : $duration,
'tags' => $tags,
'logs' => $logs,
'references' => $references,
]);
}
private static function convertOtelToJaegerIds(SpanDataInterface $span): array
{
[
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh
] = IdConverter::convertOtelToJaegerTraceIds($span->getContext()->getTraceID());
$spanId = IdConverter::convertOtelToJaegerSpanId($span->getContext()->getSpanID());
$parentSpanId = IdConverter::convertOtelToJaegerSpanId($span->getParentSpanId());
return [
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
'spanId' => $spanId,
'parentSpanId' => $parentSpanId,
];
}
private static function convertOtelSpanKindToJaeger(SpanDataInterface $span): ?string
{
switch ($span->getKind()) {
case SpanKind::KIND_CLIENT:
return self::JAEGER_SPAN_KIND_CLIENT;
case SpanKind::KIND_SERVER:
return self::JAEGER_SPAN_KIND_SERVER;
case SpanKind::KIND_CONSUMER:
return self::JAEGER_SPAN_KIND_CONSUMER;
case SpanKind::KIND_PRODUCER:
return self::JAEGER_SPAN_KIND_PRODUCER;
case SpanKind::KIND_INTERNAL:
return null;
}
return null;
}
private static function convertOtelSpanDataToJaegerTags(SpanDataInterface $span): array
{
$tags = [];
if ($span->getStatus()->getCode() !== StatusCode::STATUS_UNSET) {
switch ($span->getStatus()->getCode()) {
case StatusCode::STATUS_OK:
$tags[self::STATUS_CODE_TAG_KEY] = self::STATUS_OK;
break;
case StatusCode::STATUS_ERROR:
$tags[self::KEY_ERROR_FLAG] = true;
$tags[self::STATUS_CODE_TAG_KEY] = self::STATUS_ERROR;
break;
}
if (!empty($span->getStatus()->getDescription())) {
$tags[self::STATUS_DESCRIPTION_TAG_KEY] = $span->getStatus()->getDescription();
}
}
if (!empty($span->getInstrumentationScope()->getName())) {
$tags[SpanConverter::KEY_INSTRUMENTATION_SCOPE_NAME] = $span->getInstrumentationScope()->getName();
}
if ($span->getInstrumentationScope()->getVersion() !== null) {
$tags[SpanConverter::KEY_INSTRUMENTATION_SCOPE_VERSION] = $span->getInstrumentationScope()->getVersion();
}
$jaegerSpanKind = self::convertOtelSpanKindToJaeger($span);
if ($jaegerSpanKind !== null) {
$tags[self::KEY_SPAN_KIND] = $jaegerSpanKind;
}
foreach ($span->getAttributes() as $k => $v) {
$tags[$k] = $v;
}
foreach ($span->getResource()->getAttributes() as $k => $v) {
$tags[$k] = $v;
}
foreach ($span->getInstrumentationScope()->getAttributes() as $k => $v) {
$tags[$k] = $v;
}
return self::buildTags($tags);
}
private static function buildTags(array $tagPairs): array
{
$tags = [];
foreach ($tagPairs as $key => $value) {
$tags[] = TagFactory::create($key, $value);
}
return $tags;
}
private static function convertOtelEventsToJaegerLogs(SpanDataInterface $span): array
{
return array_map(
fn ($event) => self::convertSingleOtelEventToJaegerLog($event),
$span->getEvents()
);
}
private static function convertSingleOtelEventToJaegerLog(EventInterface $event): Log
{
$timestamp = TimeUtil::nanosToMicros($event->getEpochNanos());
$eventValue = $event->getAttributes()->get(self::EVENT_ATTRIBUTE_KEY_NAMED_EVENT) ?? $event->getName();
$attributes = $event->getAttributes()->toArray();
$attributes[self::JAEGER_KEY_EVENT] = $eventValue;
$attributesAsTags = self::buildTags($attributes);
return new Log([
'timestamp' => $timestamp,
'fields' => $attributesAsTags,
]);
}
private static function convertOtelLinksToJaegerSpanReferences(SpanDataInterface $span): array
{
return array_map(
fn ($link) => self::convertSingleOtelLinkToJaegerSpanReference($link),
$span->getLinks()
);
}
private static function convertSingleOtelLinkToJaegerSpanReference(LinkInterface $link): SpanRef
{
[
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
] = IdConverter::convertOtelToJaegerTraceIds($link->getSpanContext()->getTraceId());
$integerSpanId = IdConverter::convertOtelToJaegerSpanId($link->getSpanContext()->getSpanId());
return new SpanRef([
'refType' => SpanRefType::FOLLOWS_FROM,
'traceIdLow' => $traceIdLow,
'traceIdHigh' => $traceIdHigh,
'spanId' => $integerSpanId,
]);
}
}

View File

@ -1,86 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger\TagFactory;
use Jaeger\Thrift\Tag;
use Jaeger\Thrift\TagType;
class TagFactory
{
public static function create(string $key, $value): Tag
{
return self::createJaegerTagInstance(
$key,
self::convertValueToTypeJaegerTagsSupport($value)
);
}
private static function convertValueToTypeJaegerTagsSupport($value)
{
if (is_array($value)) {
return self::serializeArrayToString($value);
}
return $value;
}
private static function createJaegerTagInstance(string $key, $value)
{
if (is_bool($value)) {
return new Tag([
'key' => $key,
'vType' => TagType::BOOL,
'vBool' => $value,
]);
}
if (is_int($value)) {
return new Tag([
'key' => $key,
'vType' => TagType::LONG,
'vLong' => $value,
]);
}
if (is_numeric($value)) {
return new Tag([
'key' => $key,
'vType' => TagType::DOUBLE,
'vDouble' => $value,
]);
}
return new Tag([
'key' => $key,
'vType' => TagType::STRING,
'vStr' => (string) $value,
]);
}
private static function serializeArrayToString(array $arrayToSerialize): string
{
return self::recursivelySerializeArray($arrayToSerialize);
}
private static function recursivelySerializeArray($value): string
{
if (is_array($value)) {
return implode(',', array_map(fn ($val) => self::recursivelySerializeArray($val), $value));
}
// Casting false to string makes an empty string
if (is_bool($value)) {
return $value ? 'true' : 'false';
}
// Floats will lose precision if their string representation
// is >=14 or >=17 digits, depending on PHP settings.
// Can also throw E_RECOVERABLE_ERROR if $value is an object
// without a __toString() method.
// This is possible because OpenTelemetry\Trace\Span does not verify
// setAttribute() $value input.
return (string) $value;
}
}

View File

@ -1,101 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use BadMethodCallException;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestFactoryInterface;
use Psr\Http\Message\StreamFactoryInterface;
use Thrift\Factory\TStringFuncFactory;
use Thrift\Transport\TTransport;
/**
* This was created in lieu of Thrift\Transport\THttpClient because of it's usage of fopen for making network requests
*/
class ThriftHttpTransport extends TTransport
{
private ClientInterface $psr18Client;
private RequestFactoryInterface $requestFactory;
private StreamFactoryInterface $streamFactory;
private ParsedEndpointUrl $parsedEndpoint;
private string $buffer = '';
public function __construct(
ClientInterface $client,
RequestFactoryInterface $requestFactory,
StreamFactoryInterface $streamFactory,
ParsedEndpointUrl $parsedEndpoint
) {
$this->psr18Client = $client;
$this->requestFactory = $requestFactory;
$this->streamFactory = $streamFactory;
$this->parsedEndpoint = $parsedEndpoint;
}
public function isOpen()
{
throw new BadMethodCallException(__FUNCTION__ . " is unused as of this writing. See Thrift\Transport\THttpClient for a reference implementation.");
}
public function open()
{
throw new BadMethodCallException(__FUNCTION__ . " is unused as of this writing. See Thrift\Transport\THttpClient for a reference implementation.");
}
public function close()
{
throw new BadMethodCallException(__FUNCTION__ . " is unused as of this writing. See Thrift\Transport\THttpClient for a reference implementation.");
}
public function read($len)
{
throw new BadMethodCallException(__FUNCTION__ . " is unused as of this writing. See Thrift\Transport\THttpClient for a reference implementation.");
}
/**
* Writes some data into the pending buffer
*
* @param string $buf The data to write
*/
public function write($buf)
{
$this->buffer .= $buf;
}
/**
* Opens and sends the actual request over the HTTP connection
*/
public function flush()
{
$endpointUrl = $this->parsedEndpoint->getEndpointUrl();
$host = $this->parsedEndpoint->getHost();
$request = $this->requestFactory->createRequest('POST', $endpointUrl);
$headers = [
'Host' => $host, //Port will be implied - https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Host
'Accept' => 'application/x-thrift',
'User-Agent' => 'PHP/THttpClient',
'Content-Type' => 'application/x-thrift',
'Content-Length' => TStringFuncFactory::create()->strlen($this->buffer),
];
foreach ($headers as $key => $value) {
$request = $request->withAddedHeader($key, $value);
}
$request = $request->withBody(
$this->streamFactory->createStream($this->buffer)
);
$this->psr18Client->sendRequest($request);
$this->buffer = '';
}
}

View File

@ -1,90 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use Thrift\Exception\TTransportException;
use Thrift\Transport\TTransport;
class ThriftUdpTransport extends TTransport
{
const MAX_UDP_PACKET = 65000;
protected $server;
protected $port;
protected $socket = null;
protected $buffer = '';
// this implements a TTransport over UDP
public function __construct(ParsedEndpointUrl $parsedEndpoint)
{
$this->server = $parsedEndpoint->getHost();
$this->port = $parsedEndpoint->getPort();
// open a UDP socket to somewhere
if (!($this->socket = \socket_create(AF_INET, SOCK_DGRAM, SOL_UDP))) {
$errorcode = \socket_last_error();
$errormsg = \socket_strerror($errorcode);
error_log("jaeger: transport: Couldn't create socket: [$errorcode] $errormsg");
throw new TTransportException('unable to open UDP socket', TTransportException::UNKNOWN);
}
}
public function isOpen()
{
return $this->socket != null;
}
// Open does nothing as connection is opened on creation
// Required to maintain thrift.TTransport interface
public function open()
{
}
public function close()
{
\socket_close($this->socket);
$this->socket = null;
}
public function read($len)
{
// not implemented
return '';
}
public function write($buf)
{
// ensure that the data will still fit in a UDP packeg
if (strlen($this->buffer) + strlen($buf) > self::MAX_UDP_PACKET) {
throw new TTransportException('Data does not fit within one UDP packet', TTransportException::UNKNOWN);
}
// buffer up some data
$this->buffer .= $buf;
}
public function flush()
{
// no data to send; don't send a packet
if (strlen($this->buffer) == 0) {
return;
}
// TODO(tylerc): This assumes that the whole buffer successfully sent... I believe
// that this should always be the case for UDP packets, but I could be wrong.
// flush the buffer to the socket
if (!\socket_sendto($this->socket, $this->buffer, strlen($this->buffer), 0, $this->server, $this->port)) {
$errorcode = \socket_last_error();
$errormsg = \socket_strerror($errorcode);
error_log("jaeger: transport: Could not flush data: [$errorcode] $errormsg");
}
$this->buffer = ''; // empty the buffer
}
}

View File

@ -1,33 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\Jaeger;
use Jaeger\Thrift\Span;
interface TransportInterface
{
/**
* Append converts the span to the wire representation and adds it
* to sender's internal buffer. If the buffer exceeds its designated
* size, the transport should call Flush() and return the number of spans
* flushed, otherwise return 0.
*
* @param Span $span
*/
public function append(Span $span, $serviceName): int;
/**
* Flush submits the internal buffer to the remote server. It returns the
* number of spans flushed.
*/
public function flush(): int;
/**
* Does a clean shutdown of the transport, flushing any traces that may
* remain in the internal buffer.
*/
public function close(): void;
}

View File

@ -1,31 +0,0 @@
{
"name": "open-telemetry/exporter-jaeger",
"description": "jaeger exporter for OpenTelemetry PHP.",
"keywords": ["opentelemetry", "otel", "tracing", "exporter", "contrib", "jaeger"],
"type": "library",
"license": "Apache-2.0",
"authors": [
{
"name": "opentelemetry-php contributors",
"homepage": "https://github.com/open-telemetry/opentelemetry-php/graphs/contributors"
}
],
"require": {
"php": "^7.4 || ^8.0",
"open-telemetry/api": "self.version",
"open-telemetry/gen-jaeger-thrift": "self.version",
"open-telemetry/exporter-zipkin": "self.version",
"open-telemetry/sdk": "self.version",
"php-http/async-client-implementation": "^1.0",
"php-http/discovery": "^1.14",
"psr/http-factory-implementation": "^1.0"
},
"autoload": {
"psr-4": {
"OpenTelemetry\\Contrib\\Jaeger\\": "."
}
},
"suggest": {
"ext-sockets": "To use the Thrift UDP Exporter"
}
}

View File

@ -1,7 +1,7 @@
{
"name": "open-telemetry/sdk-contrib",
"description": "Vendor specific implementations for OpenTelemetry PHP API/SDK.",
"keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "otlp", "jaeger", "zipkin", "prometheus", "newrelic"],
"keywords": ["opentelemetry", "otel", "metrics", "tracing", "logging", "apm", "otlp", "zipkin", "prometheus", "newrelic"],
"type": "library",
"license": "Apache-2.0",
"authors": [
@ -15,7 +15,6 @@
"ext-json": "*",
"open-telemetry/api": "self.version",
"open-telemetry/context": "self.version",
"open-telemetry/gen-jaeger-thrift": "self.version",
"open-telemetry/gen-otlp-protobuf": "self.version",
"open-telemetry/sdk": "self.version",
"open-telemetry/sem-conv": "self.version",
@ -40,8 +39,5 @@
"Zipkin/_register.php"
]
},
"suggest": {
"ext-sockets": "To use the Thrift UDP Exporter for the Jaeger Agent"
}
}

View File

@ -60,15 +60,6 @@ interface Defaults
public const OTEL_EXPORTER_OTLP_PROTOCOL = 'http/protobuf';
public const OTEL_EXPORTER_OTLP_TRACES_PROTOCOL = 'http/protobuf';
public const OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = 'http/protobuf';
/**
* Jaeger Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#jaeger-exporter
*/
public const OTEL_EXPORTER_JAEGER_AGENT_HOST = 'localhost';
public const OTEL_EXPORTER_JAEGER_AGENT_PORT = 6831;
public const OTEL_EXPORTER_JAEGER_ENDPOINT = 'http://localhost:14250';
// Timeout (seconds)
public const OTEL_EXPORTER_JAEGER_TIMEOUT = 10;
/**
* Zipkin Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#zipkin-exporter

View File

@ -33,14 +33,12 @@ interface KnownValues
public const VALUE_PARENT_BASED_ALWAYS_ON = 'parentbased_always_on';
public const VALUE_PARENT_BASED_ALWAYS_OFF = 'parentbased_always_off';
public const VALUE_PARENT_BASED_TRACE_ID_RATIO = 'parentbased_traceidratio';
public const VALUE_JAEGER_REMOTE= 'jaeger_remote';
public const VALUE_GZIP = 'gzip';
public const VALUE_GRPC = 'grpc';
public const VALUE_HTTP_PROTOBUF = 'http/protobuf';
public const VALUE_HTTP_JSON = 'http/json';
public const VALUE_HTTP_NDJSON = 'http/ndjson';
public const VALUE_OTLP = 'otlp';
public const VALUE_JAEGER = 'jaeger';
public const VALUE_ZIPKIN = 'zipkin';
public const VALUE_NEWRELIC = 'newrelic';
public const VALUE_PROMETHEUS = 'prometheus';
@ -103,7 +101,6 @@ interface KnownValues
self::VALUE_PARENT_BASED_ALWAYS_ON,
self::VALUE_PARENT_BASED_ALWAYS_OFF,
self::VALUE_PARENT_BASED_TRACE_ID_RATIO,
self::VALUE_JAEGER_REMOTE,
self::VALUE_XRAY,
];
/**
@ -128,7 +125,6 @@ interface KnownValues
*/
public const OTEL_TRACES_EXPORTER = [
self::VALUE_OTLP,
self::VALUE_JAEGER,
self::VALUE_ZIPKIN,
self::VALUE_NEWRELIC,
self::VALUE_NONE,

View File

@ -76,16 +76,6 @@ interface ValueTypes
public const OTEL_EXPORTER_OTLP_PROTOCOL = VariableTypes::ENUM;
public const OTEL_EXPORTER_OTLP_TRACES_PROTOCOL = VariableTypes::ENUM;
public const OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = VariableTypes::ENUM;
/**
* Jaeger Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#jaeger-exporter
*/
public const OTEL_EXPORTER_JAEGER_AGENT_HOST = VariableTypes::STRING;
public const OTEL_EXPORTER_JAEGER_AGENT_PORT = VariableTypes::INTEGER;
public const OTEL_EXPORTER_JAEGER_ENDPOINT = VariableTypes::STRING;
public const OTEL_EXPORTER_JAEGER_TIMEOUT = VariableTypes::INTEGER;
public const OTEL_EXPORTER_JAEGER_USER = VariableTypes::STRING;
public const OTEL_EXPORTER_JAEGER_PASSWORD = VariableTypes::STRING;
/**
* Zipkin Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#zipkin-exporter

View File

@ -77,16 +77,6 @@ interface Variables
public const OTEL_EXPORTER_OTLP_PROTOCOL = 'OTEL_EXPORTER_OTLP_PROTOCOL';
public const OTEL_EXPORTER_OTLP_TRACES_PROTOCOL = 'OTEL_EXPORTER_OTLP_TRACES_PROTOCOL';
public const OTEL_EXPORTER_OTLP_METRICS_PROTOCOL = 'OTEL_EXPORTER_OTLP_METRICS_PROTOCOL';
/**
* Jaeger Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#jaeger-exporter
*/
public const OTEL_EXPORTER_JAEGER_AGENT_HOST = 'OTEL_EXPORTER_JAEGER_AGENT_HOST';
public const OTEL_EXPORTER_JAEGER_AGENT_PORT = 'OTEL_EXPORTER_JAEGER_AGENT_PORT';
public const OTEL_EXPORTER_JAEGER_ENDPOINT = 'OTEL_EXPORTER_JAEGER_ENDPOINT';
public const OTEL_EXPORTER_JAEGER_TIMEOUT = 'OTEL_EXPORTER_JAEGER_TIMEOUT';
public const OTEL_EXPORTER_JAEGER_USER = 'OTEL_EXPORTER_JAEGER_USER';
public const OTEL_EXPORTER_JAEGER_PASSWORD = 'OTEL_EXPORTER_JAEGER_PASSWORD';
/**
* Zipkin Exporter
* @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/sdk-environment-variables.md#zipkin-exporter

View File

@ -6,7 +6,9 @@ require __DIR__ . '/trace-context-handler.php';
use Nyholm\Psr7\Request;
use Nyholm\Psr7\Response;
use OpenTelemetry\Contrib\Jaeger\Exporter as JaegerExporter;
use OpenTelemetry\Contrib\Zipkin\Exporter as ZipkinExporter;
use OpenTelemetry\SDK\Common\Export\Http\PsrTransportFactory;
use OpenTelemetry\SDK\Common\Time\ClockFactory;
use OpenTelemetry\SDK\Trace\SpanProcessor\BatchSpanProcessor;
use OpenTelemetry\SDK\Trace\TracerProvider;
use Psr\Http\Client\ClientExceptionInterface;
@ -23,13 +25,10 @@ function main(): void
$tracer = (new TracerProvider(
[
new BatchSpanProcessor(
new JaegerExporter(
'W3C Trace-Context Test Service',
'http://localhost:9412/api/v2/spans',
$httpClient,
$httpClient,
$httpClient,
new ZipkinExporter(
PsrTransportFactory::discover()->create('http://zipkin:9412/api/v2/spans')
),
ClockFactory::getDefault()
),
],
))->getTracer('W3C Trace-Context Test Service');

View File

@ -1,29 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\Contrib\Jaeger\AgentExporter;
use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
use PHPUnit\Framework\TestCase;
/**
* @covers \OpenTelemetry\Contrib\Jaeger\AgentExporter
* @covers \OpenTelemetry\Contrib\Jaeger\JaegerTransport
* @covers \OpenTelemetry\Contrib\Jaeger\ThriftUdpTransport
* @covers \OpenTelemetry\Contrib\Jaeger\ParsedEndpointUrl
*/
class AgentExporterTest extends TestCase
{
public function test_happy_path()
{
$exporter = new AgentExporter('http://127.0.0.1:80');
$status = $exporter->export([new SpanData()])->await();
$this->assertTrue($status);
$exporter->closeAgentConnection();
}
}

View File

@ -1,56 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\Contrib\Jaeger\IdConverter;
use PHPUnit\Framework\TestCase;
/**
* @covers OpenTelemetry\Contrib\Jaeger\IdConverter
*/
class IdConverterTest extends TestCase
{
//Based on this section of the Jaeger spec https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/sdk_exporters/jaeger.md#ids
public function test_correctly_converts_example_from_spec()
{
$hex = 'FF00000000000000';
$this->assertEquals(-72057594037927936, IdConverter::convertOtelToJaegerSpanId($hex));
}
public function test_correctly_converts_random_span_id()
{
// 16 char hex string
$hex = bin2hex(random_bytes(8));
$this->assertEquals($hex, $this->dechexWithLeadingZeroes(IdConverter::convertOtelToJaegerSpanId($hex)));
}
public function test_correctly_converts_trace_id()
{
$hex = '0102030405060708090a0b0c0d0e0f10';
$traceId = IdConverter::convertOtelToJaegerTraceIds($hex);
$this->assertEquals(72623859790382856, $traceId['traceIdHigh']);
$this->assertEquals(651345242494996240, $traceId['traceIdLow']);
}
public function test_correctly_converts_random_trace_id()
{
// 32 char hex string
$hex = bin2hex(random_bytes(16));
$traceId = IdConverter::convertOtelToJaegerTraceIds($hex);
$convertedTraceId = $this->dechexWithLeadingZeroes($traceId['traceIdHigh']);
$convertedTraceId .= $this->dechexWithLeadingZeroes($traceId['traceIdLow']);
$this->assertEquals($hex, $convertedTraceId);
}
private function dechexWithLeadingZeroes(int $num)
{
return str_pad(dechex($num), 16, '0', STR_PAD_LEFT);
}
}

View File

@ -1,27 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\Contrib\Jaeger\Exporter;
use OpenTelemetry\SDK\Common\Export\TransportInterface;
use OpenTelemetry\Tests\Unit\SDK\Trace\SpanExporter\AbstractExporterTest;
/**
* @covers OpenTelemetry\Contrib\Jaeger\Exporter
*/
class JaegerExporterTest extends AbstractExporterTest
{
public function createExporterWithTransport(TransportInterface $transport): Exporter
{
return new Exporter(
$transport
);
}
public function getExporterClass(): string
{
return Exporter::class;
}
}

View File

@ -1,41 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\Contrib\Jaeger\HttpCollectorExporter;
use OpenTelemetry\Tests\Unit\Contrib\UsesHttpClientTrait;
use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
use PHPUnit\Framework\TestCase;
/**
* @covers \OpenTelemetry\Contrib\Jaeger\HttpCollectorExporter
* @covers \OpenTelemetry\Contrib\Jaeger\HttpSender
* @covers \OpenTelemetry\Contrib\Jaeger\ThriftHttpTransport
* @covers \OpenTelemetry\Contrib\Jaeger\ParsedEndpointUrl
* @covers \OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapter
* @covers \OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterFactory
*
*/
class JaegerHttpCollectorExporterTest extends TestCase
{
use UsesHttpClientTrait;
public function test_happy_path()
{
/**
* @psalm-suppress PossiblyInvalidArgument
*/
$exporter = new HttpCollectorExporter(
'https://hostOfJaegerCollector.com/post',
$this->getClientInterfaceMock(),
$this->getRequestFactoryInterfaceMock(),
$this->getStreamFactoryInterfaceMock()
);
$status = $exporter->export([new SpanData()])->await();
$this->assertTrue($status);
}
}

View File

@ -1,185 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterFactoryInterface;
use OpenTelemetry\Contrib\Jaeger\BatchAdapter\BatchAdapterInterface;
use OpenTelemetry\Contrib\Jaeger\HttpSender;
use OpenTelemetry\Contrib\Jaeger\ParsedEndpointUrl;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Resource\ResourceInfo;
use OpenTelemetry\SDK\Resource\ResourceInfoFactory;
use OpenTelemetry\SemConv\ResourceAttributes;
use OpenTelemetry\Tests\Unit\Contrib\UsesHttpClientTrait;
use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
use PHPUnit\Framework\TestCase;
use Thrift\Protocol\TProtocol;
/**
* @covers OpenTelemetry\Contrib\Jaeger\HttpSender
*/
class JaegerHttpSenderTest extends TestCase
{
use UsesHttpClientTrait;
private function createSenderAndMocks(array $inputs): array
{
[
'serviceName' => $serviceName
] = $inputs;
$mockBatchAdapterFactory = $this->createBatchAdapterFactoryMock();
/**
* @psalm-suppress PossiblyInvalidArgument
*/
$sender = new HttpSender(
$this->getClientInterfaceMock(),
$this->getRequestFactoryInterfaceMock(),
$this->getStreamFactoryInterfaceMock(),
$this->createParsedEndpointUrlMock(),
$mockBatchAdapterFactory
);
return [
'sender' => $sender,
'mockBatchAdapterFactory' => $mockBatchAdapterFactory,
];
}
private function createParsedEndpointUrlMock(): ParsedEndpointUrl
{
/** @var ParsedEndpointUrl */
$mock = $this->createMock(ParsedEndpointUrl::class);
return $mock;
}
private function createBatchAdapterFactoryMock(): BatchAdapterFactoryInterface
{
return new class() implements BatchAdapterFactoryInterface {
//Just enough spy functionality for what was needed for now. Generalize and extend as needed
private array $interceptedValues = [];
public function getInterceptedValues()
{
return $this->interceptedValues;
}
public function create(array $values): BatchAdapterInterface
{
$this->interceptedValues[] = $values;
$mockBatchAdapter = new class() implements BatchAdapterInterface {
public function write(TProtocol $output): void
{
}
};
return $mockBatchAdapter;
}
};
}
public function test_span_and_process_data_are_batched_by_resource(): void
{
[
'sender' => $sender,
'mockBatchAdapterFactory' => $mockBatchAdapterFactory
] = $this->createSenderAndMocks([
'serviceName' => 'nameOfThe1stLogicalApp',
]);
$spans = [
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([]), //code should default service.name from how its set above
)),
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([
'service.name' => 'nameOfThe2ndLogicalApp',
]),
)),
];
$sender->send($spans);
$interceptedValues = $mockBatchAdapterFactory->getInterceptedValues();
$this->assertSame(2, count($interceptedValues));
//1st batch
$this->assertSame(1, count($interceptedValues[0]['spans'])); //Detailed tests for the span conversion live elsewhere
//2nd batch
$this->assertSame(1, count($interceptedValues[1]['spans'])); //Detailed tests for the span conversion live elsewhere
}
public function test_process_service_names_are_correctly_set_from_resource_attributes_or_the_default_service_name(): void
{
[
'sender' => $sender,
'mockBatchAdapterFactory' => $mockBatchAdapterFactory
] = $this->createSenderAndMocks([
'serviceName' => 'nameOfThe1stLogicalApp',
]);
$spans = [
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([]), //code should default service.name from how its set above
)),
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([
'service.name' => 'nameOfThe2ndLogicalApp',
]),
)),
];
$sender->send($spans);
$interceptedValues = $mockBatchAdapterFactory->getInterceptedValues();
//1st batch
$this->assertSame(
ResourceInfoFactory::defaultResource()->getAttributes()->get(ResourceAttributes::SERVICE_NAME),
$interceptedValues[0]['process']->serviceName
);
//2nd batch
$this->assertSame('nameOfThe2ndLogicalApp', $interceptedValues[1]['process']->serviceName);
}
public function test_tags_are_correctly_set_from_resource_attributes(): void
{
[
'sender' => $sender,
'mockBatchAdapterFactory' => $mockBatchAdapterFactory
] = $this->createSenderAndMocks([
'serviceName' => 'someServiceName',
]);
$spans = [
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([]),
)),
(new SpanData())->setResource(ResourceInfo::create(
Attributes::create([
'telemetry.sdk.name' => 'opentelemetry',
]),
)),
];
$sender->send($spans);
$interceptedValues = $mockBatchAdapterFactory->getInterceptedValues();
//1st batch
$this->assertSame(0, count($interceptedValues[0]['process']->tags));
//2nd batch
$this->assertSame(1, count($interceptedValues[1]['process']->tags));
$this->assertSame('telemetry.sdk.name', $interceptedValues[1]['process']->tags[0]->key);
$this->assertSame('opentelemetry', $interceptedValues[1]['process']->tags[0]->vStr);
}
}

View File

@ -1,237 +0,0 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Unit\Contrib\Jaeger;
use OpenTelemetry\API\Trace\SpanContext;
use OpenTelemetry\API\Trace\SpanKind;
use OpenTelemetry\API\Trace\StatusCode;
use OpenTelemetry\Contrib\Jaeger\SpanConverter;
use OpenTelemetry\SDK\Common\Attribute\Attributes;
use OpenTelemetry\SDK\Common\Instrumentation\InstrumentationScope;
use OpenTelemetry\SDK\Resource\ResourceInfo;
use OpenTelemetry\SDK\Trace\Event;
use OpenTelemetry\SDK\Trace\Link;
use OpenTelemetry\SDK\Trace\StatusData;
use OpenTelemetry\Tests\Unit\SDK\Util\SpanData;
use PHPUnit\Framework\TestCase;
/**
* @covers OpenTelemetry\Contrib\Jaeger\SpanConverter
* @covers OpenTelemetry\Contrib\Jaeger\IdConverter
* @covers OpenTelemetry\Contrib\Jaeger\TagFactory\TagFactory
*/
class JaegerSpanConverterTest extends TestCase
{
public function test_should_convert_an_otel_span_to_a_jaeger_thrift_span()
{
$span = (new SpanData())
->setName('otelSpanName');
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame(0, $convertedSpan->traceIdLow);
$this->assertSame(0, $convertedSpan->traceIdHigh);
$this->assertSame(0, $convertedSpan->spanId);
$this->assertSame(0, $convertedSpan->parentSpanId);
$this->assertSame('otelSpanName', $convertedSpan->operationName);
$this->assertSame([], $convertedSpan->references);
$this->assertSame(0, $convertedSpan->flags);
$this->assertSame(1505855794194009, $convertedSpan->startTime);
$this->assertSame(5271716, $convertedSpan->duration);
//See test below for structure of $convertedSpan->tags
$this->assertSame([], $convertedSpan->logs);
}
public function test_should_correctly_generate_jaeger_thrift_tags()
{
$span = (new SpanData())
->setStatus(
new StatusData(
StatusCode::STATUS_OK,
'status_description'
)
)
->setInstrumentationScope(new InstrumentationScope(
'instrumentation_scope_name',
'instrumentation_scope_version',
null,
Attributes::create([]),
))
->addAttribute('keyForBoolean', true)
->addAttribute('keyForArray', ['1stElement', '2ndElement', true])
->addAttribute('keyForInteger', 123)
->addAttribute('keyForFloat', 1.00)
->setResource(
ResourceInfo::create(
Attributes::create([
'telemetry.sdk.name' => 'opentelemetry',
'telemetry.sdk.language' => 'php',
'telemetry.sdk.version' => 'dev',
'instance' => 'test-a',
'service.name' => 'unknown_service:php',
])
)
);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame('otel.status_code', $convertedSpan->tags[0]->key);
$this->assertSame('OK', $convertedSpan->tags[0]->vStr);
$this->assertSame('otel.status_description', $convertedSpan->tags[1]->key);
$this->assertSame('status_description', $convertedSpan->tags[1]->vStr);
$this->assertSame('otel.scope.name', $convertedSpan->tags[2]->key);
$this->assertSame('instrumentation_scope_name', $convertedSpan->tags[2]->vStr);
$this->assertSame('otel.scope.version', $convertedSpan->tags[3]->key);
$this->assertSame('instrumentation_scope_version', $convertedSpan->tags[3]->vStr);
$this->assertSame('keyForBoolean', $convertedSpan->tags[4]->key);
$this->assertTrue($convertedSpan->tags[4]->vBool);
$this->assertSame('keyForArray', $convertedSpan->tags[5]->key);
$this->assertSame('1stElement,2ndElement,true', $convertedSpan->tags[5]->vStr);
$this->assertSame('keyForInteger', $convertedSpan->tags[6]->key);
$this->assertSame(123, $convertedSpan->tags[6]->vLong);
$this->assertSame('keyForFloat', $convertedSpan->tags[7]->key);
$this->assertSame(1.00, $convertedSpan->tags[7]->vDouble);
$this->assertSame('telemetry.sdk.name', $convertedSpan->tags[8]->key);
$this->assertSame('opentelemetry', $convertedSpan->tags[8]->vStr);
$this->assertSame('telemetry.sdk.language', $convertedSpan->tags[9]->key);
$this->assertSame('php', $convertedSpan->tags[9]->vStr);
$this->assertSame('telemetry.sdk.version', $convertedSpan->tags[10]->key);
$this->assertSame('dev', $convertedSpan->tags[10]->vStr);
$this->assertSame('instance', $convertedSpan->tags[11]->key);
$this->assertSame('test-a', $convertedSpan->tags[11]->vStr);
$this->assertSame('service.name', $convertedSpan->tags[12]->key);
$this->assertSame('unknown_service:php', $convertedSpan->tags[12]->vStr);
}
public function test_should_correctly_convert_error_status_to_jaeger_thrift_tags()
{
$span = (new SpanData())
->setStatus(
new StatusData(
StatusCode::STATUS_ERROR,
''
)
);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame('error', $convertedSpan->tags[0]->key);
$this->assertTrue($convertedSpan->tags[0]->vBool);
$this->assertSame('otel.status_code', $convertedSpan->tags[1]->key);
$this->assertSame('ERROR', $convertedSpan->tags[1]->vStr);
}
/**
* @dataProvider provideSpanKindInputsAndExpectations
*/
public function test_should_correctly_convert_span_kind_to_jaeger_thrift_tags(int $spanKindInput, string $expectedJaegerTagValue)
{
$span = (new SpanData())
->setKind($spanKindInput);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame('span.kind', $convertedSpan->tags[0]->key);
$this->assertSame($expectedJaegerTagValue, $convertedSpan->tags[0]->vStr);
}
public function provideSpanKindInputsAndExpectations()
{
yield [SpanKind::KIND_CLIENT, 'client'];
yield [SpanKind::KIND_SERVER, 'server'];
yield [SpanKind::KIND_CONSUMER, 'consumer'];
yield [SpanKind::KIND_PRODUCER, 'producer'];
}
public function test_span_kind_internal_should_not_create_jaeger_thrift_tag()
{
$span = (new SpanData())
->setKind(SpanKind::KIND_INTERNAL);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertCount(0, $convertedSpan->tags);
}
public function test_should_correctly_convert_span_event_to_jaeger_log()
{
$span = (new SpanData())
->setEvents(
[
new Event(
'eventName',
1505855794194009601,
Attributes::create([
'eventAttributeKey' => 'eventAttributeValue',
])
),
]
);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame(1505855794194009, $convertedSpan->logs[0]->timestamp);
$this->assertSame('eventAttributeKey', $convertedSpan->logs[0]->fields[0]->key);
$this->assertSame('eventAttributeValue', $convertedSpan->logs[0]->fields[0]->vStr);
$this->assertSame('event', $convertedSpan->logs[0]->fields[1]->key);
$this->assertSame('eventName', $convertedSpan->logs[0]->fields[1]->vStr);
}
public function test_should_use_event_attribute_from_event_if_present_for_jaeger_log()
{
$span = (new SpanData())
->setEvents(
[
new Event(
'eventName',
1505855794194009601,
Attributes::create([
'event' => 'valueForTheEventAttributeOnTheEvent',
])
),
]
);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame(1505855794194009, $convertedSpan->logs[0]->timestamp);
$this->assertSame('event', $convertedSpan->logs[0]->fields[0]->key);
$this->assertSame('valueForTheEventAttributeOnTheEvent', $convertedSpan->logs[0]->fields[0]->vStr);
}
public function test_should_correctly_convert_span_link_to_jaeger_span_reference()
{
$span = (new SpanData())
->setLinks(
[
new Link(
SpanContext::getInvalid(),
Attributes::create([]),
),
]
);
[$convertedSpan] = (new SpanConverter())->convert([$span]);
$this->assertSame(1, $convertedSpan->references[0]->refType);
$this->assertSame(0, $convertedSpan->references[0]->traceIdLow);
$this->assertSame(0, $convertedSpan->references[0]->traceIdHigh);
$this->assertSame(0, $convertedSpan->references[0]->spanId);
}
}

View File

@ -43,7 +43,7 @@ class ConfigurationTest extends TestCase
private const TYPES = [
VariableTypes::STRING => [Variables::OTEL_SERVICE_NAME],
VariableTypes::BOOL => [Variables::OTEL_EXPORTER_OTLP_INSECURE],
VariableTypes::INTEGER => [Variables::OTEL_EXPORTER_JAEGER_AGENT_PORT],
VariableTypes::INTEGER => [Variables::OTEL_BSP_MAX_QUEUE_SIZE],
VariableTypes::ENUM => [Variables::OTEL_LOG_LEVEL],
VariableTypes::LIST => [Variables::OTEL_PROPAGATORS],
VariableTypes::MAP => [Variables::OTEL_RESOURCE_ATTRIBUTES],
@ -73,7 +73,7 @@ class ConfigurationTest extends TestCase
private const LIBRARY_DEFAULTS = [
VariableTypes::STRING => [Variables::OTEL_EXPORTER_OTLP_ENDPOINT, 'http://localhost:4318'],
VariableTypes::BOOL => [Variables::OTEL_EXPORTER_OTLP_INSECURE, false],
VariableTypes::INTEGER => [Variables::OTEL_EXPORTER_JAEGER_AGENT_PORT, 6831],
VariableTypes::INTEGER => [Variables::OTEL_BSP_MAX_QUEUE_SIZE, 2048],
VariableTypes::ENUM => [Variables::OTEL_LOG_LEVEL, 'info'],
VariableTypes::LIST => [Variables::OTEL_PROPAGATORS, ['tracecontext', 'baggage']],
];
@ -416,7 +416,7 @@ class ConfigurationTest extends TestCase
return [
'bool' => ['OTEL_EXPORTER_OTLP_INSECURE', VariableTypes::BOOL],
'string' => ['OTEL_SERVICE_NAME', VariableTypes::STRING],
'integer' => ['OTEL_EXPORTER_JAEGER_AGENT_PORT', VariableTypes::INTEGER],
'integer' => ['OTEL_BSP_MAX_QUEUE_SIZE', VariableTypes::INTEGER],
'enum' => ['OTEL_LOG_LEVEL', VariableTypes::ENUM],
'list' => ['OTEL_PROPAGATORS', VariableTypes::LIST],
'map' => ['OTEL_RESOURCE_ATTRIBUTES', VariableTypes::MAP],

View File

@ -107,7 +107,6 @@ class ExporterFactoryTest extends TestCase
public function invalidEnvProvider(): array
{
return [
'jaeger' => ['jaeger'],
'newrelic' => ['newrelic'],
'zipkintonewrelic' => ['zipkintonewrelic'],
'otlp+invalid protocol' => [
@ -115,7 +114,7 @@ class ExporterFactoryTest extends TestCase
['OTEL_EXPORTER_OTLP_PROTOCOL' => 'foo'],
],
'unknown exporter' => ['foo'],
'multiple exporters' => ['jaeger,zipkin'],
'multiple exporters' => ['newrelic,zipkin'],
];
}
}

View File

@ -1,86 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class AgentClient implements \Jaeger\Thrift\Agent\AgentIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function emitZipkinBatch(array $spans)
{
$this->send_emitZipkinBatch($spans);
}
public function send_emitZipkinBatch(array $spans)
{
$args = new \Jaeger\Thrift\Agent\Agent_emitZipkinBatch_args();
$args->spans = $spans;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'emitZipkinBatch',
TMessageType::ONEWAY,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('emitZipkinBatch', TMessageType::ONEWAY, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function emitBatch(\Jaeger\Thrift\Batch $batch)
{
$this->send_emitBatch($batch);
}
public function send_emitBatch(\Jaeger\Thrift\Batch $batch)
{
$args = new \Jaeger\Thrift\Agent\Agent_emitBatch_args();
$args->batch = $batch;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'emitBatch',
TMessageType::ONEWAY,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('emitBatch', TMessageType::ONEWAY, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
}

View File

@ -1,29 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface AgentIf
{
/**
* @param \Jaeger\Thrift\Agent\Zipkin\Span[] $spans
*/
public function emitZipkinBatch(array $spans);
/**
* @param \Jaeger\Thrift\Batch $batch
*/
public function emitBatch(\Jaeger\Thrift\Batch $batch);
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Agent_emitBatch_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'batch',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Batch',
),
);
/**
* @var \Jaeger\Thrift\Batch
*/
public $batch = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['batch'])) {
$this->batch = $vals['batch'];
}
}
}
public function getName()
{
return 'Agent_emitBatch_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRUCT) {
$this->batch = new \Jaeger\Thrift\Batch();
$xfer += $this->batch->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Agent_emitBatch_args');
if ($this->batch !== null) {
if (!is_object($this->batch)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('batch', TType::STRUCT, 1);
$xfer += $this->batch->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Agent_emitZipkinBatch_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'spans',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Span',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\Zipkin\Span[]
*/
public $spans = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['spans'])) {
$this->spans = $vals['spans'];
}
}
}
public function getName()
{
return 'Agent_emitZipkinBatch_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::LST) {
$this->spans = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\Zipkin\Span();
$xfer += $elem5->read($input);
$this->spans []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Agent_emitZipkinBatch_args');
if ($this->spans !== null) {
if (!is_array($this->spans)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('spans', TType::LST, 1);
$output->writeListBegin(TType::STRUCT, count($this->spans));
foreach ($this->spans as $iter6) {
$xfer += $iter6->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class AggregationValidatorClient implements \Jaeger\Thrift\Agent\AggregationValidatorIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function validateTrace($traceId)
{
$this->send_validateTrace($traceId);
return $this->recv_validateTrace();
}
public function send_validateTrace($traceId)
{
$args = new \Jaeger\Thrift\Agent\AggregationValidator_validateTrace_args();
$args->traceId = $traceId;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'validateTrace',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('validateTrace', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_validateTrace()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\AggregationValidator_validateTrace_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\AggregationValidator_validateTrace_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("validateTrace failed: unknown result");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface AggregationValidatorIf
{
/**
* @param string $traceId
* @return \Jaeger\Thrift\Agent\ValidateTraceResponse
*/
public function validateTrace($traceId);
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class AggregationValidator_validateTrace_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'traceId',
'isRequired' => true,
'type' => TType::STRING,
),
);
/**
* @var string
*/
public $traceId = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['traceId'])) {
$this->traceId = $vals['traceId'];
}
}
}
public function getName()
{
return 'AggregationValidator_validateTrace_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->traceId);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('AggregationValidator_validateTrace_args');
if ($this->traceId !== null) {
$xfer += $output->writeFieldBegin('traceId', TType::STRING, 1);
$xfer += $output->writeString($this->traceId);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class AggregationValidator_validateTrace_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ValidateTraceResponse',
),
);
/**
* @var \Jaeger\Thrift\Agent\ValidateTraceResponse
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'AggregationValidator_validateTrace_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::STRUCT) {
$this->success = new \Jaeger\Thrift\Agent\ValidateTraceResponse();
$xfer += $this->success->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('AggregationValidator_validateTrace_result');
if ($this->success !== null) {
if (!is_object($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
$xfer += $this->success->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,118 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class BaggageRestriction
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'baggageKey',
'isRequired' => true,
'type' => TType::STRING,
),
2 => array(
'var' => 'maxValueLength',
'isRequired' => true,
'type' => TType::I32,
),
);
/**
* @var string
*/
public $baggageKey = null;
/**
* @var int
*/
public $maxValueLength = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['baggageKey'])) {
$this->baggageKey = $vals['baggageKey'];
}
if (isset($vals['maxValueLength'])) {
$this->maxValueLength = $vals['maxValueLength'];
}
}
}
public function getName()
{
return 'BaggageRestriction';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->baggageKey);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->maxValueLength);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('BaggageRestriction');
if ($this->baggageKey !== null) {
$xfer += $output->writeFieldBegin('baggageKey', TType::STRING, 1);
$xfer += $output->writeString($this->baggageKey);
$xfer += $output->writeFieldEnd();
}
if ($this->maxValueLength !== null) {
$xfer += $output->writeFieldBegin('maxValueLength', TType::I32, 2);
$xfer += $output->writeI32($this->maxValueLength);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class BaggageRestrictionManagerClient implements \Jaeger\Thrift\Agent\BaggageRestrictionManagerIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function getBaggageRestrictions($serviceName)
{
$this->send_getBaggageRestrictions($serviceName);
return $this->recv_getBaggageRestrictions();
}
public function send_getBaggageRestrictions($serviceName)
{
$args = new \Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_args();
$args->serviceName = $serviceName;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'getBaggageRestrictions',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('getBaggageRestrictions', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_getBaggageRestrictions()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\BaggageRestrictionManager_getBaggageRestrictions_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("getBaggageRestrictions failed: unknown result");
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface BaggageRestrictionManagerIf
{
/**
* getBaggageRestrictions retrieves the baggage restrictions for a specific service.
* Usually, baggageRestrictions apply to all services however there may be situations
* where a baggageKey might only be allowed to be set by a specific service.
*
* @param string $serviceName
* @return \Jaeger\Thrift\Agent\BaggageRestriction[]
*/
public function getBaggageRestrictions($serviceName);
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class BaggageRestrictionManager_getBaggageRestrictions_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'serviceName',
'isRequired' => false,
'type' => TType::STRING,
),
);
/**
* @var string
*/
public $serviceName = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['serviceName'])) {
$this->serviceName = $vals['serviceName'];
}
}
}
public function getName()
{
return 'BaggageRestrictionManager_getBaggageRestrictions_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->serviceName);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('BaggageRestrictionManager_getBaggageRestrictions_args');
if ($this->serviceName !== null) {
$xfer += $output->writeFieldBegin('serviceName', TType::STRING, 1);
$xfer += $output->writeString($this->serviceName);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class BaggageRestrictionManager_getBaggageRestrictions_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\BaggageRestriction',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\BaggageRestriction[]
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'BaggageRestrictionManager_getBaggageRestrictions_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::LST) {
$this->success = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\BaggageRestriction();
$xfer += $elem5->read($input);
$this->success []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('BaggageRestrictionManager_getBaggageRestrictions_result');
if ($this->success !== null) {
if (!is_array($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::LST, 0);
$output->writeListBegin(TType::STRUCT, count($this->success));
foreach ($this->success as $iter6) {
$xfer += $iter6->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Dependencies
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'links',
'isRequired' => true,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\DependencyLink',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\DependencyLink[]
*/
public $links = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['links'])) {
$this->links = $vals['links'];
}
}
}
public function getName()
{
return 'Dependencies';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::LST) {
$this->links = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\DependencyLink();
$xfer += $elem5->read($input);
$this->links []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Dependencies');
if ($this->links !== null) {
if (!is_array($this->links)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('links', TType::LST, 1);
$output->writeListBegin(TType::STRUCT, count($this->links));
foreach ($this->links as $iter6) {
$xfer += $iter6->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,118 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class DependencyClient implements \Jaeger\Thrift\Agent\DependencyIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function getDependenciesForTrace($traceId)
{
$this->send_getDependenciesForTrace($traceId);
return $this->recv_getDependenciesForTrace();
}
public function send_getDependenciesForTrace($traceId)
{
$args = new \Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_args();
$args->traceId = $traceId;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'getDependenciesForTrace',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('getDependenciesForTrace', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_getDependenciesForTrace()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\Dependency_getDependenciesForTrace_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("getDependenciesForTrace failed: unknown result");
}
public function saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies)
{
$this->send_saveDependencies($dependencies);
}
public function send_saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies)
{
$args = new \Jaeger\Thrift\Agent\Dependency_saveDependencies_args();
$args->dependencies = $dependencies;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'saveDependencies',
TMessageType::ONEWAY,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('saveDependencies', TMessageType::ONEWAY, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface DependencyIf
{
/**
* @param string $traceId
* @return \Jaeger\Thrift\Agent\Dependencies
*/
public function getDependenciesForTrace($traceId);
/**
* @param \Jaeger\Thrift\Agent\Dependencies $dependencies
*/
public function saveDependencies(\Jaeger\Thrift\Agent\Dependencies $dependencies);
}

View File

@ -1,142 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class DependencyLink
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'parent',
'isRequired' => true,
'type' => TType::STRING,
),
2 => array(
'var' => 'child',
'isRequired' => true,
'type' => TType::STRING,
),
4 => array(
'var' => 'callCount',
'isRequired' => true,
'type' => TType::I64,
),
);
/**
* @var string
*/
public $parent = null;
/**
* @var string
*/
public $child = null;
/**
* @var int
*/
public $callCount = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['parent'])) {
$this->parent = $vals['parent'];
}
if (isset($vals['child'])) {
$this->child = $vals['child'];
}
if (isset($vals['callCount'])) {
$this->callCount = $vals['callCount'];
}
}
}
public function getName()
{
return 'DependencyLink';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->parent);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->child);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->callCount);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('DependencyLink');
if ($this->parent !== null) {
$xfer += $output->writeFieldBegin('parent', TType::STRING, 1);
$xfer += $output->writeString($this->parent);
$xfer += $output->writeFieldEnd();
}
if ($this->child !== null) {
$xfer += $output->writeFieldBegin('child', TType::STRING, 2);
$xfer += $output->writeString($this->child);
$xfer += $output->writeFieldEnd();
}
if ($this->callCount !== null) {
$xfer += $output->writeFieldBegin('callCount', TType::I64, 4);
$xfer += $output->writeI64($this->callCount);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Dependency_getDependenciesForTrace_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'traceId',
'isRequired' => true,
'type' => TType::STRING,
),
);
/**
* @var string
*/
public $traceId = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['traceId'])) {
$this->traceId = $vals['traceId'];
}
}
}
public function getName()
{
return 'Dependency_getDependenciesForTrace_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->traceId);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Dependency_getDependenciesForTrace_args');
if ($this->traceId !== null) {
$xfer += $output->writeFieldBegin('traceId', TType::STRING, 1);
$xfer += $output->writeString($this->traceId);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Dependency_getDependenciesForTrace_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Dependencies',
),
);
/**
* @var \Jaeger\Thrift\Agent\Dependencies
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'Dependency_getDependenciesForTrace_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::STRUCT) {
$this->success = new \Jaeger\Thrift\Agent\Dependencies();
$xfer += $this->success->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Dependency_getDependenciesForTrace_result');
if ($this->success !== null) {
if (!is_object($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
$xfer += $this->success->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Dependency_saveDependencies_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'dependencies',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Dependencies',
),
);
/**
* @var \Jaeger\Thrift\Agent\Dependencies
*/
public $dependencies = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['dependencies'])) {
$this->dependencies = $vals['dependencies'];
}
}
}
public function getName()
{
return 'Dependency_saveDependencies_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRUCT) {
$this->dependencies = new \Jaeger\Thrift\Agent\Dependencies();
$xfer += $this->dependencies->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Dependency_saveDependencies_args');
if ($this->dependencies !== null) {
if (!is_object($this->dependencies)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('dependencies', TType::STRUCT, 1);
$xfer += $this->dependencies->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,123 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class OperationSamplingStrategy
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'operation',
'isRequired' => true,
'type' => TType::STRING,
),
2 => array(
'var' => 'probabilisticSampling',
'isRequired' => true,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy',
),
);
/**
* @var string
*/
public $operation = null;
/**
* @var \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy
*/
public $probabilisticSampling = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['operation'])) {
$this->operation = $vals['operation'];
}
if (isset($vals['probabilisticSampling'])) {
$this->probabilisticSampling = $vals['probabilisticSampling'];
}
}
}
public function getName()
{
return 'OperationSamplingStrategy';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->operation);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRUCT) {
$this->probabilisticSampling = new \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy();
$xfer += $this->probabilisticSampling->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('OperationSamplingStrategy');
if ($this->operation !== null) {
$xfer += $output->writeFieldBegin('operation', TType::STRING, 1);
$xfer += $output->writeString($this->operation);
$xfer += $output->writeFieldEnd();
}
if ($this->probabilisticSampling !== null) {
if (!is_object($this->probabilisticSampling)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('probabilisticSampling', TType::STRUCT, 2);
$xfer += $this->probabilisticSampling->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,188 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class PerOperationSamplingStrategies
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'defaultSamplingProbability',
'isRequired' => true,
'type' => TType::DOUBLE,
),
2 => array(
'var' => 'defaultLowerBoundTracesPerSecond',
'isRequired' => true,
'type' => TType::DOUBLE,
),
3 => array(
'var' => 'perOperationStrategies',
'isRequired' => true,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\OperationSamplingStrategy',
),
),
4 => array(
'var' => 'defaultUpperBoundTracesPerSecond',
'isRequired' => false,
'type' => TType::DOUBLE,
),
);
/**
* @var double
*/
public $defaultSamplingProbability = null;
/**
* @var double
*/
public $defaultLowerBoundTracesPerSecond = null;
/**
* @var \Jaeger\Thrift\Agent\OperationSamplingStrategy[]
*/
public $perOperationStrategies = null;
/**
* @var double
*/
public $defaultUpperBoundTracesPerSecond = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['defaultSamplingProbability'])) {
$this->defaultSamplingProbability = $vals['defaultSamplingProbability'];
}
if (isset($vals['defaultLowerBoundTracesPerSecond'])) {
$this->defaultLowerBoundTracesPerSecond = $vals['defaultLowerBoundTracesPerSecond'];
}
if (isset($vals['perOperationStrategies'])) {
$this->perOperationStrategies = $vals['perOperationStrategies'];
}
if (isset($vals['defaultUpperBoundTracesPerSecond'])) {
$this->defaultUpperBoundTracesPerSecond = $vals['defaultUpperBoundTracesPerSecond'];
}
}
}
public function getName()
{
return 'PerOperationSamplingStrategies';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->defaultSamplingProbability);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->defaultLowerBoundTracesPerSecond);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::LST) {
$this->perOperationStrategies = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\OperationSamplingStrategy();
$xfer += $elem5->read($input);
$this->perOperationStrategies []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->defaultUpperBoundTracesPerSecond);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('PerOperationSamplingStrategies');
if ($this->defaultSamplingProbability !== null) {
$xfer += $output->writeFieldBegin('defaultSamplingProbability', TType::DOUBLE, 1);
$xfer += $output->writeDouble($this->defaultSamplingProbability);
$xfer += $output->writeFieldEnd();
}
if ($this->defaultLowerBoundTracesPerSecond !== null) {
$xfer += $output->writeFieldBegin('defaultLowerBoundTracesPerSecond', TType::DOUBLE, 2);
$xfer += $output->writeDouble($this->defaultLowerBoundTracesPerSecond);
$xfer += $output->writeFieldEnd();
}
if ($this->perOperationStrategies !== null) {
if (!is_array($this->perOperationStrategies)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('perOperationStrategies', TType::LST, 3);
$output->writeListBegin(TType::STRUCT, count($this->perOperationStrategies));
foreach ($this->perOperationStrategies as $iter6) {
$xfer += $iter6->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
if ($this->defaultUpperBoundTracesPerSecond !== null) {
$xfer += $output->writeFieldBegin('defaultUpperBoundTracesPerSecond', TType::DOUBLE, 4);
$xfer += $output->writeDouble($this->defaultUpperBoundTracesPerSecond);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ProbabilisticSamplingStrategy
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'samplingRate',
'isRequired' => true,
'type' => TType::DOUBLE,
),
);
/**
* @var double
*/
public $samplingRate = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['samplingRate'])) {
$this->samplingRate = $vals['samplingRate'];
}
}
}
public function getName()
{
return 'ProbabilisticSamplingStrategy';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->samplingRate);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ProbabilisticSamplingStrategy');
if ($this->samplingRate !== null) {
$xfer += $output->writeFieldBegin('samplingRate', TType::DOUBLE, 1);
$xfer += $output->writeDouble($this->samplingRate);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class RateLimitingSamplingStrategy
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'maxTracesPerSecond',
'isRequired' => true,
'type' => TType::I16,
),
);
/**
* @var int
*/
public $maxTracesPerSecond = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['maxTracesPerSecond'])) {
$this->maxTracesPerSecond = $vals['maxTracesPerSecond'];
}
}
}
public function getName()
{
return 'RateLimitingSamplingStrategy';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I16) {
$xfer += $input->readI16($this->maxTracesPerSecond);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('RateLimitingSamplingStrategy');
if ($this->maxTracesPerSecond !== null) {
$xfer += $output->writeFieldBegin('maxTracesPerSecond', TType::I16, 1);
$xfer += $output->writeI16($this->maxTracesPerSecond);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class SamplingManagerClient implements \Jaeger\Thrift\Agent\SamplingManagerIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function getSamplingStrategy($serviceName)
{
$this->send_getSamplingStrategy($serviceName);
return $this->recv_getSamplingStrategy();
}
public function send_getSamplingStrategy($serviceName)
{
$args = new \Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_args();
$args->serviceName = $serviceName;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'getSamplingStrategy',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('getSamplingStrategy', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_getSamplingStrategy()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\SamplingManager_getSamplingStrategy_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("getSamplingStrategy failed: unknown result");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface SamplingManagerIf
{
/**
* @param string $serviceName
* @return \Jaeger\Thrift\Agent\SamplingStrategyResponse
*/
public function getSamplingStrategy($serviceName);
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class SamplingManager_getSamplingStrategy_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'serviceName',
'isRequired' => false,
'type' => TType::STRING,
),
);
/**
* @var string
*/
public $serviceName = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['serviceName'])) {
$this->serviceName = $vals['serviceName'];
}
}
}
public function getName()
{
return 'SamplingManager_getSamplingStrategy_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->serviceName);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('SamplingManager_getSamplingStrategy_args');
if ($this->serviceName !== null) {
$xfer += $output->writeFieldBegin('serviceName', TType::STRING, 1);
$xfer += $output->writeString($this->serviceName);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class SamplingManager_getSamplingStrategy_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\SamplingStrategyResponse',
),
);
/**
* @var \Jaeger\Thrift\Agent\SamplingStrategyResponse
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'SamplingManager_getSamplingStrategy_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::STRUCT) {
$this->success = new \Jaeger\Thrift\Agent\SamplingStrategyResponse();
$xfer += $this->success->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('SamplingManager_getSamplingStrategy_result');
if ($this->success !== null) {
if (!is_object($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
$xfer += $this->success->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,181 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class SamplingStrategyResponse
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'strategyType',
'isRequired' => true,
'type' => TType::I32,
),
2 => array(
'var' => 'probabilisticSampling',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy',
),
3 => array(
'var' => 'rateLimitingSampling',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\RateLimitingSamplingStrategy',
),
4 => array(
'var' => 'operationSampling',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\PerOperationSamplingStrategies',
),
);
/**
* @var int
*/
public $strategyType = null;
/**
* @var \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy
*/
public $probabilisticSampling = null;
/**
* @var \Jaeger\Thrift\Agent\RateLimitingSamplingStrategy
*/
public $rateLimitingSampling = null;
/**
* @var \Jaeger\Thrift\Agent\PerOperationSamplingStrategies
*/
public $operationSampling = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['strategyType'])) {
$this->strategyType = $vals['strategyType'];
}
if (isset($vals['probabilisticSampling'])) {
$this->probabilisticSampling = $vals['probabilisticSampling'];
}
if (isset($vals['rateLimitingSampling'])) {
$this->rateLimitingSampling = $vals['rateLimitingSampling'];
}
if (isset($vals['operationSampling'])) {
$this->operationSampling = $vals['operationSampling'];
}
}
}
public function getName()
{
return 'SamplingStrategyResponse';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->strategyType);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRUCT) {
$this->probabilisticSampling = new \Jaeger\Thrift\Agent\ProbabilisticSamplingStrategy();
$xfer += $this->probabilisticSampling->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::STRUCT) {
$this->rateLimitingSampling = new \Jaeger\Thrift\Agent\RateLimitingSamplingStrategy();
$xfer += $this->rateLimitingSampling->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRUCT) {
$this->operationSampling = new \Jaeger\Thrift\Agent\PerOperationSamplingStrategies();
$xfer += $this->operationSampling->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('SamplingStrategyResponse');
if ($this->strategyType !== null) {
$xfer += $output->writeFieldBegin('strategyType', TType::I32, 1);
$xfer += $output->writeI32($this->strategyType);
$xfer += $output->writeFieldEnd();
}
if ($this->probabilisticSampling !== null) {
if (!is_object($this->probabilisticSampling)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('probabilisticSampling', TType::STRUCT, 2);
$xfer += $this->probabilisticSampling->write($output);
$xfer += $output->writeFieldEnd();
}
if ($this->rateLimitingSampling !== null) {
if (!is_object($this->rateLimitingSampling)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('rateLimitingSampling', TType::STRUCT, 3);
$xfer += $this->rateLimitingSampling->write($output);
$xfer += $output->writeFieldEnd();
}
if ($this->operationSampling !== null) {
if (!is_object($this->operationSampling)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('operationSampling', TType::STRUCT, 4);
$xfer += $this->operationSampling->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,30 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
final class SamplingStrategyType
{
const PROBABILISTIC = 0;
const RATE_LIMITING = 1;
static public $__names = array(
0 => 'PROBABILISTIC',
1 => 'RATE_LIMITING',
);
}

View File

@ -1,123 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ServiceThrottlingConfig
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'serviceName',
'isRequired' => true,
'type' => TType::STRING,
),
2 => array(
'var' => 'config',
'isRequired' => true,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ThrottlingConfig',
),
);
/**
* @var string
*/
public $serviceName = null;
/**
* @var \Jaeger\Thrift\Agent\ThrottlingConfig
*/
public $config = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['serviceName'])) {
$this->serviceName = $vals['serviceName'];
}
if (isset($vals['config'])) {
$this->config = $vals['config'];
}
}
}
public function getName()
{
return 'ServiceThrottlingConfig';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->serviceName);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRUCT) {
$this->config = new \Jaeger\Thrift\Agent\ThrottlingConfig();
$xfer += $this->config->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ServiceThrottlingConfig');
if ($this->serviceName !== null) {
$xfer += $output->writeFieldBegin('serviceName', TType::STRING, 1);
$xfer += $output->writeString($this->serviceName);
$xfer += $output->writeFieldEnd();
}
if ($this->config !== null) {
if (!is_object($this->config)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('config', TType::STRUCT, 2);
$xfer += $this->config->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,142 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ThrottlingConfig
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'maxOperations',
'isRequired' => true,
'type' => TType::I32,
),
2 => array(
'var' => 'creditsPerSecond',
'isRequired' => true,
'type' => TType::DOUBLE,
),
3 => array(
'var' => 'maxBalance',
'isRequired' => true,
'type' => TType::DOUBLE,
),
);
/**
* @var int
*/
public $maxOperations = null;
/**
* @var double
*/
public $creditsPerSecond = null;
/**
* @var double
*/
public $maxBalance = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['maxOperations'])) {
$this->maxOperations = $vals['maxOperations'];
}
if (isset($vals['creditsPerSecond'])) {
$this->creditsPerSecond = $vals['creditsPerSecond'];
}
if (isset($vals['maxBalance'])) {
$this->maxBalance = $vals['maxBalance'];
}
}
}
public function getName()
{
return 'ThrottlingConfig';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->maxOperations);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->creditsPerSecond);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::DOUBLE) {
$xfer += $input->readDouble($this->maxBalance);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ThrottlingConfig');
if ($this->maxOperations !== null) {
$xfer += $output->writeFieldBegin('maxOperations', TType::I32, 1);
$xfer += $output->writeI32($this->maxOperations);
$xfer += $output->writeFieldEnd();
}
if ($this->creditsPerSecond !== null) {
$xfer += $output->writeFieldBegin('creditsPerSecond', TType::DOUBLE, 2);
$xfer += $output->writeDouble($this->creditsPerSecond);
$xfer += $output->writeFieldEnd();
}
if ($this->maxBalance !== null) {
$xfer += $output->writeFieldBegin('maxBalance', TType::DOUBLE, 3);
$xfer += $output->writeDouble($this->maxBalance);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,145 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ThrottlingResponse
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'defaultConfig',
'isRequired' => true,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ThrottlingConfig',
),
2 => array(
'var' => 'serviceConfigs',
'isRequired' => true,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ServiceThrottlingConfig',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\ThrottlingConfig
*/
public $defaultConfig = null;
/**
* @var \Jaeger\Thrift\Agent\ServiceThrottlingConfig[]
*/
public $serviceConfigs = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['defaultConfig'])) {
$this->defaultConfig = $vals['defaultConfig'];
}
if (isset($vals['serviceConfigs'])) {
$this->serviceConfigs = $vals['serviceConfigs'];
}
}
}
public function getName()
{
return 'ThrottlingResponse';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRUCT) {
$this->defaultConfig = new \Jaeger\Thrift\Agent\ThrottlingConfig();
$xfer += $this->defaultConfig->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::LST) {
$this->serviceConfigs = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\ServiceThrottlingConfig();
$xfer += $elem5->read($input);
$this->serviceConfigs []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ThrottlingResponse');
if ($this->defaultConfig !== null) {
if (!is_object($this->defaultConfig)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('defaultConfig', TType::STRUCT, 1);
$xfer += $this->defaultConfig->write($output);
$xfer += $output->writeFieldEnd();
}
if ($this->serviceConfigs !== null) {
if (!is_array($this->serviceConfigs)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('serviceConfigs', TType::LST, 2);
$output->writeListBegin(TType::STRUCT, count($this->serviceConfigs));
foreach ($this->serviceConfigs as $iter6) {
$xfer += $iter6->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ThrottlingServiceClient implements \Jaeger\Thrift\Agent\ThrottlingServiceIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function getThrottlingConfigs(array $serviceNames)
{
$this->send_getThrottlingConfigs($serviceNames);
return $this->recv_getThrottlingConfigs();
}
public function send_getThrottlingConfigs(array $serviceNames)
{
$args = new \Jaeger\Thrift\Agent\ThrottlingService_getThrottlingConfigs_args();
$args->serviceNames = $serviceNames;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'getThrottlingConfigs',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('getThrottlingConfigs', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_getThrottlingConfigs()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\ThrottlingService_getThrottlingConfigs_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\ThrottlingService_getThrottlingConfigs_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("getThrottlingConfigs failed: unknown result");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface ThrottlingServiceIf
{
/**
* @param string[] $serviceNames
* @return \Jaeger\Thrift\Agent\ThrottlingResponse
*/
public function getThrottlingConfigs(array $serviceNames);
}

View File

@ -1,114 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ThrottlingService_getThrottlingConfigs_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'serviceNames',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRING,
'elem' => array(
'type' => TType::STRING,
),
),
);
/**
* @var string[]
*/
public $serviceNames = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['serviceNames'])) {
$this->serviceNames = $vals['serviceNames'];
}
}
}
public function getName()
{
return 'ThrottlingService_getThrottlingConfigs_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::LST) {
$this->serviceNames = array();
$_size7 = 0;
$_etype10 = 0;
$xfer += $input->readListBegin($_etype10, $_size7);
for ($_i11 = 0; $_i11 < $_size7; ++$_i11) {
$elem12 = null;
$xfer += $input->readString($elem12);
$this->serviceNames []= $elem12;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ThrottlingService_getThrottlingConfigs_args');
if ($this->serviceNames !== null) {
if (!is_array($this->serviceNames)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('serviceNames', TType::LST, 1);
$output->writeListBegin(TType::STRING, count($this->serviceNames));
foreach ($this->serviceNames as $iter13) {
$xfer += $output->writeString($iter13);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,99 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ThrottlingService_getThrottlingConfigs_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\ThrottlingResponse',
),
);
/**
* @var \Jaeger\Thrift\Agent\ThrottlingResponse
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'ThrottlingService_getThrottlingConfigs_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::STRUCT) {
$this->success = new \Jaeger\Thrift\Agent\ThrottlingResponse();
$xfer += $this->success->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ThrottlingService_getThrottlingConfigs_result');
if ($this->success !== null) {
if (!is_object($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::STRUCT, 0);
$xfer += $this->success->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,118 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ValidateTraceResponse
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'ok',
'isRequired' => true,
'type' => TType::BOOL,
),
2 => array(
'var' => 'traceCount',
'isRequired' => true,
'type' => TType::I64,
),
);
/**
* @var bool
*/
public $ok = null;
/**
* @var int
*/
public $traceCount = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['ok'])) {
$this->ok = $vals['ok'];
}
if (isset($vals['traceCount'])) {
$this->traceCount = $vals['traceCount'];
}
}
}
public function getName()
{
return 'ValidateTraceResponse';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::BOOL) {
$xfer += $input->readBool($this->ok);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->traceCount);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ValidateTraceResponse');
if ($this->ok !== null) {
$xfer += $output->writeFieldBegin('ok', TType::BOOL, 1);
$xfer += $output->writeBool($this->ok);
$xfer += $output->writeFieldEnd();
}
if ($this->traceCount !== null) {
$xfer += $output->writeFieldBegin('traceCount', TType::I64, 2);
$xfer += $output->writeI64($this->traceCount);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,159 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
/**
* An annotation is similar to a log statement. It includes a host field which
* allows these events to be attributed properly, and also aggregatable.
*/
class Annotation
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'timestamp',
'isRequired' => false,
'type' => TType::I64,
),
2 => array(
'var' => 'value',
'isRequired' => false,
'type' => TType::STRING,
),
3 => array(
'var' => 'host',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Endpoint',
),
);
/**
* Microseconds from epoch.
*
* This value should use the most precise value possible. For example,
* gettimeofday or syncing nanoTime against a tick of currentTimeMillis.
*
* @var int
*/
public $timestamp = null;
/**
* @var string
*/
public $value = null;
/**
* Always the host that recorded the event. By specifying the host you allow
* rollup of all events (such as client requests to a service) by IP address.
*
* @var \Jaeger\Thrift\Agent\Zipkin\Endpoint
*/
public $host = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['timestamp'])) {
$this->timestamp = $vals['timestamp'];
}
if (isset($vals['value'])) {
$this->value = $vals['value'];
}
if (isset($vals['host'])) {
$this->host = $vals['host'];
}
}
}
public function getName()
{
return 'Annotation';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->timestamp);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->value);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::STRUCT) {
$this->host = new \Jaeger\Thrift\Agent\Zipkin\Endpoint();
$xfer += $this->host->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Annotation');
if ($this->timestamp !== null) {
$xfer += $output->writeFieldBegin('timestamp', TType::I64, 1);
$xfer += $output->writeI64($this->timestamp);
$xfer += $output->writeFieldEnd();
}
if ($this->value !== null) {
$xfer += $output->writeFieldBegin('value', TType::STRING, 2);
$xfer += $output->writeString($this->value);
$xfer += $output->writeFieldEnd();
}
if ($this->host !== null) {
if (!is_object($this->host)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('host', TType::STRUCT, 3);
$xfer += $this->host->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,45 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
final class AnnotationType
{
const BOOL = 0;
const BYTES = 1;
const I16 = 2;
const I32 = 3;
const I64 = 4;
const DOUBLE = 5;
const STRING = 6;
static public $__names = array(
0 => 'BOOL',
1 => 'BYTES',
2 => 'I16',
3 => 'I32',
4 => 'I64',
5 => 'DOUBLE',
6 => 'STRING',
);
}

View File

@ -1,193 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
/**
* Binary annotations are tags applied to a Span to give it context. For
* example, a binary annotation of "http.uri" could the path to a resource in a
* RPC call.
*
* Binary annotations of type STRING are always queryable, though more a
* historical implementation detail than a structural concern.
*
* Binary annotations can repeat, and vary on the host. Similar to Annotation,
* the host indicates who logged the event. This allows you to tell the
* difference between the client and server side of the same key. For example,
* the key "http.uri" might be different on the client and server side due to
* rewriting, like "/api/v1/myresource" vs "/myresource. Via the host field,
* you can see the different points of view, which often help in debugging.
*/
class BinaryAnnotation
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'key',
'isRequired' => false,
'type' => TType::STRING,
),
2 => array(
'var' => 'value',
'isRequired' => false,
'type' => TType::STRING,
),
3 => array(
'var' => 'annotation_type',
'isRequired' => false,
'type' => TType::I32,
),
4 => array(
'var' => 'host',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Endpoint',
),
);
/**
* @var string
*/
public $key = null;
/**
* @var string
*/
public $value = null;
/**
* @var int
*/
public $annotation_type = null;
/**
* The host that recorded tag, which allows you to differentiate between
* multiple tags with the same key. There are two exceptions to this.
*
* When the key is CLIENT_ADDR or SERVER_ADDR, host indicates the source or
* destination of an RPC. This exception allows zipkin to display network
* context of uninstrumented services, or clients such as web browsers.
*
* @var \Jaeger\Thrift\Agent\Zipkin\Endpoint
*/
public $host = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['key'])) {
$this->key = $vals['key'];
}
if (isset($vals['value'])) {
$this->value = $vals['value'];
}
if (isset($vals['annotation_type'])) {
$this->annotation_type = $vals['annotation_type'];
}
if (isset($vals['host'])) {
$this->host = $vals['host'];
}
}
}
public function getName()
{
return 'BinaryAnnotation';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->key);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->value);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->annotation_type);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRUCT) {
$this->host = new \Jaeger\Thrift\Agent\Zipkin\Endpoint();
$xfer += $this->host->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('BinaryAnnotation');
if ($this->key !== null) {
$xfer += $output->writeFieldBegin('key', TType::STRING, 1);
$xfer += $output->writeString($this->key);
$xfer += $output->writeFieldEnd();
}
if ($this->value !== null) {
$xfer += $output->writeFieldBegin('value', TType::STRING, 2);
$xfer += $output->writeString($this->value);
$xfer += $output->writeFieldEnd();
}
if ($this->annotation_type !== null) {
$xfer += $output->writeFieldBegin('annotation_type', TType::I32, 3);
$xfer += $output->writeI32($this->annotation_type);
$xfer += $output->writeFieldEnd();
}
if ($this->host !== null) {
if (!is_object($this->host)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('host', TType::STRUCT, 4);
$xfer += $this->host->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,261 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
final class Constant extends \Thrift\Type\TConstant
{
static protected $CLIENT_SEND;
static protected $CLIENT_RECV;
static protected $SERVER_SEND;
static protected $SERVER_RECV;
static protected $MESSAGE_SEND;
static protected $MESSAGE_RECV;
static protected $WIRE_SEND;
static protected $WIRE_RECV;
static protected $CLIENT_SEND_FRAGMENT;
static protected $CLIENT_RECV_FRAGMENT;
static protected $SERVER_SEND_FRAGMENT;
static protected $SERVER_RECV_FRAGMENT;
static protected $LOCAL_COMPONENT;
static protected $CLIENT_ADDR;
static protected $SERVER_ADDR;
static protected $MESSAGE_ADDR;
protected static function init_CLIENT_SEND()
{
return /**
* The client sent ("cs") a request to a server. There is only one send per
* span. For example, if there's a transport error, each attempt can be logged
* as a WIRE_SEND annotation.
*
* If chunking is involved, each chunk could be logged as a separate
* CLIENT_SEND_FRAGMENT in the same span.
*
* Annotation.host is not the server. It is the host which logged the send
* event, almost always the client. When logging CLIENT_SEND, instrumentation
* should also log the SERVER_ADDR.
*/
"cs";
}
protected static function init_CLIENT_RECV()
{
return /**
* The client received ("cr") a response from a server. There is only one
* receive per span. For example, if duplicate responses were received, each
* can be logged as a WIRE_RECV annotation.
*
* If chunking is involved, each chunk could be logged as a separate
* CLIENT_RECV_FRAGMENT in the same span.
*
* Annotation.host is not the server. It is the host which logged the receive
* event, almost always the client. The actual endpoint of the server is
* recorded separately as SERVER_ADDR when CLIENT_SEND is logged.
*/
"cr";
}
protected static function init_SERVER_SEND()
{
return /**
* The server sent ("ss") a response to a client. There is only one response
* per span. If there's a transport error, each attempt can be logged as a
* WIRE_SEND annotation.
*
* Typically, a trace ends with a server send, so the last timestamp of a trace
* is often the timestamp of the root span's server send.
*
* If chunking is involved, each chunk could be logged as a separate
* SERVER_SEND_FRAGMENT in the same span.
*
* Annotation.host is not the client. It is the host which logged the send
* event, almost always the server. The actual endpoint of the client is
* recorded separately as CLIENT_ADDR when SERVER_RECV is logged.
*/
"ss";
}
protected static function init_SERVER_RECV()
{
return /**
* The server received ("sr") a request from a client. There is only one
* request per span. For example, if duplicate responses were received, each
* can be logged as a WIRE_RECV annotation.
*
* Typically, a trace starts with a server receive, so the first timestamp of a
* trace is often the timestamp of the root span's server receive.
*
* If chunking is involved, each chunk could be logged as a separate
* SERVER_RECV_FRAGMENT in the same span.
*
* Annotation.host is not the client. It is the host which logged the receive
* event, almost always the server. When logging SERVER_RECV, instrumentation
* should also log the CLIENT_ADDR.
*/
"sr";
}
protected static function init_MESSAGE_SEND()
{
return /**
* Message send ("ms") is a request to send a message to a destination, usually
* a broker. This may be the only annotation in a messaging span. If WIRE_SEND
* exists in the same span, it follows this moment and clarifies delays sending
* the message, such as batching.
*
* Unlike RPC annotations like CLIENT_SEND, messaging spans never share a span
* ID. For example, "ms" should always be the parent of "mr".
*
* Annotation.host is not the destination, it is the host which logged the send
* event: the producer. When annotating MESSAGE_SEND, instrumentation should
* also tag the MESSAGE_ADDR.
*/
"ms";
}
protected static function init_MESSAGE_RECV()
{
return /**
* A consumer received ("mr") a message from a broker. This may be the only
* annotation in a messaging span. If WIRE_RECV exists in the same span, it
* precedes this moment and clarifies any local queuing delay.
*
* Unlike RPC annotations like SERVER_RECV, messaging spans never share a span
* ID. For example, "mr" should always be a child of "ms" unless it is a root
* span.
*
* Annotation.host is not the broker, it is the host which logged the receive
* event: the consumer. When annotating MESSAGE_RECV, instrumentation should
* also tag the MESSAGE_ADDR.
*/
"mr";
}
protected static function init_WIRE_SEND()
{
return /**
* Optionally logs an attempt to send a message on the wire. Multiple wire send
* events could indicate network retries. A lag between client or server send
* and wire send might indicate queuing or processing delay.
*/
"ws";
}
protected static function init_WIRE_RECV()
{
return /**
* Optionally logs an attempt to receive a message from the wire. Multiple wire
* receive events could indicate network retries. A lag between wire receive
* and client or server receive might indicate queuing or processing delay.
*/
"wr";
}
protected static function init_CLIENT_SEND_FRAGMENT()
{
return /**
* Optionally logs progress of a (CLIENT_SEND, WIRE_SEND). For example, this
* could be one chunk in a chunked request.
*/
"csf";
}
protected static function init_CLIENT_RECV_FRAGMENT()
{
return /**
* Optionally logs progress of a (CLIENT_RECV, WIRE_RECV). For example, this
* could be one chunk in a chunked response.
*/
"crf";
}
protected static function init_SERVER_SEND_FRAGMENT()
{
return /**
* Optionally logs progress of a (SERVER_SEND, WIRE_SEND). For example, this
* could be one chunk in a chunked response.
*/
"ssf";
}
protected static function init_SERVER_RECV_FRAGMENT()
{
return /**
* Optionally logs progress of a (SERVER_RECV, WIRE_RECV). For example, this
* could be one chunk in a chunked request.
*/
"srf";
}
protected static function init_LOCAL_COMPONENT()
{
return /**
* The value of "lc" is the component or namespace of a local span.
*
* BinaryAnnotation.host adds service context needed to support queries.
*
* Local Component("lc") supports three key features: flagging, query by
* service and filtering Span.name by namespace.
*
* While structurally the same, local spans are fundamentally different than
* RPC spans in how they should be interpreted. For example, zipkin v1 tools
* center on RPC latency and service graphs. Root local-spans are neither
* indicative of critical path RPC latency, nor have impact on the shape of a
* service graph. By flagging with "lc", tools can special-case local spans.
*
* Zipkin v1 Spans are unqueryable unless they can be indexed by service name.
* The only path to a service name is by (Binary)?Annotation.host.serviceName.
* By logging "lc", a local span can be queried even if no other annotations
* are logged.
*
* The value of "lc" is the namespace of Span.name. For example, it might be
* "finatra2", for a span named "bootstrap". "lc" allows you to resolves
* conflicts for the same Span.name, for example "finatra/bootstrap" vs
* "finch/bootstrap". Using local component, you'd search for spans named
* "bootstrap" where "lc=finch"
*/
"lc";
}
protected static function init_CLIENT_ADDR()
{
return /**
* Indicates a client address ("ca") in a span. Most likely, there's only one.
* Multiple addresses are possible when a client changes its ip or port within
* a span.
*/
"ca";
}
protected static function init_SERVER_ADDR()
{
return /**
* Indicates a server address ("sa") in a span. Most likely, there's only one.
* Multiple addresses are possible when a client is redirected, or fails to a
* different server ip or port.
*/
"sa";
}
protected static function init_MESSAGE_ADDR()
{
return /**
* Indicates the remote address of a messaging span, usually the broker.
*/
"ma";
}
}

View File

@ -1,191 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
/**
* Indicates the network context of a service recording an annotation with two
* exceptions.
*
* When a BinaryAnnotation, and key is CLIENT_ADDR or SERVER_ADDR,
* the endpoint indicates the source or destination of an RPC. This exception
* allows zipkin to display network context of uninstrumented services, or
* clients such as web browsers.
*/
class Endpoint
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'ipv4',
'isRequired' => false,
'type' => TType::I32,
),
2 => array(
'var' => 'port',
'isRequired' => false,
'type' => TType::I16,
),
3 => array(
'var' => 'service_name',
'isRequired' => false,
'type' => TType::STRING,
),
4 => array(
'var' => 'ipv6',
'isRequired' => false,
'type' => TType::STRING,
),
);
/**
* IPv4 host address packed into 4 bytes.
*
* Ex for the ip 1.2.3.4, it would be (1 << 24) | (2 << 16) | (3 << 8) | 4
*
* @var int
*/
public $ipv4 = null;
/**
* IPv4 port
*
* Note: this is to be treated as an unsigned integer, so watch for negatives.
*
* Conventionally, when the port isn't known, port = 0.
*
* @var int
*/
public $port = null;
/**
* Service name in lowercase, such as "memcache" or "zipkin-web"
*
* Conventionally, when the service name isn't known, service_name = "unknown".
*
* @var string
*/
public $service_name = null;
/**
* IPv6 host address packed into 16 bytes. Ex Inet6Address.getBytes()
*
* @var string
*/
public $ipv6 = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['ipv4'])) {
$this->ipv4 = $vals['ipv4'];
}
if (isset($vals['port'])) {
$this->port = $vals['port'];
}
if (isset($vals['service_name'])) {
$this->service_name = $vals['service_name'];
}
if (isset($vals['ipv6'])) {
$this->ipv6 = $vals['ipv6'];
}
}
}
public function getName()
{
return 'Endpoint';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I32) {
$xfer += $input->readI32($this->ipv4);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::I16) {
$xfer += $input->readI16($this->port);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->service_name);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->ipv6);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Endpoint');
if ($this->ipv4 !== null) {
$xfer += $output->writeFieldBegin('ipv4', TType::I32, 1);
$xfer += $output->writeI32($this->ipv4);
$xfer += $output->writeFieldEnd();
}
if ($this->port !== null) {
$xfer += $output->writeFieldBegin('port', TType::I16, 2);
$xfer += $output->writeI16($this->port);
$xfer += $output->writeFieldEnd();
}
if ($this->service_name !== null) {
$xfer += $output->writeFieldBegin('service_name', TType::STRING, 3);
$xfer += $output->writeString($this->service_name);
$xfer += $output->writeFieldEnd();
}
if ($this->ipv6 !== null) {
$xfer += $output->writeFieldBegin('ipv6', TType::STRING, 4);
$xfer += $output->writeString($this->ipv6);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Response
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'ok',
'isRequired' => true,
'type' => TType::BOOL,
),
);
/**
* @var bool
*/
public $ok = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['ok'])) {
$this->ok = $vals['ok'];
}
}
}
public function getName()
{
return 'Response';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::BOOL) {
$xfer += $input->readBool($this->ok);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Response');
if ($this->ok !== null) {
$xfer += $output->writeFieldBegin('ok', TType::BOOL, 1);
$xfer += $output->writeBool($this->ok);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,397 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
/**
* A trace is a series of spans (often RPC calls) which form a latency tree.
*
* The root span is where trace_id = id and parent_id = Nil. The root span is
* usually the longest interval in the trace, starting with a SERVER_RECV
* annotation and ending with a SERVER_SEND.
*/
class Span
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'trace_id',
'isRequired' => false,
'type' => TType::I64,
),
3 => array(
'var' => 'name',
'isRequired' => false,
'type' => TType::STRING,
),
4 => array(
'var' => 'id',
'isRequired' => false,
'type' => TType::I64,
),
5 => array(
'var' => 'parent_id',
'isRequired' => false,
'type' => TType::I64,
),
6 => array(
'var' => 'annotations',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Annotation',
),
),
8 => array(
'var' => 'binary_annotations',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation',
),
),
9 => array(
'var' => 'debug',
'isRequired' => false,
'type' => TType::BOOL,
),
10 => array(
'var' => 'timestamp',
'isRequired' => false,
'type' => TType::I64,
),
11 => array(
'var' => 'duration',
'isRequired' => false,
'type' => TType::I64,
),
12 => array(
'var' => 'trace_id_high',
'isRequired' => false,
'type' => TType::I64,
),
);
/**
* @var int
*/
public $trace_id = null;
/**
* Span name in lowercase, rpc method for example
*
* Conventionally, when the span name isn't known, name = "unknown".
*
* @var string
*/
public $name = null;
/**
* @var int
*/
public $id = null;
/**
* @var int
*/
public $parent_id = null;
/**
* @var \Jaeger\Thrift\Agent\Zipkin\Annotation[]
*/
public $annotations = null;
/**
* @var \Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation[]
*/
public $binary_annotations = null;
/**
* @var bool
*/
public $debug = false;
/**
* Microseconds from epoch of the creation of this span.
*
* This value should be set directly by instrumentation, using the most
* precise value possible. For example, gettimeofday or syncing nanoTime
* against a tick of currentTimeMillis.
*
* For compatibility with instrumentation that precede this field, collectors
* or span stores can derive this via Annotation.timestamp.
* For example, SERVER_RECV.timestamp or CLIENT_SEND.timestamp.
*
* This field is optional for compatibility with old data: first-party span
* stores are expected to support this at time of introduction.
*
* @var int
*/
public $timestamp = null;
/**
* Measurement of duration in microseconds, used to support queries.
*
* This value should be set directly, where possible. Doing so encourages
* precise measurement decoupled from problems of clocks, such as skew or NTP
* updates causing time to move backwards.
*
* For compatibility with instrumentation that precede this field, collectors
* or span stores can derive this by subtracting Annotation.timestamp.
* For example, SERVER_SEND.timestamp - SERVER_RECV.timestamp.
*
* If this field is persisted as unset, zipkin will continue to work, except
* duration query support will be implementation-specific. Similarly, setting
* this field non-atomically is implementation-specific.
*
* This field is i64 vs i32 to support spans longer than 35 minutes.
*
* @var int
*/
public $duration = null;
/**
* Optional unique 8-byte additional identifier for a trace. If non zero, this
* means the trace uses 128 bit traceIds instead of 64 bit.
*
* @var int
*/
public $trace_id_high = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['trace_id'])) {
$this->trace_id = $vals['trace_id'];
}
if (isset($vals['name'])) {
$this->name = $vals['name'];
}
if (isset($vals['id'])) {
$this->id = $vals['id'];
}
if (isset($vals['parent_id'])) {
$this->parent_id = $vals['parent_id'];
}
if (isset($vals['annotations'])) {
$this->annotations = $vals['annotations'];
}
if (isset($vals['binary_annotations'])) {
$this->binary_annotations = $vals['binary_annotations'];
}
if (isset($vals['debug'])) {
$this->debug = $vals['debug'];
}
if (isset($vals['timestamp'])) {
$this->timestamp = $vals['timestamp'];
}
if (isset($vals['duration'])) {
$this->duration = $vals['duration'];
}
if (isset($vals['trace_id_high'])) {
$this->trace_id_high = $vals['trace_id_high'];
}
}
}
public function getName()
{
return 'Span';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->trace_id);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::STRING) {
$xfer += $input->readString($this->name);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->id);
} else {
$xfer += $input->skip($ftype);
}
break;
case 5:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->parent_id);
} else {
$xfer += $input->skip($ftype);
}
break;
case 6:
if ($ftype == TType::LST) {
$this->annotations = array();
$_size0 = 0;
$_etype3 = 0;
$xfer += $input->readListBegin($_etype3, $_size0);
for ($_i4 = 0; $_i4 < $_size0; ++$_i4) {
$elem5 = null;
$elem5 = new \Jaeger\Thrift\Agent\Zipkin\Annotation();
$xfer += $elem5->read($input);
$this->annotations []= $elem5;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 8:
if ($ftype == TType::LST) {
$this->binary_annotations = array();
$_size6 = 0;
$_etype9 = 0;
$xfer += $input->readListBegin($_etype9, $_size6);
for ($_i10 = 0; $_i10 < $_size6; ++$_i10) {
$elem11 = null;
$elem11 = new \Jaeger\Thrift\Agent\Zipkin\BinaryAnnotation();
$xfer += $elem11->read($input);
$this->binary_annotations []= $elem11;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 9:
if ($ftype == TType::BOOL) {
$xfer += $input->readBool($this->debug);
} else {
$xfer += $input->skip($ftype);
}
break;
case 10:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->timestamp);
} else {
$xfer += $input->skip($ftype);
}
break;
case 11:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->duration);
} else {
$xfer += $input->skip($ftype);
}
break;
case 12:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->trace_id_high);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Span');
if ($this->trace_id !== null) {
$xfer += $output->writeFieldBegin('trace_id', TType::I64, 1);
$xfer += $output->writeI64($this->trace_id);
$xfer += $output->writeFieldEnd();
}
if ($this->name !== null) {
$xfer += $output->writeFieldBegin('name', TType::STRING, 3);
$xfer += $output->writeString($this->name);
$xfer += $output->writeFieldEnd();
}
if ($this->id !== null) {
$xfer += $output->writeFieldBegin('id', TType::I64, 4);
$xfer += $output->writeI64($this->id);
$xfer += $output->writeFieldEnd();
}
if ($this->parent_id !== null) {
$xfer += $output->writeFieldBegin('parent_id', TType::I64, 5);
$xfer += $output->writeI64($this->parent_id);
$xfer += $output->writeFieldEnd();
}
if ($this->annotations !== null) {
if (!is_array($this->annotations)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('annotations', TType::LST, 6);
$output->writeListBegin(TType::STRUCT, count($this->annotations));
foreach ($this->annotations as $iter12) {
$xfer += $iter12->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
if ($this->binary_annotations !== null) {
if (!is_array($this->binary_annotations)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('binary_annotations', TType::LST, 8);
$output->writeListBegin(TType::STRUCT, count($this->binary_annotations));
foreach ($this->binary_annotations as $iter13) {
$xfer += $iter13->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
if ($this->debug !== null) {
$xfer += $output->writeFieldBegin('debug', TType::BOOL, 9);
$xfer += $output->writeBool($this->debug);
$xfer += $output->writeFieldEnd();
}
if ($this->timestamp !== null) {
$xfer += $output->writeFieldBegin('timestamp', TType::I64, 10);
$xfer += $output->writeI64($this->timestamp);
$xfer += $output->writeFieldEnd();
}
if ($this->duration !== null) {
$xfer += $output->writeFieldBegin('duration', TType::I64, 11);
$xfer += $output->writeI64($this->duration);
$xfer += $output->writeFieldEnd();
}
if ($this->trace_id_high !== null) {
$xfer += $output->writeFieldBegin('trace_id_high', TType::I64, 12);
$xfer += $output->writeI64($this->trace_id_high);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ZipkinCollectorClient implements \Jaeger\Thrift\Agent\Zipkin\ZipkinCollectorIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function submitZipkinBatch(array $spans)
{
$this->send_submitZipkinBatch($spans);
return $this->recv_submitZipkinBatch();
}
public function send_submitZipkinBatch(array $spans)
{
$args = new \Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_args();
$args->spans = $spans;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'submitZipkinBatch',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('submitZipkinBatch', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_submitZipkinBatch()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Agent\Zipkin\ZipkinCollector_submitZipkinBatch_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("submitZipkinBatch failed: unknown result");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface ZipkinCollectorIf
{
/**
* @param \Jaeger\Thrift\Agent\Zipkin\Span[] $spans
* @return \Jaeger\Thrift\Agent\Zipkin\Response[]
*/
public function submitZipkinBatch(array $spans);
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ZipkinCollector_submitZipkinBatch_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'spans',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Span',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\Zipkin\Span[]
*/
public $spans = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['spans'])) {
$this->spans = $vals['spans'];
}
}
}
public function getName()
{
return 'ZipkinCollector_submitZipkinBatch_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::LST) {
$this->spans = array();
$_size14 = 0;
$_etype17 = 0;
$xfer += $input->readListBegin($_etype17, $_size14);
for ($_i18 = 0; $_i18 < $_size14; ++$_i18) {
$elem19 = null;
$elem19 = new \Jaeger\Thrift\Agent\Zipkin\Span();
$xfer += $elem19->read($input);
$this->spans []= $elem19;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ZipkinCollector_submitZipkinBatch_args');
if ($this->spans !== null) {
if (!is_array($this->spans)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('spans', TType::LST, 1);
$output->writeListBegin(TType::STRUCT, count($this->spans));
foreach ($this->spans as $iter20) {
$xfer += $iter20->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift\Agent\Zipkin;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ZipkinCollector_submitZipkinBatch_result
{
static public $isValidate = false;
static public $_TSPEC = array(
0 => array(
'var' => 'success',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Agent\Zipkin\Response',
),
),
);
/**
* @var \Jaeger\Thrift\Agent\Zipkin\Response[]
*/
public $success = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['success'])) {
$this->success = $vals['success'];
}
}
}
public function getName()
{
return 'ZipkinCollector_submitZipkinBatch_result';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 0:
if ($ftype == TType::LST) {
$this->success = array();
$_size21 = 0;
$_etype24 = 0;
$xfer += $input->readListBegin($_etype24, $_size21);
for ($_i25 = 0; $_i25 < $_size21; ++$_i25) {
$elem26 = null;
$elem26 = new \Jaeger\Thrift\Agent\Zipkin\Response();
$xfer += $elem26->read($input);
$this->success []= $elem26;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ZipkinCollector_submitZipkinBatch_result');
if ($this->success !== null) {
if (!is_array($this->success)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('success', TType::LST, 0);
$output->writeListBegin(TType::STRUCT, count($this->success));
foreach ($this->success as $iter27) {
$xfer += $iter27->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,198 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Batch
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'process',
'isRequired' => true,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Process',
),
2 => array(
'var' => 'spans',
'isRequired' => true,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Span',
),
),
3 => array(
'var' => 'seqNo',
'isRequired' => false,
'type' => TType::I64,
),
4 => array(
'var' => 'stats',
'isRequired' => false,
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\ClientStats',
),
);
/**
* @var \Jaeger\Thrift\Process
*/
public $process = null;
/**
* @var \Jaeger\Thrift\Span[]
*/
public $spans = null;
/**
* @var int
*/
public $seqNo = null;
/**
* @var \Jaeger\Thrift\ClientStats
*/
public $stats = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['process'])) {
$this->process = $vals['process'];
}
if (isset($vals['spans'])) {
$this->spans = $vals['spans'];
}
if (isset($vals['seqNo'])) {
$this->seqNo = $vals['seqNo'];
}
if (isset($vals['stats'])) {
$this->stats = $vals['stats'];
}
}
}
public function getName()
{
return 'Batch';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::STRUCT) {
$this->process = new \Jaeger\Thrift\Process();
$xfer += $this->process->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::LST) {
$this->spans = array();
$_size35 = 0;
$_etype38 = 0;
$xfer += $input->readListBegin($_etype38, $_size35);
for ($_i39 = 0; $_i39 < $_size35; ++$_i39) {
$elem40 = null;
$elem40 = new \Jaeger\Thrift\Span();
$xfer += $elem40->read($input);
$this->spans []= $elem40;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->seqNo);
} else {
$xfer += $input->skip($ftype);
}
break;
case 4:
if ($ftype == TType::STRUCT) {
$this->stats = new \Jaeger\Thrift\ClientStats();
$xfer += $this->stats->read($input);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Batch');
if ($this->process !== null) {
if (!is_object($this->process)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('process', TType::STRUCT, 1);
$xfer += $this->process->write($output);
$xfer += $output->writeFieldEnd();
}
if ($this->spans !== null) {
if (!is_array($this->spans)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('spans', TType::LST, 2);
$output->writeListBegin(TType::STRUCT, count($this->spans));
foreach ($this->spans as $iter41) {
$xfer += $iter41->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
if ($this->seqNo !== null) {
$xfer += $output->writeFieldBegin('seqNo', TType::I64, 3);
$xfer += $output->writeI64($this->seqNo);
$xfer += $output->writeFieldEnd();
}
if ($this->stats !== null) {
if (!is_object($this->stats)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('stats', TType::STRUCT, 4);
$xfer += $this->stats->write($output);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,94 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class BatchSubmitResponse
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'ok',
'isRequired' => true,
'type' => TType::BOOL,
),
);
/**
* @var bool
*/
public $ok = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['ok'])) {
$this->ok = $vals['ok'];
}
}
}
public function getName()
{
return 'BatchSubmitResponse';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::BOOL) {
$xfer += $input->readBool($this->ok);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('BatchSubmitResponse');
if ($this->ok !== null) {
$xfer += $output->writeFieldBegin('ok', TType::BOOL, 1);
$xfer += $output->writeBool($this->ok);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,142 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class ClientStats
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'fullQueueDroppedSpans',
'isRequired' => true,
'type' => TType::I64,
),
2 => array(
'var' => 'tooLargeDroppedSpans',
'isRequired' => true,
'type' => TType::I64,
),
3 => array(
'var' => 'failedToEmitSpans',
'isRequired' => true,
'type' => TType::I64,
),
);
/**
* @var int
*/
public $fullQueueDroppedSpans = null;
/**
* @var int
*/
public $tooLargeDroppedSpans = null;
/**
* @var int
*/
public $failedToEmitSpans = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['fullQueueDroppedSpans'])) {
$this->fullQueueDroppedSpans = $vals['fullQueueDroppedSpans'];
}
if (isset($vals['tooLargeDroppedSpans'])) {
$this->tooLargeDroppedSpans = $vals['tooLargeDroppedSpans'];
}
if (isset($vals['failedToEmitSpans'])) {
$this->failedToEmitSpans = $vals['failedToEmitSpans'];
}
}
}
public function getName()
{
return 'ClientStats';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->fullQueueDroppedSpans);
} else {
$xfer += $input->skip($ftype);
}
break;
case 2:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->tooLargeDroppedSpans);
} else {
$xfer += $input->skip($ftype);
}
break;
case 3:
if ($ftype == TType::I64) {
$xfer += $input->readI64($this->failedToEmitSpans);
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('ClientStats');
if ($this->fullQueueDroppedSpans !== null) {
$xfer += $output->writeFieldBegin('fullQueueDroppedSpans', TType::I64, 1);
$xfer += $output->writeI64($this->fullQueueDroppedSpans);
$xfer += $output->writeFieldEnd();
}
if ($this->tooLargeDroppedSpans !== null) {
$xfer += $output->writeFieldBegin('tooLargeDroppedSpans', TType::I64, 2);
$xfer += $output->writeI64($this->tooLargeDroppedSpans);
$xfer += $output->writeFieldEnd();
}
if ($this->failedToEmitSpans !== null) {
$xfer += $output->writeFieldBegin('failedToEmitSpans', TType::I64, 3);
$xfer += $output->writeI64($this->failedToEmitSpans);
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

View File

@ -1,91 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class CollectorClient implements \Jaeger\Thrift\CollectorIf
{
protected $input_ = null;
protected $output_ = null;
protected $seqid_ = 0;
public function __construct($input, $output = null)
{
$this->input_ = $input;
$this->output_ = $output ? $output : $input;
}
public function submitBatches(array $batches)
{
$this->send_submitBatches($batches);
return $this->recv_submitBatches();
}
public function send_submitBatches(array $batches)
{
$args = new \Jaeger\Thrift\Collector_submitBatches_args();
$args->batches = $batches;
$bin_accel = ($this->output_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_write_binary');
if ($bin_accel) {
thrift_protocol_write_binary(
$this->output_,
'submitBatches',
TMessageType::CALL,
$args,
$this->seqid_,
$this->output_->isStrictWrite()
);
} else {
$this->output_->writeMessageBegin('submitBatches', TMessageType::CALL, $this->seqid_);
$args->write($this->output_);
$this->output_->writeMessageEnd();
$this->output_->getTransport()->flush();
}
}
public function recv_submitBatches()
{
$bin_accel = ($this->input_ instanceof TBinaryProtocolAccelerated) && function_exists('thrift_protocol_read_binary');
if ($bin_accel) {
$result = thrift_protocol_read_binary(
$this->input_,
'\Jaeger\Thrift\Collector_submitBatches_result',
$this->input_->isStrictRead()
);
} else {
$rseqid = 0;
$fname = null;
$mtype = 0;
$this->input_->readMessageBegin($fname, $mtype, $rseqid);
if ($mtype == TMessageType::EXCEPTION) {
$x = new TApplicationException();
$x->read($this->input_);
$this->input_->readMessageEnd();
throw $x;
}
$result = new \Jaeger\Thrift\Collector_submitBatches_result();
$result->read($this->input_);
$this->input_->readMessageEnd();
}
if ($result->success !== null) {
return $result->success;
}
throw new \Exception("submitBatches failed: unknown result");
}
}

View File

@ -1,26 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
interface CollectorIf
{
/**
* @param \Jaeger\Thrift\Batch[] $batches
* @return \Jaeger\Thrift\BatchSubmitResponse[]
*/
public function submitBatches(array $batches);
}

View File

@ -1,116 +0,0 @@
<?php
namespace Jaeger\Thrift;
/**
* Autogenerated by Thrift Compiler (0.13.0)
*
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
* @generated
*/
use Thrift\Base\TBase;
use Thrift\Type\TType;
use Thrift\Type\TMessageType;
use Thrift\Exception\TException;
use Thrift\Exception\TProtocolException;
use Thrift\Protocol\TProtocol;
use Thrift\Protocol\TBinaryProtocolAccelerated;
use Thrift\Exception\TApplicationException;
class Collector_submitBatches_args
{
static public $isValidate = false;
static public $_TSPEC = array(
1 => array(
'var' => 'batches',
'isRequired' => false,
'type' => TType::LST,
'etype' => TType::STRUCT,
'elem' => array(
'type' => TType::STRUCT,
'class' => '\Jaeger\Thrift\Batch',
),
),
);
/**
* @var \Jaeger\Thrift\Batch[]
*/
public $batches = null;
public function __construct($vals = null)
{
if (is_array($vals)) {
if (isset($vals['batches'])) {
$this->batches = $vals['batches'];
}
}
}
public function getName()
{
return 'Collector_submitBatches_args';
}
public function read($input)
{
$xfer = 0;
$fname = null;
$ftype = 0;
$fid = 0;
$xfer += $input->readStructBegin($fname);
while (true) {
$xfer += $input->readFieldBegin($fname, $ftype, $fid);
if ($ftype == TType::STOP) {
break;
}
switch ($fid) {
case 1:
if ($ftype == TType::LST) {
$this->batches = array();
$_size42 = 0;
$_etype45 = 0;
$xfer += $input->readListBegin($_etype45, $_size42);
for ($_i46 = 0; $_i46 < $_size42; ++$_i46) {
$elem47 = null;
$elem47 = new \Jaeger\Thrift\Batch();
$xfer += $elem47->read($input);
$this->batches []= $elem47;
}
$xfer += $input->readListEnd();
} else {
$xfer += $input->skip($ftype);
}
break;
default:
$xfer += $input->skip($ftype);
break;
}
$xfer += $input->readFieldEnd();
}
$xfer += $input->readStructEnd();
return $xfer;
}
public function write($output)
{
$xfer = 0;
$xfer += $output->writeStructBegin('Collector_submitBatches_args');
if ($this->batches !== null) {
if (!is_array($this->batches)) {
throw new TProtocolException('Bad type in structure.', TProtocolException::INVALID_DATA);
}
$xfer += $output->writeFieldBegin('batches', TType::LST, 1);
$output->writeListBegin(TType::STRUCT, count($this->batches));
foreach ($this->batches as $iter48) {
$xfer += $iter48->write($output);
}
$output->writeListEnd();
$xfer += $output->writeFieldEnd();
}
$xfer += $output->writeFieldStop();
$xfer += $output->writeStructEnd();
return $xfer;
}
}

Some files were not shown because too many files have changed in this diff Show More