OTLP/GRPC Exporter Implementation (#272)

* Adding Proto to opentelemetry-php
Signed-off-by:Ritick Gautam <riticksinghrajput@gmail.com>

* Updated the script for generating proto folder in root

* Moved shell file in script folder
updated .gitignore

* Removed opentelemetry-proto

* Bug fixed

* added docker-compose.proto.yaml
updated script file
updated Makefile

* Update docker-compose.proto.yaml

* Updated README.md

* OtlpGrpc

* Added Request-response

* Example Updated

* Updated Span Converter

* small fixes

* modified: SpanConvertor.php

* (WIP): Partially working OTLP/GRPC Exporter

What's working?
* Sends spans to the Otel Collector
* Spans contain: Attributes, Status Code, Kind, Start/End timestamp, Lib Version
* Sucessfully sent OTLP to Honeycomb.io

What's not working?
* Need to rebase main onto this branch
* Trace ID and Span ID are too long, and have been fudged to trim them.
* No tests. Unit/Integ
* Events on spans haven't been tested
* Child spans haven't been tested
* Example code needs to be updated (been testing with laravel-otel)
* Need to check the status returned
* Links not implemented
* Generally just unfinished

Anything more to add?
* Thank you to the Ruby OTLP Exporter, lots of inspiration was taken from there

* Fixed traceid and spanid hacks; Now supports Events

* Use localhost:4317 for the default host; + cleanup

* Split code between Exporter.php and SpanConverter.php; Beginnings of tests

* More progress on tests, array's now correctly get converted. Also ran `make style` to format the code

* * Ironed out passing in headers. Could not figure out how best to validate the format php grpc wants the metadata to be in so accepting just the required string format now.
* Beginnings of tests for the Exporter
* Compression now configurable, not tested
* Removed ServiceName from being passed to the Exporter, I believe this should be set as an Attribute on a Resource in the TracerProvider
* Checking the status code coming back from GRPC client, Otel Spec says transient errors MUST be retried, retries not yet implemented: ffc85ddfd9/specification/protocol/exporter.md (retry)

* Add (failing) test for converting SDK Span to OTLP Span

* I'm struggling to set (or even get) an end timestamp for the span.
* Attributes not implemented on Events

* Further progress on Tests for the Exporter

* SpanConverter now translates attrs on Events

* Add opentelemtry-proto files

* Ran `make style' on proto. Do we want this?

I pushed the proto files and build is complaining, not sure if we want to exclude this dir from linting or not?

Testing it formatted so I can try to get this build green.

* Few changes in this one..

1. Moved out ResourcesSpans into the SpanConverter
2. Time is almost fixed, well tests pass but... I learned the clock didn't work as I expected it to. Wall clock and monotonic clock are entirely unrelated. I still think this needs more work but I _think_ it tests that the duration is correctly set on the otlp span.
3. ResourceInfo is now populated on otlp ResourceSpans.

* Fix some of the complaints from static analysis

* Revert "Ran `make style' on proto. Do we want this?"

No, we do not want generated code to be formatted with php-cs-fixer

This reverts commit 996b473ad3.

* make style

* Static analysis fixes

* Hopefully this adds the grpc extension

* Hopefully this adds the grpc extension

* Some Psalm fixes

* Added a few comments; disable testing of InstrumentationLibrary until it's implemented

Co-authored-by: Ritick Gautam <riticksinghrajput@gmail.com>
Co-authored-by: Ritick Gautam <41835832+riticksingh@users.noreply.github.com>
This commit is contained in:
Sean Hood 2021-05-05 19:17:24 +01:00 committed by GitHub
parent a9883f98df
commit 8a135019cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
90 changed files with 10115 additions and 4 deletions

View File

@ -25,7 +25,7 @@ jobs:
php-version: ${{ matrix.php-versions }}
coverage: xdebug
tools: php-cs-fixer
extensions: ast
extensions: ast, grpc
- name: Validate composer.json and composer.lock
run: composer validate

1
.gitignore vendored
View File

@ -6,7 +6,6 @@ vendor
coverage.clover
tests/coverage
.php_cs.cache
proto/*
# W3C Test Service build artifacts
tests/TraceContext/W3CTestService/test_app

View File

@ -309,6 +309,7 @@ return [
// to `exclude_analysis_directory_list`.
'exclude_analysis_directory_list' => [
'vendor/',
'proto/',
],
// Enable this to enable checks of require/include statements referring to valid paths.
@ -360,6 +361,7 @@ return [
'Context',
'sdk',
'contrib',
'proto',
'vendor/composer/xdebug-handler/src',
'vendor/guzzlehttp',
'vendor/psr',

View File

@ -2,6 +2,7 @@
$finder = PhpCsFixer\Finder::create()
->exclude('vendor')
->exclude('var/cache')
->exclude('proto')
->in(__DIR__);
return PhpCsFixer\Config::create()

View File

@ -9,7 +9,9 @@
"guzzlehttp/guzzle": "^7.1.0",
"psr/http-client": "^1.0",
"php-http/guzzle7-adapter": "^0.1.1",
"promphp/prometheus_client_php": "^2.2.1"
"promphp/prometheus_client_php": "^2.2.1",
"grpc/grpc": "^1.30",
"google/protobuf": "^v3.3.0"
},
"authors": [
{
@ -30,7 +32,15 @@
"OpenTelemetry\\Context\\": "Context",
"OpenTelemetry\\": "api",
"OpenTelemetry\\Sdk\\": "sdk",
"OpenTelemetry\\Contrib\\": "contrib"
"OpenTelemetry\\Contrib\\": "contrib",
"Opentelemetry\\Proto\\Collector\\Trace\\V1\\": "proto/Opentelemetry/Proto/Collector/Trace/V1",
"Opentelemetry\\Proto\\Trace\\V1\\":"proto/Opentelemetry/Proto/Trace/V1",
"Opentelemetry\\Proto\\Common\\V1\\":"proto/Opentelemetry/Proto/Common/V1",
"Opentelemetry\\Proto\\Resource\\V1\\":"proto/Opentelemetry/Proto/Resource/V1",
"GPBMetadata\\Opentelemetry\\Proto\\Collector\\Trace\\V1\\": "proto/GPBMetadata/Opentelemetry/Proto/Collector/Trace/V1",
"GPBMetadata\\Opentelemetry\\Proto\\Trace\\V1\\":"proto/GPBMetadata/Opentelemetry/Proto/Trace/V1",
"GPBMetadata\\Opentelemetry\\Proto\\Common\\V1\\":"proto/GPBMetadata/Opentelemetry/Proto/Common/V1",
"GPBMetadata\\Opentelemetry\\Proto\\Resource\\V1\\":"proto/GPBMetadata/Opentelemetry/Proto/Resource/V1"
}
},
"autoload-dev": {

View File

@ -0,0 +1,204 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\OtlpGrpc;
use grpc;
use InvalidArgumentException;
use Opentelemetry\Proto\Collector\Trace\V1\ExportTraceServiceRequest;
use Opentelemetry\Proto\Collector\Trace\V1\TraceServiceClient;
use OpenTelemetry\Sdk\Trace;
use OpenTelemetry\Trace as API;
class Exporter implements Trace\Exporter
{
/**
* @var string
*/
private $endpointURL;
/**
* @var string
*/
private $protocol;
/**
* @var bool|string
*/
private $insecure;
/**
* @var string
*/
private $certificateFile;
/**
* @var string
*/
private $headers;
/**
* @var bool|string
*/
private $compression;
/**
* @var int
*/
private $timeout;
/**
* @var SpanConverter
*/
private $spanConverter;
private $metadata;
/**
* @var bool
*/
private $running = true;
/**
* @var TraceServiceClient
*/
private $client;
/**
* OTLP GRPC Exporter Constructor
*/
public function __construct(
string $endpointURL = 'localhost:4317',
bool $insecure = true,
string $certificateFile = '',
string $headers = '',
bool $compression = false,
int $timeout = 10,
TraceServiceClient $client = null
) {
// Set default values based on presence of env variable
$this->endpointURL = getenv('OTEL_EXPORTER_OTLP_ENDPOINT') ?: $endpointURL;
$this->protocol = getenv('OTEL_EXPORTER_OTLP_PROTOCOL') ?: 'grpc'; // I guess this is redundant?
$this->insecure = getenv('OTEL_EXPORTER_OTLP_INSECURE') ?: $insecure;
$this->certificateFile = getenv('OTEL_EXPORTER_OTLP_CERTIFICATE') ?: $certificateFile;
$this->headers = getenv('OTEL_EXPORTER_OTLP_HEADERS') ?: $headers;
$this->compression = getenv('OTEL_EXPORTER_OTLP_COMPRESSION') ?: $compression;
$this->timeout =(int) getenv('OTEL_EXPORTER_OTLP_TIMEOUT') ?: $timeout;
$this->spanConverter = new SpanConverter();
$this->metadata = $this->metadataFromHeaders($this->headers);
$opts = [
'update_metadata' => function () {
return $this->metadata;
},
'timeout' => $this->timeout,
];
if (!$this->insecure && !$this->certificateFile) {
// Assumed default
$opts['credentials'] = Grpc\ChannelCredentials::createSsl('');
} elseif (!$this->insecure && $this->certificateFile !== '') {
// Should we validate more?
$opts['credentials'] = Grpc\ChannelCredentials::createSsl(file_get_contents($certificateFile));
} else {
$opts['credentials'] = Grpc\ChannelCredentials::createInsecure();
}
if ($this->compression) {
// gzip is the only specified compression method for now
$opts['grpc.default_compression_algorithm'] = 2;
}
$this->client = $client ?? new TraceServiceClient($this->endpointURL, $opts);
}
/**
* Exports the provided Span data via the OTLP protocol
*
* @param iterable<API\Span> $spans Array of Spans
* @return int return code, defined on the Exporter interface
*/
public function export(iterable $spans): int
{
if (!$this->running) {
return Exporter::FAILED_NOT_RETRYABLE;
}
if (empty($spans)) {
return Trace\Exporter::SUCCESS;
}
$resourcespans = [$this->spanConverter->as_otlp_resource_span($spans)];
$request = new ExportTraceServiceRequest([
'resource_spans' => $resourcespans,
]);
list($response, $status) = $this->client->Export($request)->wait();
if ($status->code == \Grpc\STATUS_OK) {
return Trace\Exporter::SUCCESS;
}
if (in_array($status->code, [
\Grpc\STATUS_CANCELLED,
\Grpc\STATUS_DEADLINE_EXCEEDED,
\Grpc\STATUS_PERMISSION_DENIED,
\Grpc\STATUS_RESOURCE_EXHAUSTED,
\Grpc\STATUS_ABORTED,
\Grpc\STATUS_OUT_OF_RANGE,
\Grpc\STATUS_UNAVAILABLE,
\Grpc\STATUS_DATA_LOSS,
\Grpc\STATUS_UNAUTHENTICATED,
])) {
return Trace\Exporter::FAILED_RETRYABLE;
}
return Trace\Exporter::FAILED_NOT_RETRYABLE;
}
public function setHeader($key, $value)
{
$this->metadata[$key] = [$value];
}
public function getHeaders()
{
return $this->metadata;
}
public function metadataFromHeaders($headers): array
{
if (is_array($headers)) {
throw new InvalidArgumentException('Configuring Headers Via');
}
$pairs = explode(',', $headers);
if (!array_key_exists(1, $pairs)) {
return [];
}
$metadata = [];
foreach ($pairs as $pair) {
list($key, $value) = explode('=', $pair, 2);
$metadata[$key] = [$value];
}
return $metadata;
}
public function shutdown(): void
{
$this->running = false;
}
// public function getHeaders()
// {
// return $this->metadataFromHeaders($this->headers);
// }
}

View File

@ -0,0 +1,187 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Contrib\OtlpGrpc;
use Opentelemetry\Proto;
use Opentelemetry\Proto\Common\V1\AnyValue;
use Opentelemetry\Proto\Common\V1\ArrayValue;
use Opentelemetry\Proto\Common\V1\InstrumentationLibrary;
use Opentelemetry\Proto\Common\V1\KeyValue;
use Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans;
use Opentelemetry\Proto\Trace\V1\ResourceSpans;
use Opentelemetry\Proto\Trace\V1\Span as CollectorSpan;
use Opentelemetry\Proto\Trace\V1\Span\Event;
use Opentelemetry\Proto\Trace\V1\Span\SpanKind;
use Opentelemetry\Proto\Trace\V1\Status;
use Opentelemetry\Proto\Trace\V1\Status\StatusCode;
use OpenTelemetry\Sdk\Trace\Span;
use OpenTelemetry\Sdk\Trace\SpanStatus;
class SpanConverter
{
public function as_otlp_key_value($key, $value): KeyValue
{
return new KeyValue([
'key' => $key,
'value' => $this->as_otlp_any_value($value),
]);
}
public function as_otlp_any_value($value): AnyValue
{
$result = new AnyValue();
switch (true) {
case is_array($value):
$values = [];
foreach ($value as $element) {
$this->as_otlp_any_value($element);
}
$result->setArrayValue(new ArrayValue($values));
break;
case is_int($value):
$result->setIntValue($value);
break;
case is_bool($value):
$result->setBoolValue($value);
break;
case is_double($value):
$result->setDoubleValue($value);
break;
case is_string($value):
$result->setStringValue($value);
break;
}
return $result;
}
public function as_otlp_span_kind($kind): int
{
switch ($kind) {
case 0: return SpanKind::SPAN_KIND_INTERNAL;
case 1: return SpanKind::SPAN_KIND_CLIENT;
case 2: return SpanKind::SPAN_KIND_SERVER;
case 3: return SpanKind::SPAN_KIND_PRODUCER;
case 4: return SpanKind::SPAN_KIND_CONSUMER;
}
return SpanKind::SPAN_KIND_UNSPECIFIED;
}
public function as_otlp_span(Span $span): CollectorSpan
{
$end_timestamp = ($span->getStartEpochTimestamp() + $span->getDuration());
$parent_span = $span->getParent();
$parent_span_id = $parent_span ? $parent_span->getSpanId() : false;
$row = [
'trace_id' => hex2bin($span->getContext()->getTraceId()),
'span_id' => hex2bin($span->getContext()->getSpanId()),
'parent_span_id' => $parent_span_id ? hex2bin($parent_span_id) : null,
'name' => $span->getSpanName(),
'start_time_unix_nano' => $span->getStartEpochTimestamp(),
'end_time_unix_nano' => $end_timestamp,
'kind' => $this->as_otlp_span_kind($span->getSpanKind()),
// 'trace_state' => $span->getContext()
// 'links' =>
];
foreach ($span->getEvents() as $event) {
if (!array_key_exists('events', $row)) {
$row['events'] = [];
}
$attrs = [];
foreach ($event->getAttributes() as $k => $v) {
array_push($attrs, $this->as_otlp_key_value($k, $v->getValue()));
}
$row['events'][] = new Event([
'time_unix_nano' => $event->getTimestamp(),
'name' => $event->getName(),
'attributes' => $attrs,
]);
}
foreach ($span->getAttributes() as $k => $v) {
if (!array_key_exists('attributes', $row)) {
$row['attributes'] = [];
}
array_push($row['attributes'], $this->as_otlp_key_value($k, $v->getValue()));
}
$status = new Status();
switch ($span->getStatus()->getCanonicalStatusCode()) {
case SpanStatus::OK:
$status->setCode(StatusCode::STATUS_CODE_OK);
break;
case SpanStatus::ERROR:
$status->setCode(StatusCode::STATUS_CODE_ERROR)->setMessage($span->getStatus()->getStatusDescription());
break;
default:
$status->setCode(StatusCode::STATUS_CODE_UNSET);
}
$row['status'] = $status;
return new CollectorSpan($row);
}
// @return KeyValue[]
public function as_otlp_resource_attributes(iterable $spans): array
{
$attrs = [];
foreach ($spans as $span) {
foreach ($span->getResource()->getAttributes() as $k => $v) {
array_push($attrs, $this->as_otlp_key_value($k, $v->getValue()));
}
}
return $attrs;
}
public function as_otlp_resource_span(iterable $spans): ResourceSpans
{
// TODO: Should return an empty ResourceSpans when $spans is empty
// At the minute it returns an semi populated ResourceSpan
$convertedSpans = [];
foreach ($spans as $span) {
array_push($convertedSpans, $this->as_otlp_span($span));
}
// TODO: Fetch InstrumentationLibrary from the TracerProvider
$il = new InstrumentationLibrary([]);
$ilspans = [];
foreach ($convertedSpans as $convertedSpan) {
$ilspan = new InstrumentationLibrarySpans([
'instrumentation_library' => $il,
'spans' => [$convertedSpan],
]);
array_push($ilspans, $ilspan);
}
return new Proto\Trace\V1\ResourceSpans([
'resource' => new Proto\Resource\V1\Resource([
'attributes' => $this->as_otlp_resource_attributes($spans),
]),
'instrumentation_library_spans' => $ilspans,
]);
}
}

View File

@ -0,0 +1,62 @@
<?php
declare(strict_types=1);
require __DIR__ . '/../vendor/autoload.php';
use OpenTelemetry\Context\Context;
use OpenTelemetry\Contrib\OtlpGrpc\Exporter as OTLPExporter;
use OpenTelemetry\Sdk\Trace\Attributes;
use OpenTelemetry\Sdk\Trace\Clock;
use OpenTelemetry\Sdk\Trace\Sampler\AlwaysOnSampler;
use OpenTelemetry\Sdk\Trace\SamplingResult;
use OpenTelemetry\Sdk\Trace\SpanProcessor\SimpleSpanProcessor;
use OpenTelemetry\Sdk\Trace\TracerProvider;
use OpenTelemetry\Trace as API;
$sampler = new AlwaysOnSampler();
$samplingResult = $sampler->shouldSample(
Context::getCurrent(),
md5((string) microtime(true)),
'io.opentelemetry.example',
API\SpanKind::KIND_INTERNAL
);
$Exporter = new OTLPExporter();
if (SamplingResult::RECORD_AND_SAMPLE === $samplingResult->getDecision()) {
echo 'Starting OTLPGrpcExample';
$tracer = (new TracerProvider())
->addSpanProcessor(new SimpleSpanProcessor($Exporter))
->getTracer('io.opentelemetry.contrib.php');
for ($i = 0; $i < 5; $i++) {
// start a span, register some events
$timestamp = Clock::get()->timestamp();
$span = $tracer->startAndActivateSpan('session.generate.span.' . microtime(true));
$spanParent = $span->getParent();
echo sprintf(
PHP_EOL . 'Exporting Trace: %s, Parent: %s, Span: %s',
$span->getContext()->getTraceId(),
$spanParent ? $spanParent->getSpanId() : 'None',
$span->getContext()->getSpanId()
);
$span->setAttribute('remote_ip', '1.2.3.4')
->setAttribute('country', 'USA');
$span->addEvent('found_login' . $i, $timestamp, new Attributes([
'id' => $i,
'username' => 'otuser' . $i,
]));
$span->addEvent('generated_session', $timestamp, new Attributes([
'id' => md5((string) microtime(true)),
]));
$tracer->endActiveSpan();
}
echo PHP_EOL . 'OTLPGrpcExample complete! ';
} else {
echo PHP_EOL . 'OTLPGrpcExample tracing is not enabled';
}
echo PHP_EOL;

View File

@ -9,6 +9,7 @@ parameters:
excludes_analyse:
- var
- vendor
- proto
- tests/TraceContext/W3CTestService
ignoreErrors:
# PHPStan false positive

View File

@ -0,0 +1,42 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/logs/v1/logs_service.proto
namespace GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1;
class LogsService
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0a8d040a386f70656e74656c656d657472792f70726f746f2f636f6c6c65" .
"63746f722f6c6f67732f76312f6c6f67735f736572766963652e70726f74" .
"6f12256f70656e74656c656d657472792e70726f746f2e636f6c6c656374" .
"6f722e6c6f67732e7631225c0a184578706f72744c6f6773536572766963" .
"655265717565737412400a0d7265736f757263655f6c6f67731801200328" .
"0b32292e6f70656e74656c656d657472792e70726f746f2e6c6f67732e76" .
"312e5265736f757263654c6f6773221b0a194578706f72744c6f67735365" .
"7276696365526573706f6e7365329d010a0b4c6f67735365727669636512" .
"8d010a064578706f7274123f2e6f70656e74656c656d657472792e70726f" .
"746f2e636f6c6c6563746f722e6c6f67732e76312e4578706f72744c6f67" .
"7353657276696365526571756573741a402e6f70656e74656c656d657472" .
"792e70726f746f2e636f6c6c6563746f722e6c6f67732e76312e4578706f" .
"72744c6f677353657276696365526573706f6e736522004286010a28696f" .
"2e6f70656e74656c656d657472792e70726f746f2e636f6c6c6563746f72" .
"2e6c6f67732e763142104c6f67735365727669636550726f746f50015a46" .
"6769746875622e636f6d2f6f70656e2d74656c656d657472792f6f70656e" .
"74656c656d657472792d70726f746f2f67656e2f676f2f636f6c6c656374" .
"6f722f6c6f67732f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,44 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto
namespace GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1;
class MetricsService
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0abd040a3e6f70656e74656c656d657472792f70726f746f2f636f6c6c65" .
"63746f722f6d6574726963732f76312f6d6574726963735f736572766963" .
"652e70726f746f12286f70656e74656c656d657472792e70726f746f2e63" .
"6f6c6c6563746f722e6d6574726963732e763122680a1b4578706f72744d" .
"657472696373536572766963655265717565737412490a107265736f7572" .
"63655f6d65747269637318012003280b322f2e6f70656e74656c656d6574" .
"72792e70726f746f2e6d6574726963732e76312e5265736f757263654d65" .
"7472696373221e0a1c4578706f72744d6574726963735365727669636552" .
"6573706f6e736532ac010a0e4d657472696373536572766963651299010a" .
"064578706f727412452e6f70656e74656c656d657472792e70726f746f2e" .
"636f6c6c6563746f722e6d6574726963732e76312e4578706f72744d6574" .
"7269637353657276696365526571756573741a462e6f70656e74656c656d" .
"657472792e70726f746f2e636f6c6c6563746f722e6d6574726963732e76" .
"312e4578706f72744d65747269637353657276696365526573706f6e7365" .
"2200428f010a2b696f2e6f70656e74656c656d657472792e70726f746f2e" .
"636f6c6c6563746f722e6d6574726963732e763142134d65747269637353" .
"65727669636550726f746f50015a496769746875622e636f6d2f6f70656e" .
"2d74656c656d657472792f6f70656e74656c656d657472792d70726f746f" .
"2f67656e2f676f2f636f6c6c6563746f722f6d6574726963732f76316206" .
"70726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,43 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/trace/v1/trace_service.proto
namespace GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1;
class TraceService
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0a9d040a3a6f70656e74656c656d657472792f70726f746f2f636f6c6c65" .
"63746f722f74726163652f76312f74726163655f736572766963652e7072" .
"6f746f12266f70656e74656c656d657472792e70726f746f2e636f6c6c65" .
"63746f722e74726163652e763122600a194578706f727454726163655365" .
"72766963655265717565737412430a0e7265736f757263655f7370616e73" .
"18012003280b322b2e6f70656e74656c656d657472792e70726f746f2e74" .
"726163652e76312e5265736f757263655370616e73221c0a1a4578706f72" .
"74547261636553657276696365526573706f6e736532a2010a0c54726163" .
"65536572766963651291010a064578706f727412412e6f70656e74656c65" .
"6d657472792e70726f746f2e636f6c6c6563746f722e74726163652e7631" .
"2e4578706f7274547261636553657276696365526571756573741a422e6f" .
"70656e74656c656d657472792e70726f746f2e636f6c6c6563746f722e74" .
"726163652e76312e4578706f727454726163655365727669636552657370" .
"6f6e736522004289010a29696f2e6f70656e74656c656d657472792e7072" .
"6f746f2e636f6c6c6563746f722e74726163652e76314211547261636553" .
"65727669636550726f746f50015a476769746875622e636f6d2f6f70656e" .
"2d74656c656d657472792f6f70656e74656c656d657472792d70726f746f" .
"2f67656e2f676f2f636f6c6c6563746f722f74726163652f763162067072" .
"6f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,49 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace GPBMetadata\Opentelemetry\Proto\Common\V1;
class Common
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
$pool->internalAddGeneratedFile(hex2bin(
"0a86060a2a6f70656e74656c656d657472792f70726f746f2f636f6d6d6f" .
"6e2f76312f636f6d6d6f6e2e70726f746f121d6f70656e74656c656d6574" .
"72792e70726f746f2e636f6d6d6f6e2e763122f5010a08416e7956616c75" .
"6512160a0c737472696e675f76616c7565180120012809480012140a0a62" .
"6f6f6c5f76616c7565180220012808480012130a09696e745f76616c7565" .
"180320012803480012160a0c646f75626c655f76616c7565180420012801" .
"480012400a0b61727261795f76616c756518052001280b32292e6f70656e" .
"74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e41727261" .
"7956616c7565480012430a0c6b766c6973745f76616c756518062001280b" .
"322b2e6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e" .
"76312e4b657956616c75654c697374480042070a0576616c756522450a0a" .
"417272617956616c756512370a0676616c75657318012003280b32272e6f" .
"70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e41" .
"6e7956616c756522470a0c4b657956616c75654c69737412370a0676616c" .
"75657318012003280b32272e6f70656e74656c656d657472792e70726f74" .
"6f2e636f6d6d6f6e2e76312e4b657956616c7565224f0a084b657956616c" .
"7565120b0a036b657918012001280912360a0576616c756518022001280b" .
"32272e6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e" .
"76312e416e7956616c7565222c0a0e537472696e674b657956616c756512" .
"0b0a036b6579180120012809120d0a0576616c756518022001280922370a" .
"16496e737472756d656e746174696f6e4c696272617279120c0a046e616d" .
"65180120012809120f0a0776657273696f6e18022001280942710a20696f" .
"2e6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e7631" .
"420b436f6d6d6f6e50726f746f50015a3e6769746875622e636f6d2f6f70" .
"656e2d74656c656d657472792f6f70656e74656c656d657472792d70726f" .
"746f2f67656e2f676f2f636f6d6d6f6e2f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,83 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace GPBMetadata\Opentelemetry\Proto\Logs\V1;
class Logs
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
\GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0abd0d0a266f70656e74656c656d657472792f70726f746f2f6c6f67732f" .
"76312f6c6f67732e70726f746f121b6f70656e74656c656d657472792e70" .
"726f746f2e6c6f67732e76311a2e6f70656e74656c656d657472792f7072" .
"6f746f2f7265736f757263652f76312f7265736f757263652e70726f746f" .
"22aa010a0c5265736f757263654c6f6773123b0a087265736f7572636518" .
"012001280b32292e6f70656e74656c656d657472792e70726f746f2e7265" .
"736f757263652e76312e5265736f75726365125d0a1c696e737472756d65" .
"6e746174696f6e5f6c6962726172795f6c6f677318022003280b32372e6f" .
"70656e74656c656d657472792e70726f746f2e6c6f67732e76312e496e73" .
"7472756d656e746174696f6e4c6962726172794c6f677322aa010a1a496e" .
"737472756d656e746174696f6e4c6962726172794c6f677312560a17696e" .
"737472756d656e746174696f6e5f6c69627261727918012001280b32352e" .
"6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e" .
"496e737472756d656e746174696f6e4c69627261727912340a046c6f6773" .
"18022003280b32262e6f70656e74656c656d657472792e70726f746f2e6c" .
"6f67732e76312e4c6f675265636f726422d6020a094c6f675265636f7264" .
"12160a0e74696d655f756e69785f6e616e6f18012001280612440a0f7365" .
"7665726974795f6e756d62657218022001280e322b2e6f70656e74656c65" .
"6d657472792e70726f746f2e6c6f67732e76312e53657665726974794e75" .
"6d62657212150a0d73657665726974795f74657874180320012809120c0a" .
"046e616d6518042001280912350a04626f647918052001280b32272e6f70" .
"656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e416e" .
"7956616c7565123b0a0a6174747269627574657318062003280b32272e6f" .
"70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e4b" .
"657956616c756512200a1864726f707065645f617474726962757465735f" .
"636f756e7418072001280d120d0a05666c61677318082001280712100a08" .
"74726163655f696418092001280c120f0a077370616e5f6964180a200128" .
"0c2ac3050a0e53657665726974794e756d626572121f0a1b534556455249" .
"54595f4e554d4245525f554e535045434946494544100012190a15534556" .
"45524954595f4e554d4245525f54524143451001121a0a16534556455249" .
"54595f4e554d4245525f5452414345321002121a0a165345564552495459" .
"5f4e554d4245525f5452414345331003121a0a1653455645524954595f4e" .
"554d4245525f545241434534100412190a1553455645524954595f4e554d" .
"4245525f44454255471005121a0a1653455645524954595f4e554d424552" .
"5f4445425547321006121a0a1653455645524954595f4e554d4245525f44" .
"45425547331007121a0a1653455645524954595f4e554d4245525f444542" .
"554734100812180a1453455645524954595f4e554d4245525f494e464f10" .
"0912190a1553455645524954595f4e554d4245525f494e464f32100a1219" .
"0a1553455645524954595f4e554d4245525f494e464f33100b12190a1553" .
"455645524954595f4e554d4245525f494e464f34100c12180a1453455645" .
"524954595f4e554d4245525f5741524e100d12190a155345564552495459" .
"5f4e554d4245525f5741524e32100e12190a1553455645524954595f4e55" .
"4d4245525f5741524e33100f12190a1553455645524954595f4e554d4245" .
"525f5741524e34101012190a1553455645524954595f4e554d4245525f45" .
"52524f521011121a0a1653455645524954595f4e554d4245525f4552524f" .
"52321012121a0a1653455645524954595f4e554d4245525f4552524f5233" .
"1013121a0a1653455645524954595f4e554d4245525f4552524f52341014" .
"12190a1553455645524954595f4e554d4245525f464154414c1015121a0a" .
"1653455645524954595f4e554d4245525f464154414c321016121a0a1653" .
"455645524954595f4e554d4245525f464154414c331017121a0a16534556" .
"45524954595f4e554d4245525f464154414c3410182a580a0e4c6f675265" .
"636f7264466c616773121f0a1b4c4f475f5245434f52445f464c41475f55" .
"4e535045434946494544100012250a204c4f475f5245434f52445f464c41" .
"475f54524143455f464c4147535f4d41534b10ff01426b0a1e696f2e6f70" .
"656e74656c656d657472792e70726f746f2e6c6f67732e763142094c6f67" .
"7350726f746f50015a3c6769746875622e636f6d2f6f70656e2d74656c65" .
"6d657472792f6f70656e74656c656d657472792d70726f746f2f67656e2f" .
"676f2f6c6f67732f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,59 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace GPBMetadata\Opentelemetry\Proto\Metrics\Experimental;
class MetricsConfigService
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0a8b080a456f70656e74656c656d657472792f70726f746f2f6d65747269" .
"63732f6578706572696d656e74616c2f6d6574726963735f636f6e666967" .
"5f736572766963652e70726f746f12286f70656e74656c656d657472792e" .
"70726f746f2e6d6574726963732e6578706572696d656e74616c22720a13" .
"4d6574726963436f6e66696752657175657374123b0a087265736f757263" .
"6518012001280b32292e6f70656e74656c656d657472792e70726f746f2e" .
"7265736f757263652e76312e5265736f75726365121e0a166c6173745f6b" .
"6e6f776e5f66696e6765727072696e7418022001280c22e0030a144d6574" .
"726963436f6e666967526573706f6e736512130a0b66696e676572707269" .
"6e7418012001280c125a0a097363686564756c657318022003280b32472e" .
"6f70656e74656c656d657472792e70726f746f2e6d6574726963732e6578" .
"706572696d656e74616c2e4d6574726963436f6e666967526573706f6e73" .
"652e5363686564756c65121f0a177375676765737465645f776169745f74" .
"696d655f7365631803200128051ab5020a085363686564756c65126b0a12" .
"6578636c7573696f6e5f7061747465726e7318012003280b324f2e6f7065" .
"6e74656c656d657472792e70726f746f2e6d6574726963732e6578706572" .
"696d656e74616c2e4d6574726963436f6e666967526573706f6e73652e53" .
"63686564756c652e5061747465726e126b0a12696e636c7573696f6e5f70" .
"61747465726e7318022003280b324f2e6f70656e74656c656d657472792e" .
"70726f746f2e6d6574726963732e6578706572696d656e74616c2e4d6574" .
"726963436f6e666967526573706f6e73652e5363686564756c652e506174" .
"7465726e12120a0a706572696f645f7365631803200128051a3b0a075061" .
"747465726e12100a06657175616c73180120012809480012150a0b737461" .
"7274735f77697468180220012809480042070a056d6174636832a1010a0c" .
"4d6574726963436f6e6669671290010a0f4765744d6574726963436f6e66" .
"6967123d2e6f70656e74656c656d657472792e70726f746f2e6d65747269" .
"63732e6578706572696d656e74616c2e4d6574726963436f6e6669675265" .
"71756573741a3e2e6f70656e74656c656d657472792e70726f746f2e6d65" .
"74726963732e6578706572696d656e74616c2e4d6574726963436f6e6669" .
"67526573706f6e73654294010a2b696f2e6f70656e74656c656d65747279" .
"2e70726f746f2e6d6574726963732e6578706572696d656e74616c42184d" .
"6574726963436f6e6669675365727669636550726f746f50015a49676974" .
"6875622e636f6d2f6f70656e2d74656c656d657472792f6f70656e74656c" .
"656d657472792d70726f746f2f67656e2f676f2f6d6574726963732f6578" .
"706572696d656e74616c620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,157 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace GPBMetadata\Opentelemetry\Proto\Metrics\V1;
class Metrics
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
\GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0aea1e0a2c6f70656e74656c656d657472792f70726f746f2f6d65747269" .
"63732f76312f6d6574726963732e70726f746f121e6f70656e74656c656d" .
"657472792e70726f746f2e6d6574726963732e76311a2e6f70656e74656c" .
"656d657472792f70726f746f2f7265736f757263652f76312f7265736f75" .
"7263652e70726f746f22b6010a0f5265736f757263654d65747269637312" .
"3b0a087265736f7572636518012001280b32292e6f70656e74656c656d65" .
"7472792e70726f746f2e7265736f757263652e76312e5265736f75726365" .
"12660a1f696e737472756d656e746174696f6e5f6c6962726172795f6d65" .
"747269637318022003280b323d2e6f70656e74656c656d657472792e7072" .
"6f746f2e6d6574726963732e76312e496e737472756d656e746174696f6e" .
"4c6962726172794d65747269637322b0010a1d496e737472756d656e7461" .
"74696f6e4c6962726172794d65747269637312560a17696e737472756d65" .
"6e746174696f6e5f6c69627261727918012001280b32352e6f70656e7465" .
"6c656d657472792e70726f746f2e636f6d6d6f6e2e76312e496e73747275" .
"6d656e746174696f6e4c69627261727912370a076d657472696373180220" .
"03280b32262e6f70656e74656c656d657472792e70726f746f2e6d657472" .
"6963732e76312e4d657472696322f6030a064d6574726963120c0a046e61" .
"6d6518012001280912130a0b6465736372697074696f6e18022001280912" .
"0c0a04756e697418032001280912410a09696e745f676175676518042001" .
"280b32282e6f70656e74656c656d657472792e70726f746f2e6d65747269" .
"63732e76312e496e74476175676542021801480012360a05676175676518" .
"052001280b32252e6f70656e74656c656d657472792e70726f746f2e6d65" .
"74726963732e76312e47617567654800123d0a07696e745f73756d180620" .
"01280b32262e6f70656e74656c656d657472792e70726f746f2e6d657472" .
"6963732e76312e496e7453756d42021801480012320a0373756d18072001" .
"280b32232e6f70656e74656c656d657472792e70726f746f2e6d65747269" .
"63732e76312e53756d480012490a0d696e745f686973746f6772616d1808" .
"2001280b322c2e6f70656e74656c656d657472792e70726f746f2e6d6574" .
"726963732e76312e496e74486973746f6772616d420218014800123e0a09" .
"686973746f6772616d18092001280b32292e6f70656e74656c656d657472" .
"792e70726f746f2e6d6574726963732e76312e486973746f6772616d4800" .
"123a0a0773756d6d617279180b2001280b32272e6f70656e74656c656d65" .
"7472792e70726f746f2e6d6574726963732e76312e53756d6d6172794800" .
"42060a046461746122510a08496e74476175676512410a0b646174615f70" .
"6f696e747318012003280b322c2e6f70656e74656c656d657472792e7072" .
"6f746f2e6d6574726963732e76312e496e7444617461506f696e743a0218" .
"01224d0a05476175676512440a0b646174615f706f696e74731801200328" .
"0b322f2e6f70656e74656c656d657472792e70726f746f2e6d6574726963" .
"732e76312e4e756d62657244617461506f696e7422be010a06496e745375" .
"6d12410a0b646174615f706f696e747318012003280b322c2e6f70656e74" .
"656c656d657472792e70726f746f2e6d6574726963732e76312e496e7444" .
"617461506f696e7412570a176167677265676174696f6e5f74656d706f72" .
"616c69747918022001280e32362e6f70656e74656c656d657472792e7072" .
"6f746f2e6d6574726963732e76312e4167677265676174696f6e54656d70" .
"6f72616c69747912140a0c69735f6d6f6e6f746f6e69631803200128083a" .
"02180122ba010a0353756d12440a0b646174615f706f696e747318012003" .
"280b322f2e6f70656e74656c656d657472792e70726f746f2e6d65747269" .
"63732e76312e4e756d62657244617461506f696e7412570a176167677265" .
"676174696f6e5f74656d706f72616c69747918022001280e32362e6f7065" .
"6e74656c656d657472792e70726f746f2e6d6574726963732e76312e4167" .
"677265676174696f6e54656d706f72616c69747912140a0c69735f6d6f6e" .
"6f746f6e696318032001280822b7010a0c496e74486973746f6772616d12" .
"4a0a0b646174615f706f696e747318012003280b32352e6f70656e74656c" .
"656d657472792e70726f746f2e6d6574726963732e76312e496e74486973" .
"746f6772616d44617461506f696e7412570a176167677265676174696f6e" .
"5f74656d706f72616c69747918022001280e32362e6f70656e74656c656d" .
"657472792e70726f746f2e6d6574726963732e76312e4167677265676174" .
"696f6e54656d706f72616c6974793a02180122ad010a09486973746f6772" .
"616d12470a0b646174615f706f696e747318012003280b32322e6f70656e" .
"74656c656d657472792e70726f746f2e6d6574726963732e76312e486973" .
"746f6772616d44617461506f696e7412570a176167677265676174696f6e" .
"5f74656d706f72616c69747918022001280e32362e6f70656e74656c656d" .
"657472792e70726f746f2e6d6574726963732e76312e4167677265676174" .
"696f6e54656d706f72616c69747922500a0753756d6d61727912450a0b64" .
"6174615f706f696e747318012003280b32302e6f70656e74656c656d6574" .
"72792e70726f746f2e6d6574726963732e76312e53756d6d617279446174" .
"61506f696e7422d6010a0c496e7444617461506f696e74123d0a066c6162" .
"656c7318012003280b322d2e6f70656e74656c656d657472792e70726f74" .
"6f2e636f6d6d6f6e2e76312e537472696e674b657956616c7565121c0a14" .
"73746172745f74696d655f756e69785f6e616e6f18022001280612160a0e" .
"74696d655f756e69785f6e616e6f180320012806120d0a0576616c756518" .
"0420012810123e0a096578656d706c61727318052003280b322b2e6f7065" .
"6e74656c656d657472792e70726f746f2e6d6574726963732e76312e496e" .
"744578656d706c61723a02180122f3010a0f4e756d62657244617461506f" .
"696e74123d0a066c6162656c7318012003280b322d2e6f70656e74656c65" .
"6d657472792e70726f746f2e636f6d6d6f6e2e76312e537472696e674b65" .
"7956616c7565121c0a1473746172745f74696d655f756e69785f6e616e6f" .
"18022001280612160a0e74696d655f756e69785f6e616e6f180320012806" .
"12130a0961735f646f75626c65180420012801480012100a0661735f696e" .
"741806200128104800123b0a096578656d706c61727318052003280b3228" .
"2e6f70656e74656c656d657472792e70726f746f2e6d6574726963732e76" .
"312e4578656d706c617242070a0576616c7565229c020a15496e74486973" .
"746f6772616d44617461506f696e74123d0a066c6162656c731801200328" .
"0b322d2e6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e" .
"2e76312e537472696e674b657956616c7565121c0a1473746172745f7469" .
"6d655f756e69785f6e616e6f18022001280612160a0e74696d655f756e69" .
"785f6e616e6f180320012806120d0a05636f756e74180420012806120b0a" .
"0373756d18052001281012150a0d6275636b65745f636f756e7473180620" .
"03280612170a0f6578706c696369745f626f756e6473180720032801123e" .
"0a096578656d706c61727318082003280b322b2e6f70656e74656c656d65" .
"7472792e70726f746f2e6d6574726963732e76312e496e744578656d706c" .
"61723a0218012292020a12486973746f6772616d44617461506f696e7412" .
"3d0a066c6162656c7318012003280b322d2e6f70656e74656c656d657472" .
"792e70726f746f2e636f6d6d6f6e2e76312e537472696e674b657956616c" .
"7565121c0a1473746172745f74696d655f756e69785f6e616e6f18022001" .
"280612160a0e74696d655f756e69785f6e616e6f180320012806120d0a05" .
"636f756e74180420012806120b0a0373756d18052001280112150a0d6275" .
"636b65745f636f756e747318062003280612170a0f6578706c696369745f" .
"626f756e6473180720032801123b0a096578656d706c6172731808200328" .
"0b32282e6f70656e74656c656d657472792e70726f746f2e6d6574726963" .
"732e76312e4578656d706c617222b2020a1053756d6d6172794461746150" .
"6f696e74123d0a066c6162656c7318012003280b322d2e6f70656e74656c" .
"656d657472792e70726f746f2e636f6d6d6f6e2e76312e537472696e674b" .
"657956616c7565121c0a1473746172745f74696d655f756e69785f6e616e" .
"6f18022001280612160a0e74696d655f756e69785f6e616e6f1803200128" .
"06120d0a05636f756e74180420012806120b0a0373756d18052001280112" .
"590a0f7175616e74696c655f76616c75657318062003280b32402e6f7065" .
"6e74656c656d657472792e70726f746f2e6d6574726963732e76312e5375" .
"6d6d61727944617461506f696e742e56616c756541745175616e74696c65" .
"1a320a0f56616c756541745175616e74696c6512100a087175616e74696c" .
"65180120012801120d0a0576616c756518022001280122a3010a0b496e74" .
"4578656d706c617212460a0f66696c74657265645f6c6162656c73180120" .
"03280b322d2e6f70656e74656c656d657472792e70726f746f2e636f6d6d" .
"6f6e2e76312e537472696e674b657956616c756512160a0e74696d655f75" .
"6e69785f6e616e6f180220012806120d0a0576616c756518032001281012" .
"0f0a077370616e5f696418042001280c12100a0874726163655f69641805" .
"2001280c3a02180122bd010a084578656d706c617212460a0f66696c7465" .
"7265645f6c6162656c7318012003280b322d2e6f70656e74656c656d6574" .
"72792e70726f746f2e636f6d6d6f6e2e76312e537472696e674b65795661" .
"6c756512160a0e74696d655f756e69785f6e616e6f18022001280612130a" .
"0961735f646f75626c65180320012801480012100a0661735f696e741806" .
"200128104800120f0a077370616e5f696418042001280c12100a08747261" .
"63655f696418052001280c42070a0576616c75652a8c010a164167677265" .
"676174696f6e54656d706f72616c69747912270a23414747524547415449" .
"4f4e5f54454d504f52414c4954595f554e53504543494649454410001221" .
"0a1d4147475245474154494f4e5f54454d504f52414c4954595f44454c54" .
"41100112260a224147475245474154494f4e5f54454d504f52414c495459" .
"5f43554d554c4154495645100242740a21696f2e6f70656e74656c656d65" .
"7472792e70726f746f2e6d6574726963732e7631420c4d65747269637350" .
"726f746f50015a3f6769746875622e636f6d2f6f70656e2d74656c656d65" .
"7472792f6f70656e74656c656d657472792d70726f746f2f67656e2f676f" .
"2f6d6574726963732f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,35 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/resource/v1/resource.proto
namespace GPBMetadata\Opentelemetry\Proto\Resource\V1;
class Resource
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0abd020a2e6f70656e74656c656d657472792f70726f746f2f7265736f75" .
"7263652f76312f7265736f757263652e70726f746f121f6f70656e74656c" .
"656d657472792e70726f746f2e7265736f757263652e763122690a085265" .
"736f75726365123b0a0a6174747269627574657318012003280b32272e6f" .
"70656e74656c656d657472792e70726f746f2e636f6d6d6f6e2e76312e4b" .
"657956616c756512200a1864726f707065645f617474726962757465735f" .
"636f756e7418022001280d42770a22696f2e6f70656e74656c656d657472" .
"792e70726f746f2e7265736f757263652e7631420d5265736f7572636550" .
"726f746f50015a406769746875622e636f6d2f6f70656e2d74656c656d65" .
"7472792f6f70656e74656c656d657472792d70726f746f2f67656e2f676f" .
"2f7265736f757263652f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,112 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace GPBMetadata\Opentelemetry\Proto\Trace\V1;
class Trace
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
\GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce();
$pool->internalAddGeneratedFile(hex2bin(
"0a95140a286f70656e74656c656d657472792f70726f746f2f7472616365" .
"2f76312f74726163652e70726f746f121c6f70656e74656c656d65747279" .
"2e70726f746f2e74726163652e76311a2e6f70656e74656c656d65747279" .
"2f70726f746f2f7265736f757263652f76312f7265736f757263652e7072" .
"6f746f22ae010a0d5265736f757263655370616e73123b0a087265736f75" .
"72636518012001280b32292e6f70656e74656c656d657472792e70726f74" .
"6f2e7265736f757263652e76312e5265736f7572636512600a1d696e7374" .
"72756d656e746174696f6e5f6c6962726172795f7370616e731802200328" .
"0b32392e6f70656e74656c656d657472792e70726f746f2e74726163652e" .
"76312e496e737472756d656e746174696f6e4c6962726172795370616e73" .
"22a8010a1b496e737472756d656e746174696f6e4c696272617279537061" .
"6e7312560a17696e737472756d656e746174696f6e5f6c69627261727918" .
"012001280b32352e6f70656e74656c656d657472792e70726f746f2e636f" .
"6d6d6f6e2e76312e496e737472756d656e746174696f6e4c696272617279" .
"12310a057370616e7318022003280b32222e6f70656e74656c656d657472" .
"792e70726f746f2e74726163652e76312e5370616e22e6070a045370616e" .
"12100a0874726163655f696418012001280c120f0a077370616e5f696418" .
"022001280c12130a0b74726163655f737461746518032001280912160a0e" .
"706172656e745f7370616e5f696418042001280c120c0a046e616d651805" .
"2001280912390a046b696e6418062001280e322b2e6f70656e74656c656d" .
"657472792e70726f746f2e74726163652e76312e5370616e2e5370616e4b" .
"696e64121c0a1473746172745f74696d655f756e69785f6e616e6f180720" .
"012806121a0a12656e645f74696d655f756e69785f6e616e6f1808200128" .
"06123b0a0a6174747269627574657318092003280b32272e6f70656e7465" .
"6c656d657472792e70726f746f2e636f6d6d6f6e2e76312e4b657956616c" .
"756512200a1864726f707065645f617474726962757465735f636f756e74" .
"180a2001280d12380a066576656e7473180b2003280b32282e6f70656e74" .
"656c656d657472792e70726f746f2e74726163652e76312e5370616e2e45" .
"76656e74121c0a1464726f707065645f6576656e74735f636f756e74180c" .
"2001280d12360a056c696e6b73180d2003280b32272e6f70656e74656c65" .
"6d657472792e70726f746f2e74726163652e76312e5370616e2e4c696e6b" .
"121b0a1364726f707065645f6c696e6b735f636f756e74180e2001280d12" .
"340a06737461747573180f2001280b32242e6f70656e74656c656d657472" .
"792e70726f746f2e74726163652e76312e5374617475731a8c010a054576" .
"656e7412160a0e74696d655f756e69785f6e616e6f180120012806120c0a" .
"046e616d65180220012809123b0a0a617474726962757465731803200328" .
"0b32272e6f70656e74656c656d657472792e70726f746f2e636f6d6d6f6e" .
"2e76312e4b657956616c756512200a1864726f707065645f617474726962" .
"757465735f636f756e7418042001280d1a9d010a044c696e6b12100a0874" .
"726163655f696418012001280c120f0a077370616e5f696418022001280c" .
"12130a0b74726163655f7374617465180320012809123b0a0a6174747269" .
"627574657318042003280b32272e6f70656e74656c656d657472792e7072" .
"6f746f2e636f6d6d6f6e2e76312e4b657956616c756512200a1864726f70" .
"7065645f617474726962757465735f636f756e7418052001280d2299010a" .
"085370616e4b696e6412190a155350414e5f4b494e445f554e5350454349" .
"46494544100012160a125350414e5f4b494e445f494e5445524e414c1001" .
"12140a105350414e5f4b494e445f534552564552100212140a105350414e" .
"5f4b494e445f434c49454e54100312160a125350414e5f4b494e445f5052" .
"4f4455434552100412160a125350414e5f4b494e445f434f4e53554d4552" .
"100522dd070a0653746174757312560a0f646570726563617465645f636f" .
"646518012001280e32392e6f70656e74656c656d657472792e70726f746f" .
"2e74726163652e76312e5374617475732e44657072656361746564537461" .
"747573436f646542021801120f0a076d657373616765180220012809123d" .
"0a04636f646518032001280e322f2e6f70656e74656c656d657472792e70" .
"726f746f2e74726163652e76312e5374617475732e537461747573436f64" .
"6522da050a1444657072656361746564537461747573436f6465121d0a19" .
"444550524543415445445f5354415455535f434f44455f4f4b100012240a" .
"20444550524543415445445f5354415455535f434f44455f43414e43454c" .
"4c4544100112280a24444550524543415445445f5354415455535f434f44" .
"455f554e4b4e4f574e5f4552524f521002122b0a27444550524543415445" .
"445f5354415455535f434f44455f494e56414c49445f415247554d454e54" .
"1003122c0a28444550524543415445445f5354415455535f434f44455f44" .
"4541444c494e455f4558434545444544100412240a204445505245434154" .
"45445f5354415455535f434f44455f4e4f545f464f554e44100512290a25" .
"444550524543415445445f5354415455535f434f44455f414c5245414459" .
"5f4558495354531006122c0a28444550524543415445445f535441545553" .
"5f434f44455f5045524d495353494f4e5f44454e4945441007122d0a2944" .
"4550524543415445445f5354415455535f434f44455f5245534f55524345" .
"5f4558484155535445441008122e0a2a444550524543415445445f535441" .
"5455535f434f44455f4641494c45445f505245434f4e444954494f4e1009" .
"12220a1e444550524543415445445f5354415455535f434f44455f41424f" .
"52544544100a12270a23444550524543415445445f5354415455535f434f" .
"44455f4f55545f4f465f52414e4745100b12280a24444550524543415445" .
"445f5354415455535f434f44455f554e494d504c454d454e544544100c12" .
"290a25444550524543415445445f5354415455535f434f44455f494e5445" .
"524e414c5f4552524f52100d12260a22444550524543415445445f535441" .
"5455535f434f44455f554e415641494c41424c45100e12240a2044455052" .
"4543415445445f5354415455535f434f44455f444154415f4c4f5353100f" .
"122a0a26444550524543415445445f5354415455535f434f44455f554e41" .
"555448454e544943415445441010224e0a0a537461747573436f64651215" .
"0a115354415455535f434f44455f554e534554100012120a0e5354415455" .
"535f434f44455f4f4b100112150a115354415455535f434f44455f455252" .
"4f521002426e0a1f696f2e6f70656e74656c656d657472792e70726f746f" .
"2e74726163652e7631420a547261636550726f746f50015a3d6769746875" .
"622e636f6d2f6f70656e2d74656c656d657472792f6f70656e74656c656d" .
"657472792d70726f746f2f67656e2f676f2f74726163652f763162067072" .
"6f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,54 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace GPBMetadata\Opentelemetry\Proto\Trace\V1;
class TraceConfig
{
public static $is_initialized = false;
public static function initOnce() {
$pool = \Google\Protobuf\Internal\DescriptorPool::getGeneratedPool();
if (static::$is_initialized == true) {
return;
}
$pool->internalAddGeneratedFile(hex2bin(
"0a9e070a2f6f70656e74656c656d657472792f70726f746f2f7472616365" .
"2f76312f74726163655f636f6e6669672e70726f746f121c6f70656e7465" .
"6c656d657472792e70726f746f2e74726163652e763122c8030a0b547261" .
"6365436f6e66696712490a10636f6e7374616e745f73616d706c65721801" .
"2001280b322d2e6f70656e74656c656d657472792e70726f746f2e747261" .
"63652e76312e436f6e7374616e7453616d706c65724800124f0a14747261" .
"63655f69645f726174696f5f626173656418022001280b322f2e6f70656e" .
"74656c656d657472792e70726f746f2e74726163652e76312e5472616365" .
"4964526174696f4261736564480012520a15726174655f6c696d6974696e" .
"675f73616d706c657218032001280b32312e6f70656e74656c656d657472" .
"792e70726f746f2e74726163652e76312e526174654c696d6974696e6753" .
"616d706c6572480012200a186d61785f6e756d6265725f6f665f61747472" .
"69627574657318042001280312220a1a6d61785f6e756d6265725f6f665f" .
"74696d65645f6576656e747318052001280312300a286d61785f6e756d62" .
"65725f6f665f617474726962757465735f7065725f74696d65645f657665" .
"6e74180620012803121b0a136d61785f6e756d6265725f6f665f6c696e6b" .
"7318072001280312290a216d61785f6e756d6265725f6f665f6174747269" .
"62757465735f7065725f6c696e6b18082001280342090a0773616d706c65" .
"7222a9010a0f436f6e7374616e7453616d706c657212500a086465636973" .
"696f6e18012001280e323e2e6f70656e74656c656d657472792e70726f74" .
"6f2e74726163652e76312e436f6e7374616e7453616d706c65722e436f6e" .
"7374616e744465636973696f6e22440a10436f6e7374616e744465636973" .
"696f6e120e0a0a414c574159535f4f46461000120d0a09414c574159535f" .
"4f4e100112110a0d414c574159535f504152454e541002222a0a11547261" .
"63654964526174696f426173656412150a0d73616d706c696e6752617469" .
"6f18012001280122220a13526174654c696d6974696e6753616d706c6572" .
"120b0a03717073180120012803427e0a1f696f2e6f70656e74656c656d65" .
"7472792e70726f746f2e74726163652e763142105472616365436f6e6669" .
"6750726f746f50015a476769746875622e636f6d2f6f70656e2d74656c65" .
"6d657472792f6f70656e74656c656d657472792d70726f746f2f67656e2f" .
"676f2f636f6c6c6563746f722f74726163652f7631620670726f746f33"
));
static::$is_initialized = true;
}
}

View File

@ -0,0 +1,81 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/logs/v1/logs_service.proto
namespace Opentelemetry\Proto\Collector\Logs\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest</code>
*/
class ExportLogsServiceRequest extends \Google\Protobuf\Internal\Message
{
/**
* An array of ResourceLogs.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1;</code>
*/
private $resource_logs;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $resource_logs
* An array of ResourceLogs.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1\LogsService::initOnce();
parent::__construct($data);
}
/**
* An array of ResourceLogs.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getResourceLogs()
{
return $this->resource_logs;
}
/**
* An array of ResourceLogs.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.ResourceLogs resource_logs = 1;</code>
* @param \Opentelemetry\Proto\Logs\V1\ResourceLogs[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setResourceLogs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\ResourceLogs::class);
$this->resource_logs = $arr;
return $this;
}
}

View File

@ -0,0 +1,31 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/logs/v1/logs_service.proto
namespace Opentelemetry\Proto\Collector\Logs\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse</code>
*/
class ExportLogsServiceResponse extends \Google\Protobuf\Internal\Message
{
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Logs\V1\LogsService::initOnce();
parent::__construct($data);
}
}

View File

@ -0,0 +1,52 @@
<?php
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// Copyright 2020, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace Opentelemetry\Proto\Collector\Logs\V1;
/**
* Service that can be used to push logs between one Application instrumented with
* OpenTelemetry and an collector, or between an collector and a central collector (in this
* case logs are sent/received to/from multiple Applications).
*/
class LogsServiceClient extends \Grpc\BaseStub {
/**
* @param string $hostname hostname
* @param array $opts channel options
* @param \Grpc\Channel $channel (optional) re-use channel object
*/
public function __construct($hostname, $opts, $channel = null) {
parent::__construct($hostname, $opts, $channel);
}
/**
* For performance reasons, it is recommended to keep this RPC
* alive for the entire life of the application.
* @param \Opentelemetry\Proto\Collector\Logs\V1\ExportLogsServiceRequest $argument input argument
* @param array $metadata metadata
* @param array $options call options
*/
public function Export(\Opentelemetry\Proto\Collector\Logs\V1\ExportLogsServiceRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/opentelemetry.proto.collector.logs.v1.LogsService/Export',
$argument,
['\Opentelemetry\Proto\Collector\Logs\V1\ExportLogsServiceResponse', 'decode'],
$metadata, $options);
}
}

View File

@ -0,0 +1,81 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto
namespace Opentelemetry\Proto\Collector\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest</code>
*/
class ExportMetricsServiceRequest extends \Google\Protobuf\Internal\Message
{
/**
* An array of ResourceMetrics.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;</code>
*/
private $resource_metrics;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $resource_metrics
* An array of ResourceMetrics.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1\MetricsService::initOnce();
parent::__construct($data);
}
/**
* An array of ResourceMetrics.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getResourceMetrics()
{
return $this->resource_metrics;
}
/**
* An array of ResourceMetrics.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.ResourceMetrics resource_metrics = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\ResourceMetrics[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setResourceMetrics($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\ResourceMetrics::class);
$this->resource_metrics = $arr;
return $this;
}
}

View File

@ -0,0 +1,31 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/metrics/v1/metrics_service.proto
namespace Opentelemetry\Proto\Collector\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse</code>
*/
class ExportMetricsServiceResponse extends \Google\Protobuf\Internal\Message
{
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Metrics\V1\MetricsService::initOnce();
parent::__construct($data);
}
}

View File

@ -0,0 +1,52 @@
<?php
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace Opentelemetry\Proto\Collector\Metrics\V1;
/**
* Service that can be used to push metrics between one Application
* instrumented with OpenTelemetry and a collector, or between a collector and a
* central collector.
*/
class MetricsServiceClient extends \Grpc\BaseStub {
/**
* @param string $hostname hostname
* @param array $opts channel options
* @param \Grpc\Channel $channel (optional) re-use channel object
*/
public function __construct($hostname, $opts, $channel = null) {
parent::__construct($hostname, $opts, $channel);
}
/**
* For performance reasons, it is recommended to keep this RPC
* alive for the entire life of the application.
* @param \Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsServiceRequest $argument input argument
* @param array $metadata metadata
* @param array $options call options
*/
public function Export(\Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsServiceRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/opentelemetry.proto.collector.metrics.v1.MetricsService/Export',
$argument,
['\Opentelemetry\Proto\Collector\Metrics\V1\ExportMetricsServiceResponse', 'decode'],
$metadata, $options);
}
}

View File

@ -0,0 +1,81 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/trace/v1/trace_service.proto
namespace Opentelemetry\Proto\Collector\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest</code>
*/
class ExportTraceServiceRequest extends \Google\Protobuf\Internal\Message
{
/**
* An array of ResourceSpans.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1;</code>
*/
private $resource_spans;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $resource_spans
* An array of ResourceSpans.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1\TraceService::initOnce();
parent::__construct($data);
}
/**
* An array of ResourceSpans.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getResourceSpans()
{
return $this->resource_spans;
}
/**
* An array of ResourceSpans.
* For data coming from a single resource this array will typically contain one
* element. Intermediary nodes (such as OpenTelemetry Collector) that receive
* data from multiple origins typically batch the data before forwarding further and
* in that case this array will contain multiple elements.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.ResourceSpans resource_spans = 1;</code>
* @param \Opentelemetry\Proto\Trace\V1\ResourceSpans[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setResourceSpans($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\ResourceSpans::class);
$this->resource_spans = $arr;
return $this;
}
}

View File

@ -0,0 +1,31 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/collector/trace/v1/trace_service.proto
namespace Opentelemetry\Proto\Collector\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse</code>
*/
class ExportTraceServiceResponse extends \Google\Protobuf\Internal\Message
{
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Collector\Trace\V1\TraceService::initOnce();
parent::__construct($data);
}
}

View File

@ -0,0 +1,52 @@
<?php
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace Opentelemetry\Proto\Collector\Trace\V1;
/**
* Service that can be used to push spans between one Application instrumented with
* OpenTelemetry and an collector, or between an collector and a central collector (in this
* case spans are sent/received to/from multiple Applications).
*/
class TraceServiceClient extends \Grpc\BaseStub {
/**
* @param string $hostname hostname
* @param array $opts channel options
* @param \Grpc\Channel $channel (optional) re-use channel object
*/
public function __construct($hostname, $opts, $channel = null) {
parent::__construct($hostname, $opts, $channel);
}
/**
* For performance reasons, it is recommended to keep this RPC
* alive for the entire life of the application.
* @param \Opentelemetry\Proto\Collector\Trace\V1\ExportTraceServiceRequest $argument input argument
* @param array $metadata metadata
* @param array $options call options
*/
public function Export(\Opentelemetry\Proto\Collector\Trace\V1\ExportTraceServiceRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/opentelemetry.proto.collector.trace.v1.TraceService/Export',
$argument,
['\Opentelemetry\Proto\Collector\Trace\V1\ExportTraceServiceResponse', 'decode'],
$metadata, $options);
}
}

View File

@ -0,0 +1,182 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* AnyValue is used to represent any type of attribute value. AnyValue may contain a
* primitive value such as a string or integer or it may contain an arbitrary nested
* object containing arrays, key-value lists and primitives.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.AnyValue</code>
*/
class AnyValue extends \Google\Protobuf\Internal\Message
{
protected $value;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $string_value
* @type bool $bool_value
* @type int|string $int_value
* @type float $double_value
* @type \Opentelemetry\Proto\Common\V1\ArrayValue $array_value
* @type \Opentelemetry\Proto\Common\V1\KeyValueList $kvlist_value
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>string string_value = 1;</code>
* @return string
*/
public function getStringValue()
{
return $this->readOneof(1);
}
/**
* Generated from protobuf field <code>string string_value = 1;</code>
* @param string $var
* @return $this
*/
public function setStringValue($var)
{
GPBUtil::checkString($var, True);
$this->writeOneof(1, $var);
return $this;
}
/**
* Generated from protobuf field <code>bool bool_value = 2;</code>
* @return bool
*/
public function getBoolValue()
{
return $this->readOneof(2);
}
/**
* Generated from protobuf field <code>bool bool_value = 2;</code>
* @param bool $var
* @return $this
*/
public function setBoolValue($var)
{
GPBUtil::checkBool($var);
$this->writeOneof(2, $var);
return $this;
}
/**
* Generated from protobuf field <code>int64 int_value = 3;</code>
* @return int|string
*/
public function getIntValue()
{
return $this->readOneof(3);
}
/**
* Generated from protobuf field <code>int64 int_value = 3;</code>
* @param int|string $var
* @return $this
*/
public function setIntValue($var)
{
GPBUtil::checkInt64($var);
$this->writeOneof(3, $var);
return $this;
}
/**
* Generated from protobuf field <code>double double_value = 4;</code>
* @return float
*/
public function getDoubleValue()
{
return $this->readOneof(4);
}
/**
* Generated from protobuf field <code>double double_value = 4;</code>
* @param float $var
* @return $this
*/
public function setDoubleValue($var)
{
GPBUtil::checkDouble($var);
$this->writeOneof(4, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.ArrayValue array_value = 5;</code>
* @return \Opentelemetry\Proto\Common\V1\ArrayValue
*/
public function getArrayValue()
{
return $this->readOneof(5);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.ArrayValue array_value = 5;</code>
* @param \Opentelemetry\Proto\Common\V1\ArrayValue $var
* @return $this
*/
public function setArrayValue($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\ArrayValue::class);
$this->writeOneof(5, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6;</code>
* @return \Opentelemetry\Proto\Common\V1\KeyValueList
*/
public function getKvlistValue()
{
return $this->readOneof(6);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.KeyValueList kvlist_value = 6;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValueList $var
* @return $this
*/
public function setKvlistValue($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\KeyValueList::class);
$this->writeOneof(6, $var);
return $this;
}
/**
* @return string
*/
public function getValue()
{
return $this->whichOneof("value");
}
}

View File

@ -0,0 +1,68 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* ArrayValue is a list of AnyValue messages. We need ArrayValue as a message
* since oneof in AnyValue does not allow repeated fields.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.ArrayValue</code>
*/
class ArrayValue extends \Google\Protobuf\Internal\Message
{
/**
* Array of values. The array may be empty (contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.AnyValue values = 1;</code>
*/
private $values;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\AnyValue[]|\Google\Protobuf\Internal\RepeatedField $values
* Array of values. The array may be empty (contain 0 elements).
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* Array of values. The array may be empty (contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.AnyValue values = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getValues()
{
return $this->values;
}
/**
* Array of values. The array may be empty (contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.AnyValue values = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\AnyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\AnyValue::class);
$this->values = $arr;
return $this;
}
}

View File

@ -0,0 +1,95 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* InstrumentationLibrary is a message representing the instrumentation library information
* such as the fully qualified name and version.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.InstrumentationLibrary</code>
*/
class InstrumentationLibrary extends \Google\Protobuf\Internal\Message
{
/**
* An empty instrumentation library name means the name is unknown.
*
* Generated from protobuf field <code>string name = 1;</code>
*/
private $name = '';
/**
* Generated from protobuf field <code>string version = 2;</code>
*/
private $version = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* An empty instrumentation library name means the name is unknown.
* @type string $version
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* An empty instrumentation library name means the name is unknown.
*
* Generated from protobuf field <code>string name = 1;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* An empty instrumentation library name means the name is unknown.
*
* Generated from protobuf field <code>string name = 1;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* Generated from protobuf field <code>string version = 2;</code>
* @return string
*/
public function getVersion()
{
return $this->version;
}
/**
* Generated from protobuf field <code>string version = 2;</code>
* @param string $var
* @return $this
*/
public function setVersion($var)
{
GPBUtil::checkString($var, True);
$this->version = $var;
return $this;
}
}

View File

@ -0,0 +1,88 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* KeyValue is a key-value pair that is used to store Span attributes, Link
* attributes, etc.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.KeyValue</code>
*/
class KeyValue extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>string key = 1;</code>
*/
private $key = '';
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue value = 2;</code>
*/
private $value = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $key
* @type \Opentelemetry\Proto\Common\V1\AnyValue $value
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>string key = 1;</code>
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* Generated from protobuf field <code>string key = 1;</code>
* @param string $var
* @return $this
*/
public function setKey($var)
{
GPBUtil::checkString($var, True);
$this->key = $var;
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue value = 2;</code>
* @return \Opentelemetry\Proto\Common\V1\AnyValue
*/
public function getValue()
{
return $this->value;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue value = 2;</code>
* @param \Opentelemetry\Proto\Common\V1\AnyValue $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\AnyValue::class);
$this->value = $var;
return $this;
}
}

View File

@ -0,0 +1,75 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* KeyValueList is a list of KeyValue messages. We need KeyValueList as a message
* since `oneof` in AnyValue does not allow repeated fields. Everywhere else where we need
* a list of KeyValue messages (e.g. in Span) we use `repeated KeyValue` directly to
* avoid unnecessary extra wrapping (which slows down the protocol). The 2 approaches
* are semantically equivalent.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.KeyValueList</code>
*/
class KeyValueList extends \Google\Protobuf\Internal\Message
{
/**
* A collection of key/value pairs of key-value pairs. The list may be empty (may
* contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue values = 1;</code>
*/
private $values;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $values
* A collection of key/value pairs of key-value pairs. The list may be empty (may
* contain 0 elements).
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* A collection of key/value pairs of key-value pairs. The list may be empty (may
* contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue values = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getValues()
{
return $this->values;
}
/**
* A collection of key/value pairs of key-value pairs. The list may be empty (may
* contain 0 elements).
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue values = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->values = $arr;
return $this;
}
}

View File

@ -0,0 +1,88 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/common/v1/common.proto
namespace Opentelemetry\Proto\Common\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* StringKeyValue is a pair of key/value strings. This is the simpler (and faster) version
* of KeyValue that only supports string values.
*
* Generated from protobuf message <code>opentelemetry.proto.common.v1.StringKeyValue</code>
*/
class StringKeyValue extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>string key = 1;</code>
*/
private $key = '';
/**
* Generated from protobuf field <code>string value = 2;</code>
*/
private $value = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $key
* @type string $value
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Common\V1\Common::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>string key = 1;</code>
* @return string
*/
public function getKey()
{
return $this->key;
}
/**
* Generated from protobuf field <code>string key = 1;</code>
* @param string $var
* @return $this
*/
public function setKey($var)
{
GPBUtil::checkString($var, True);
$this->key = $var;
return $this;
}
/**
* Generated from protobuf field <code>string value = 2;</code>
* @return string
*/
public function getValue()
{
return $this->value;
}
/**
* Generated from protobuf field <code>string value = 2;</code>
* @param string $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkString($var, True);
$this->value = $var;
return $this;
}
}

View File

@ -0,0 +1,109 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace Opentelemetry\Proto\Logs\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of Logs produced by an InstrumentationLibrary.
*
* Generated from protobuf message <code>opentelemetry.proto.logs.v1.InstrumentationLibraryLogs</code>
*/
class InstrumentationLibraryLogs extends \Google\Protobuf\Internal\Message
{
/**
* The instrumentation library information for the logs in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
*/
private $instrumentation_library = null;
/**
* A list of log records.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2;</code>
*/
private $logs;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library
* The instrumentation library information for the logs in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
* @type \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $logs
* A list of log records.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce();
parent::__construct($data);
}
/**
* The instrumentation library information for the logs in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary
*/
public function getInstrumentationLibrary()
{
return $this->instrumentation_library;
}
/**
* The instrumentation library information for the logs in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var
* @return $this
*/
public function setInstrumentationLibrary($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class);
$this->instrumentation_library = $var;
return $this;
}
/**
* A list of log records.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLogs()
{
return $this->logs;
}
/**
* A list of log records.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.LogRecord logs = 2;</code>
* @param \Opentelemetry\Proto\Logs\V1\LogRecord[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLogs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\LogRecord::class);
$this->logs = $arr;
return $this;
}
}

View File

@ -0,0 +1,439 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace Opentelemetry\Proto\Logs\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A log record according to OpenTelemetry Log Data Model:
* https://github.com/open-telemetry/oteps/blob/main/text/logs/0097-log-data-model.md
*
* Generated from protobuf message <code>opentelemetry.proto.logs.v1.LogRecord</code>
*/
class LogRecord extends \Google\Protobuf\Internal\Message
{
/**
* time_unix_nano is the time when the event occurred.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* Value of 0 indicates unknown or missing timestamp.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
*/
private $time_unix_nano = 0;
/**
* Numerical value of the severity, normalized to values described in Log Data Model.
* [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
*/
private $severity_number = 0;
/**
* The severity text (also known as log level). The original string representation as
* it is known at the source. [Optional].
*
* Generated from protobuf field <code>string severity_text = 3;</code>
*/
private $severity_text = '';
/**
* Short event identifier that does not contain varying parts. Name describes
* what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
* characters. Not guaranteed to be unique in any way. [Optional].
*
* Generated from protobuf field <code>string name = 4;</code>
*/
private $name = '';
/**
* A value containing the body of the log record. Can be for example a human-readable
* string message (including multi-line) describing the event in a free form or it can
* be a structured data composed of arrays and maps of other values. [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
*/
private $body = null;
/**
* Additional attributes that describe the specific event occurrence. [Optional].
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
*/
private $attributes;
/**
* Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
*/
private $dropped_attributes_count = 0;
/**
* Flags, a bit field. 8 least significant bits are the trace flags as
* defined in W3C Trace Context specification. 24 most significant bits are reserved
* and must be set to 0. Readers must not assume that 24 most significant bits
* will be zero and must correctly mask the bits when reading 8-bit trace flag (use
* flags & TRACE_FLAGS_MASK). [Optional].
*
* Generated from protobuf field <code>fixed32 flags = 8;</code>
*/
private $flags = 0;
/**
* A unique identifier for a trace. All logs from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid. Can be set for logs that are part of request processing
* and have an assigned trace id. [Optional].
*
* Generated from protobuf field <code>bytes trace_id = 9;</code>
*/
private $trace_id = '';
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid. Can be set for logs that are part of a particular processing span.
* If span_id is present trace_id SHOULD be also present. [Optional].
*
* Generated from protobuf field <code>bytes span_id = 10;</code>
*/
private $span_id = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $time_unix_nano
* time_unix_nano is the time when the event occurred.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* Value of 0 indicates unknown or missing timestamp.
* @type int $severity_number
* Numerical value of the severity, normalized to values described in Log Data Model.
* [Optional].
* @type string $severity_text
* The severity text (also known as log level). The original string representation as
* it is known at the source. [Optional].
* @type string $name
* Short event identifier that does not contain varying parts. Name describes
* what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
* characters. Not guaranteed to be unique in any way. [Optional].
* @type \Opentelemetry\Proto\Common\V1\AnyValue $body
* A value containing the body of the log record. Can be for example a human-readable
* string message (including multi-line) describing the event in a free form or it can
* be a structured data composed of arrays and maps of other values. [Optional].
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
* Additional attributes that describe the specific event occurrence. [Optional].
* @type int $dropped_attributes_count
* @type int $flags
* Flags, a bit field. 8 least significant bits are the trace flags as
* defined in W3C Trace Context specification. 24 most significant bits are reserved
* and must be set to 0. Readers must not assume that 24 most significant bits
* will be zero and must correctly mask the bits when reading 8-bit trace flag (use
* flags & TRACE_FLAGS_MASK). [Optional].
* @type string $trace_id
* A unique identifier for a trace. All logs from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid. Can be set for logs that are part of request processing
* and have an assigned trace id. [Optional].
* @type string $span_id
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid. Can be set for logs that are part of a particular processing span.
* If span_id is present trace_id SHOULD be also present. [Optional].
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce();
parent::__construct($data);
}
/**
* time_unix_nano is the time when the event occurred.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* Value of 0 indicates unknown or missing timestamp.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the time when the event occurred.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* Value of 0 indicates unknown or missing timestamp.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* Numerical value of the severity, normalized to values described in Log Data Model.
* [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
* @return int
*/
public function getSeverityNumber()
{
return $this->severity_number;
}
/**
* Numerical value of the severity, normalized to values described in Log Data Model.
* [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.logs.v1.SeverityNumber severity_number = 2;</code>
* @param int $var
* @return $this
*/
public function setSeverityNumber($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Logs\V1\SeverityNumber::class);
$this->severity_number = $var;
return $this;
}
/**
* The severity text (also known as log level). The original string representation as
* it is known at the source. [Optional].
*
* Generated from protobuf field <code>string severity_text = 3;</code>
* @return string
*/
public function getSeverityText()
{
return $this->severity_text;
}
/**
* The severity text (also known as log level). The original string representation as
* it is known at the source. [Optional].
*
* Generated from protobuf field <code>string severity_text = 3;</code>
* @param string $var
* @return $this
*/
public function setSeverityText($var)
{
GPBUtil::checkString($var, True);
$this->severity_text = $var;
return $this;
}
/**
* Short event identifier that does not contain varying parts. Name describes
* what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
* characters. Not guaranteed to be unique in any way. [Optional].
*
* Generated from protobuf field <code>string name = 4;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Short event identifier that does not contain varying parts. Name describes
* what happened (e.g. "ProcessStarted"). Recommended to be no longer than 50
* characters. Not guaranteed to be unique in any way. [Optional].
*
* Generated from protobuf field <code>string name = 4;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* A value containing the body of the log record. Can be for example a human-readable
* string message (including multi-line) describing the event in a free form or it can
* be a structured data composed of arrays and maps of other values. [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
* @return \Opentelemetry\Proto\Common\V1\AnyValue
*/
public function getBody()
{
return $this->body;
}
/**
* A value containing the body of the log record. Can be for example a human-readable
* string message (including multi-line) describing the event in a free form or it can
* be a structured data composed of arrays and maps of other values. [Optional].
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.AnyValue body = 5;</code>
* @param \Opentelemetry\Proto\Common\V1\AnyValue $var
* @return $this
*/
public function setBody($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\AnyValue::class);
$this->body = $var;
return $this;
}
/**
* Additional attributes that describe the specific event occurrence. [Optional].
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* Additional attributes that describe the specific event occurrence. [Optional].
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 6;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setAttributes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->attributes = $arr;
return $this;
}
/**
* Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
* @return int
*/
public function getDroppedAttributesCount()
{
return $this->dropped_attributes_count;
}
/**
* Generated from protobuf field <code>uint32 dropped_attributes_count = 7;</code>
* @param int $var
* @return $this
*/
public function setDroppedAttributesCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_attributes_count = $var;
return $this;
}
/**
* Flags, a bit field. 8 least significant bits are the trace flags as
* defined in W3C Trace Context specification. 24 most significant bits are reserved
* and must be set to 0. Readers must not assume that 24 most significant bits
* will be zero and must correctly mask the bits when reading 8-bit trace flag (use
* flags & TRACE_FLAGS_MASK). [Optional].
*
* Generated from protobuf field <code>fixed32 flags = 8;</code>
* @return int
*/
public function getFlags()
{
return $this->flags;
}
/**
* Flags, a bit field. 8 least significant bits are the trace flags as
* defined in W3C Trace Context specification. 24 most significant bits are reserved
* and must be set to 0. Readers must not assume that 24 most significant bits
* will be zero and must correctly mask the bits when reading 8-bit trace flag (use
* flags & TRACE_FLAGS_MASK). [Optional].
*
* Generated from protobuf field <code>fixed32 flags = 8;</code>
* @param int $var
* @return $this
*/
public function setFlags($var)
{
GPBUtil::checkUint32($var);
$this->flags = $var;
return $this;
}
/**
* A unique identifier for a trace. All logs from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid. Can be set for logs that are part of request processing
* and have an assigned trace id. [Optional].
*
* Generated from protobuf field <code>bytes trace_id = 9;</code>
* @return string
*/
public function getTraceId()
{
return $this->trace_id;
}
/**
* A unique identifier for a trace. All logs from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid. Can be set for logs that are part of request processing
* and have an assigned trace id. [Optional].
*
* Generated from protobuf field <code>bytes trace_id = 9;</code>
* @param string $var
* @return $this
*/
public function setTraceId($var)
{
GPBUtil::checkString($var, False);
$this->trace_id = $var;
return $this;
}
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid. Can be set for logs that are part of a particular processing span.
* If span_id is present trace_id SHOULD be also present. [Optional].
*
* Generated from protobuf field <code>bytes span_id = 10;</code>
* @return string
*/
public function getSpanId()
{
return $this->span_id;
}
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid. Can be set for logs that are part of a particular processing span.
* If span_id is present trace_id SHOULD be also present. [Optional].
*
* Generated from protobuf field <code>bytes span_id = 10;</code>
* @param string $var
* @return $this
*/
public function setSpanId($var)
{
GPBUtil::checkString($var, False);
$this->span_id = $var;
return $this;
}
}

View File

@ -0,0 +1,23 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace Opentelemetry\Proto\Logs\V1;
/**
* Masks for LogRecord.flags field.
*
* Protobuf type <code>opentelemetry.proto.logs.v1.LogRecordFlags</code>
*/
class LogRecordFlags
{
/**
* Generated from protobuf enum <code>LOG_RECORD_FLAG_UNSPECIFIED = 0;</code>
*/
const LOG_RECORD_FLAG_UNSPECIFIED = 0;
/**
* Generated from protobuf enum <code>LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 255;</code>
*/
const LOG_RECORD_FLAG_TRACE_FLAGS_MASK = 255;
}

View File

@ -0,0 +1,105 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace Opentelemetry\Proto\Logs\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of InstrumentationLibraryLogs from a Resource.
*
* Generated from protobuf message <code>opentelemetry.proto.logs.v1.ResourceLogs</code>
*/
class ResourceLogs extends \Google\Protobuf\Internal\Message
{
/**
* The resource for the logs in this message.
* If this field is not set then resource info is unknown.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
*/
private $resource = null;
/**
* A list of InstrumentationLibraryLogs that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2;</code>
*/
private $instrumentation_library_logs;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Resource\V1\Resource $resource
* The resource for the logs in this message.
* If this field is not set then resource info is unknown.
* @type \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_logs
* A list of InstrumentationLibraryLogs that originate from a resource.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Logs\V1\Logs::initOnce();
parent::__construct($data);
}
/**
* The resource for the logs in this message.
* If this field is not set then resource info is unknown.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @return \Opentelemetry\Proto\Resource\V1\Resource
*/
public function getResource()
{
return $this->resource;
}
/**
* The resource for the logs in this message.
* If this field is not set then resource info is unknown.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @param \Opentelemetry\Proto\Resource\V1\Resource $var
* @return $this
*/
public function setResource($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class);
$this->resource = $var;
return $this;
}
/**
* A list of InstrumentationLibraryLogs that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getInstrumentationLibraryLogs()
{
return $this->instrumentation_library_logs;
}
/**
* A list of InstrumentationLibraryLogs that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.logs.v1.InstrumentationLibraryLogs instrumentation_library_logs = 2;</code>
* @param \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setInstrumentationLibraryLogs($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Logs\V1\InstrumentationLibraryLogs::class);
$this->instrumentation_library_logs = $arr;
return $this;
}
}

View File

@ -0,0 +1,117 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/logs/v1/logs.proto
namespace Opentelemetry\Proto\Logs\V1;
/**
* Possible values for LogRecord.SeverityNumber.
*
* Protobuf type <code>opentelemetry.proto.logs.v1.SeverityNumber</code>
*/
class SeverityNumber
{
/**
* UNSPECIFIED is the default SeverityNumber, it MUST NOT be used.
*
* Generated from protobuf enum <code>SEVERITY_NUMBER_UNSPECIFIED = 0;</code>
*/
const SEVERITY_NUMBER_UNSPECIFIED = 0;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_TRACE = 1;</code>
*/
const SEVERITY_NUMBER_TRACE = 1;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_TRACE2 = 2;</code>
*/
const SEVERITY_NUMBER_TRACE2 = 2;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_TRACE3 = 3;</code>
*/
const SEVERITY_NUMBER_TRACE3 = 3;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_TRACE4 = 4;</code>
*/
const SEVERITY_NUMBER_TRACE4 = 4;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_DEBUG = 5;</code>
*/
const SEVERITY_NUMBER_DEBUG = 5;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_DEBUG2 = 6;</code>
*/
const SEVERITY_NUMBER_DEBUG2 = 6;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_DEBUG3 = 7;</code>
*/
const SEVERITY_NUMBER_DEBUG3 = 7;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_DEBUG4 = 8;</code>
*/
const SEVERITY_NUMBER_DEBUG4 = 8;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_INFO = 9;</code>
*/
const SEVERITY_NUMBER_INFO = 9;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_INFO2 = 10;</code>
*/
const SEVERITY_NUMBER_INFO2 = 10;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_INFO3 = 11;</code>
*/
const SEVERITY_NUMBER_INFO3 = 11;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_INFO4 = 12;</code>
*/
const SEVERITY_NUMBER_INFO4 = 12;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_WARN = 13;</code>
*/
const SEVERITY_NUMBER_WARN = 13;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_WARN2 = 14;</code>
*/
const SEVERITY_NUMBER_WARN2 = 14;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_WARN3 = 15;</code>
*/
const SEVERITY_NUMBER_WARN3 = 15;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_WARN4 = 16;</code>
*/
const SEVERITY_NUMBER_WARN4 = 16;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_ERROR = 17;</code>
*/
const SEVERITY_NUMBER_ERROR = 17;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_ERROR2 = 18;</code>
*/
const SEVERITY_NUMBER_ERROR2 = 18;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_ERROR3 = 19;</code>
*/
const SEVERITY_NUMBER_ERROR3 = 19;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_ERROR4 = 20;</code>
*/
const SEVERITY_NUMBER_ERROR4 = 20;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_FATAL = 21;</code>
*/
const SEVERITY_NUMBER_FATAL = 21;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_FATAL2 = 22;</code>
*/
const SEVERITY_NUMBER_FATAL2 = 22;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_FATAL3 = 23;</code>
*/
const SEVERITY_NUMBER_FATAL3 = 23;
/**
* Generated from protobuf enum <code>SEVERITY_NUMBER_FATAL4 = 24;</code>
*/
const SEVERITY_NUMBER_FATAL4 = 24;
}

View File

@ -0,0 +1,53 @@
<?php
// GENERATED CODE -- DO NOT EDIT!
// Original file comments:
// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
namespace Opentelemetry\Proto\Metrics\Experimental;
/**
* MetricConfig is a service that enables updating metric schedules, trace
* parameters, and other configurations on the SDK without having to restart the
* instrumented application. The collector can also serve as the configuration
* service, acting as a bridge between third-party configuration services and
* the SDK, piping updated configs from a third-party source to an instrumented
* application.
*/
class MetricConfigClient extends \Grpc\BaseStub {
/**
* @param string $hostname hostname
* @param array $opts channel options
* @param \Grpc\Channel $channel (optional) re-use channel object
*/
public function __construct($hostname, $opts, $channel = null) {
parent::__construct($hostname, $opts, $channel);
}
/**
* @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigRequest $argument input argument
* @param array $metadata metadata
* @param array $options call options
*/
public function GetMetricConfig(\Opentelemetry\Proto\Metrics\Experimental\MetricConfigRequest $argument,
$metadata = [], $options = []) {
return $this->_simpleRequest('/opentelemetry.proto.metrics.experimental.MetricConfig/GetMetricConfig',
$argument,
['\Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse', 'decode'],
$metadata, $options);
}
}

View File

@ -0,0 +1,103 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.metrics.experimental.MetricConfigRequest</code>
*/
class MetricConfigRequest extends \Google\Protobuf\Internal\Message
{
/**
* Required. The resource for which configuration should be returned.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
*/
private $resource = null;
/**
* Optional. The value of MetricConfigResponse.fingerprint for the last
* configuration that the caller received and successfully applied.
*
* Generated from protobuf field <code>bytes last_known_fingerprint = 2;</code>
*/
private $last_known_fingerprint = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Resource\V1\Resource $resource
* Required. The resource for which configuration should be returned.
* @type string $last_known_fingerprint
* Optional. The value of MetricConfigResponse.fingerprint for the last
* configuration that the caller received and successfully applied.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce();
parent::__construct($data);
}
/**
* Required. The resource for which configuration should be returned.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @return \Opentelemetry\Proto\Resource\V1\Resource
*/
public function getResource()
{
return $this->resource;
}
/**
* Required. The resource for which configuration should be returned.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @param \Opentelemetry\Proto\Resource\V1\Resource $var
* @return $this
*/
public function setResource($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class);
$this->resource = $var;
return $this;
}
/**
* Optional. The value of MetricConfigResponse.fingerprint for the last
* configuration that the caller received and successfully applied.
*
* Generated from protobuf field <code>bytes last_known_fingerprint = 2;</code>
* @return string
*/
public function getLastKnownFingerprint()
{
return $this->last_known_fingerprint;
}
/**
* Optional. The value of MetricConfigResponse.fingerprint for the last
* configuration that the caller received and successfully applied.
*
* Generated from protobuf field <code>bytes last_known_fingerprint = 2;</code>
* @param string $var
* @return $this
*/
public function setLastKnownFingerprint($var)
{
GPBUtil::checkString($var, False);
$this->last_known_fingerprint = $var;
return $this;
}
}

View File

@ -0,0 +1,201 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Generated from protobuf message <code>opentelemetry.proto.metrics.experimental.MetricConfigResponse</code>
*/
class MetricConfigResponse extends \Google\Protobuf\Internal\Message
{
/**
* Optional. The fingerprint associated with this MetricConfigResponse. Each
* change in configs yields a different fingerprint. The resource SHOULD copy
* this value to MetricConfigRequest.last_known_fingerprint for the next
* configuration request. If there are no changes between fingerprint and
* MetricConfigRequest.last_known_fingerprint, then all other fields besides
* fingerprint in the response are optional, or the same as the last update if
* present.
* The exact mechanics of generating the fingerprint is up to the
* implementation. However, a fingerprint must be deterministically determined
* by the configurations -- the same configuration will generate the same
* fingerprint on any instance of an implementation. Hence using a timestamp is
* unacceptable, but a deterministic hash is fine.
*
* Generated from protobuf field <code>bytes fingerprint = 1;</code>
*/
private $fingerprint = '';
/**
* A single metric may match multiple schedules. In such cases, the schedule
* that specifies the smallest period is applied.
* Note, for optimization purposes, it is recommended to use as few schedules
* as possible to capture all required metric updates. Where you can be
* conservative, do take full advantage of the inclusion/exclusion patterns to
* capture as much of your targeted metrics.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2;</code>
*/
private $schedules;
/**
* Optional. The client is suggested to wait this long (in seconds) before
* pinging the configuration service again.
*
* Generated from protobuf field <code>int32 suggested_wait_time_sec = 3;</code>
*/
private $suggested_wait_time_sec = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $fingerprint
* Optional. The fingerprint associated with this MetricConfigResponse. Each
* change in configs yields a different fingerprint. The resource SHOULD copy
* this value to MetricConfigRequest.last_known_fingerprint for the next
* configuration request. If there are no changes between fingerprint and
* MetricConfigRequest.last_known_fingerprint, then all other fields besides
* fingerprint in the response are optional, or the same as the last update if
* present.
* The exact mechanics of generating the fingerprint is up to the
* implementation. However, a fingerprint must be deterministically determined
* by the configurations -- the same configuration will generate the same
* fingerprint on any instance of an implementation. Hence using a timestamp is
* unacceptable, but a deterministic hash is fine.
* @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $schedules
* A single metric may match multiple schedules. In such cases, the schedule
* that specifies the smallest period is applied.
* Note, for optimization purposes, it is recommended to use as few schedules
* as possible to capture all required metric updates. Where you can be
* conservative, do take full advantage of the inclusion/exclusion patterns to
* capture as much of your targeted metrics.
* @type int $suggested_wait_time_sec
* Optional. The client is suggested to wait this long (in seconds) before
* pinging the configuration service again.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce();
parent::__construct($data);
}
/**
* Optional. The fingerprint associated with this MetricConfigResponse. Each
* change in configs yields a different fingerprint. The resource SHOULD copy
* this value to MetricConfigRequest.last_known_fingerprint for the next
* configuration request. If there are no changes between fingerprint and
* MetricConfigRequest.last_known_fingerprint, then all other fields besides
* fingerprint in the response are optional, or the same as the last update if
* present.
* The exact mechanics of generating the fingerprint is up to the
* implementation. However, a fingerprint must be deterministically determined
* by the configurations -- the same configuration will generate the same
* fingerprint on any instance of an implementation. Hence using a timestamp is
* unacceptable, but a deterministic hash is fine.
*
* Generated from protobuf field <code>bytes fingerprint = 1;</code>
* @return string
*/
public function getFingerprint()
{
return $this->fingerprint;
}
/**
* Optional. The fingerprint associated with this MetricConfigResponse. Each
* change in configs yields a different fingerprint. The resource SHOULD copy
* this value to MetricConfigRequest.last_known_fingerprint for the next
* configuration request. If there are no changes between fingerprint and
* MetricConfigRequest.last_known_fingerprint, then all other fields besides
* fingerprint in the response are optional, or the same as the last update if
* present.
* The exact mechanics of generating the fingerprint is up to the
* implementation. However, a fingerprint must be deterministically determined
* by the configurations -- the same configuration will generate the same
* fingerprint on any instance of an implementation. Hence using a timestamp is
* unacceptable, but a deterministic hash is fine.
*
* Generated from protobuf field <code>bytes fingerprint = 1;</code>
* @param string $var
* @return $this
*/
public function setFingerprint($var)
{
GPBUtil::checkString($var, False);
$this->fingerprint = $var;
return $this;
}
/**
* A single metric may match multiple schedules. In such cases, the schedule
* that specifies the smallest period is applied.
* Note, for optimization purposes, it is recommended to use as few schedules
* as possible to capture all required metric updates. Where you can be
* conservative, do take full advantage of the inclusion/exclusion patterns to
* capture as much of your targeted metrics.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getSchedules()
{
return $this->schedules;
}
/**
* A single metric may match multiple schedules. In such cases, the schedule
* that specifies the smallest period is applied.
* Note, for optimization purposes, it is recommended to use as few schedules
* as possible to capture all required metric updates. Where you can be
* conservative, do take full advantage of the inclusion/exclusion patterns to
* capture as much of your targeted metrics.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule schedules = 2;</code>
* @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setSchedules($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule::class);
$this->schedules = $arr;
return $this;
}
/**
* Optional. The client is suggested to wait this long (in seconds) before
* pinging the configuration service again.
*
* Generated from protobuf field <code>int32 suggested_wait_time_sec = 3;</code>
* @return int
*/
public function getSuggestedWaitTimeSec()
{
return $this->suggested_wait_time_sec;
}
/**
* Optional. The client is suggested to wait this long (in seconds) before
* pinging the configuration service again.
*
* Generated from protobuf field <code>int32 suggested_wait_time_sec = 3;</code>
* @param int $var
* @return $this
*/
public function setSuggestedWaitTimeSec($var)
{
GPBUtil::checkInt32($var);
$this->suggested_wait_time_sec = $var;
return $this;
}
}

View File

@ -0,0 +1,149 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A Schedule is used to apply a particular scheduling configuration to
* a metric. If a metric name matches a schedule's patterns, then the metric
* adopts the configuration specified by the schedule.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule</code>
*/
class Schedule extends \Google\Protobuf\Internal\Message
{
/**
* Metrics with names that match a rule in the inclusion_patterns are
* targeted by this schedule. Metrics that match the exclusion_patterns
* are not targeted for this schedule, even if they match an inclusion
* pattern.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1;</code>
*/
private $exclusion_patterns;
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2;</code>
*/
private $inclusion_patterns;
/**
* Describes the collection period for each metric in seconds.
* A period of 0 means to not export.
*
* Generated from protobuf field <code>int32 period_sec = 3;</code>
*/
private $period_sec = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $exclusion_patterns
* Metrics with names that match a rule in the inclusion_patterns are
* targeted by this schedule. Metrics that match the exclusion_patterns
* are not targeted for this schedule, even if they match an inclusion
* pattern.
* @type \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $inclusion_patterns
* @type int $period_sec
* Describes the collection period for each metric in seconds.
* A period of 0 means to not export.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce();
parent::__construct($data);
}
/**
* Metrics with names that match a rule in the inclusion_patterns are
* targeted by this schedule. Metrics that match the exclusion_patterns
* are not targeted for this schedule, even if they match an inclusion
* pattern.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExclusionPatterns()
{
return $this->exclusion_patterns;
}
/**
* Metrics with names that match a rule in the inclusion_patterns are
* targeted by this schedule. Metrics that match the exclusion_patterns
* are not targeted for this schedule, even if they match an inclusion
* pattern.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern exclusion_patterns = 1;</code>
* @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExclusionPatterns($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class);
$this->exclusion_patterns = $arr;
return $this;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getInclusionPatterns()
{
return $this->inclusion_patterns;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern inclusion_patterns = 2;</code>
* @param \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setInclusionPatterns($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern::class);
$this->inclusion_patterns = $arr;
return $this;
}
/**
* Describes the collection period for each metric in seconds.
* A period of 0 means to not export.
*
* Generated from protobuf field <code>int32 period_sec = 3;</code>
* @return int
*/
public function getPeriodSec()
{
return $this->period_sec;
}
/**
* Describes the collection period for each metric in seconds.
* A period of 0 means to not export.
*
* Generated from protobuf field <code>int32 period_sec = 3;</code>
* @param int $var
* @return $this
*/
public function setPeriodSec($var)
{
GPBUtil::checkInt32($var);
$this->period_sec = $var;
return $this;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Schedule::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule::class);

View File

@ -0,0 +1,103 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A light-weight pattern that can match 1 or more
* metrics, for which this schedule will apply. The string is used to
* match against metric names. It should not exceed 100k characters.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.experimental.MetricConfigResponse.Schedule.Pattern</code>
*/
class Pattern extends \Google\Protobuf\Internal\Message
{
protected $match;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $equals
* matches the metric name exactly
* @type string $starts_with
* prefix-matches the metric name
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\Experimental\MetricsConfigService::initOnce();
parent::__construct($data);
}
/**
* matches the metric name exactly
*
* Generated from protobuf field <code>string equals = 1;</code>
* @return string
*/
public function getEquals()
{
return $this->readOneof(1);
}
/**
* matches the metric name exactly
*
* Generated from protobuf field <code>string equals = 1;</code>
* @param string $var
* @return $this
*/
public function setEquals($var)
{
GPBUtil::checkString($var, True);
$this->writeOneof(1, $var);
return $this;
}
/**
* prefix-matches the metric name
*
* Generated from protobuf field <code>string starts_with = 2;</code>
* @return string
*/
public function getStartsWith()
{
return $this->readOneof(2);
}
/**
* prefix-matches the metric name
*
* Generated from protobuf field <code>string starts_with = 2;</code>
* @param string $var
* @return $this
*/
public function setStartsWith($var)
{
GPBUtil::checkString($var, True);
$this->writeOneof(2, $var);
return $this;
}
/**
* @return string
*/
public function getMatch()
{
return $this->whichOneof("match");
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Pattern::class, \Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule_Pattern::class);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule instead.
* @deprecated
*/
class MetricConfigResponse_Schedule {}
}
class_exists(MetricConfigResponse\Schedule::class);
@trigger_error('Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/experimental/metrics_config_service.proto
namespace Opentelemetry\Proto\Metrics\Experimental;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern instead.
* @deprecated
*/
class MetricConfigResponse_Schedule_Pattern {}
}
class_exists(MetricConfigResponse\Schedule\Pattern::class);
@trigger_error('Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse_Schedule_Pattern is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Metrics\Experimental\MetricConfigResponse\Schedule\Pattern instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,86 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
/**
* AggregationTemporality defines how a metric aggregator reports aggregated
* values. It describes how those values relate to the time interval over
* which they are aggregated.
*
* Protobuf type <code>opentelemetry.proto.metrics.v1.AggregationTemporality</code>
*/
class AggregationTemporality
{
/**
* UNSPECIFIED is the default AggregationTemporality, it MUST not be used.
*
* Generated from protobuf enum <code>AGGREGATION_TEMPORALITY_UNSPECIFIED = 0;</code>
*/
const AGGREGATION_TEMPORALITY_UNSPECIFIED = 0;
/**
* DELTA is an AggregationTemporality for a metric aggregator which reports
* changes since last report time. Successive metrics contain aggregation of
* values from continuous and non-overlapping intervals.
* The values for a DELTA metric are based only on the time interval
* associated with one measurement cycle. There is no dependency on
* previous measurements like is the case for CUMULATIVE metrics.
* For example, consider a system measuring the number of requests that
* it receives and reports the sum of these requests every second as a
* DELTA metric:
* 1. The system starts receiving at time=t_0.
* 2. A request is received, the system measures 1 request.
* 3. A request is received, the system measures 1 request.
* 4. A request is received, the system measures 1 request.
* 5. The 1 second collection cycle ends. A metric is exported for the
* number of requests received over the interval of time t_0 to
* t_0+1 with a value of 3.
* 6. A request is received, the system measures 1 request.
* 7. A request is received, the system measures 1 request.
* 8. The 1 second collection cycle ends. A metric is exported for the
* number of requests received over the interval of time t_0+1 to
* t_0+2 with a value of 2.
*
* Generated from protobuf enum <code>AGGREGATION_TEMPORALITY_DELTA = 1;</code>
*/
const AGGREGATION_TEMPORALITY_DELTA = 1;
/**
* CUMULATIVE is an AggregationTemporality for a metric aggregator which
* reports changes since a fixed start time. This means that current values
* of a CUMULATIVE metric depend on all previous measurements since the
* start time. Because of this, the sender is required to retain this state
* in some form. If this state is lost or invalidated, the CUMULATIVE metric
* values MUST be reset and a new fixed start time following the last
* reported measurement time sent MUST be used.
* For example, consider a system measuring the number of requests that
* it receives and reports the sum of these requests every second as a
* CUMULATIVE metric:
* 1. The system starts receiving at time=t_0.
* 2. A request is received, the system measures 1 request.
* 3. A request is received, the system measures 1 request.
* 4. A request is received, the system measures 1 request.
* 5. The 1 second collection cycle ends. A metric is exported for the
* number of requests received over the interval of time t_0 to
* t_0+1 with a value of 3.
* 6. A request is received, the system measures 1 request.
* 7. A request is received, the system measures 1 request.
* 8. The 1 second collection cycle ends. A metric is exported for the
* number of requests received over the interval of time t_0 to
* t_0+2 with a value of 5.
* 9. The system experiences a fault and loses state.
* 10. The system recovers and resumes receiving at time=t_1.
* 11. A request is received, the system measures 1 request.
* 12. The 1 second collection cycle ends. A metric is exported for the
* number of requests received over the interval of time t_1 to
* t_0+1 with a value of 1.
* Note: Even though, when reporting changes since last report time, using
* CUMULATIVE is valid, it is not recommended. This may cause problems for
* systems that do not use start_time to determine when the aggregation
* value was reset (e.g. Prometheus).
*
* Generated from protobuf enum <code>AGGREGATION_TEMPORALITY_CUMULATIVE = 2;</code>
*/
const AGGREGATION_TEMPORALITY_CUMULATIVE = 2;
}

View File

@ -0,0 +1,259 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A representation of an exemplar, which is a sample input measurement.
* Exemplars also hold information about the environment when the measurement
* was recorded, for example the span and trace ID of the active span when the
* exemplar was recorded.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Exemplar</code>
*/
class Exemplar extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
*/
private $filtered_labels;
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
*/
private $time_unix_nano = 0;
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
*/
private $span_id = '';
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
*/
private $trace_id = '';
protected $value;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
* @type int|string $time_unix_nano
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type float $as_double
* @type int|string $as_int
* @type string $span_id
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
* @type string $trace_id
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getFilteredLabels()
{
return $this->filtered_labels;
}
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setFilteredLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->filtered_labels = $arr;
return $this;
}
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* Generated from protobuf field <code>double as_double = 3;</code>
* @return float
*/
public function getAsDouble()
{
return $this->readOneof(3);
}
/**
* Generated from protobuf field <code>double as_double = 3;</code>
* @param float $var
* @return $this
*/
public function setAsDouble($var)
{
GPBUtil::checkDouble($var);
$this->writeOneof(3, $var);
return $this;
}
/**
* Generated from protobuf field <code>sfixed64 as_int = 6;</code>
* @return int|string
*/
public function getAsInt()
{
return $this->readOneof(6);
}
/**
* Generated from protobuf field <code>sfixed64 as_int = 6;</code>
* @param int|string $var
* @return $this
*/
public function setAsInt($var)
{
GPBUtil::checkInt64($var);
$this->writeOneof(6, $var);
return $this;
}
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
* @return string
*/
public function getSpanId()
{
return $this->span_id;
}
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
* @param string $var
* @return $this
*/
public function setSpanId($var)
{
GPBUtil::checkString($var, False);
$this->span_id = $var;
return $this;
}
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
* @return string
*/
public function getTraceId()
{
return $this->trace_id;
}
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
* @param string $var
* @return $this
*/
public function setTraceId($var)
{
GPBUtil::checkString($var, False);
$this->trace_id = $var;
return $this;
}
/**
* @return string
*/
public function getValue()
{
return $this->whichOneof("value");
}
}

View File

@ -0,0 +1,68 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Gauge represents the type of a double scalar metric that always exports the
* "current value" for every data point. It should be used for an "unknown"
* aggregation.
*
* A Gauge does not support different aggregation temporalities. Given the
* aggregation is unknown, points cannot be combined using the same
* aggregation, regardless of aggregation temporalities. Therefore,
* AggregationTemporality is not included. Consequently, this also means
* "StartTimeUnixNano" is ignored for all data points.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Gauge</code>
*/
class Gauge extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\NumberDataPoint::class);
$this->data_points = $arr;
return $this;
}
}

View File

@ -0,0 +1,99 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Histogram represents the type of a metric that is calculated by aggregating as a
* Histogram of all reported double measurements over a time interval.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Histogram</code>
*/
class Histogram extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
*/
private $aggregation_temporality = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* @type int $aggregation_temporality
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.HistogramDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\HistogramDataPoint::class);
$this->data_points = $arr;
return $this;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @return int
*/
public function getAggregationTemporality()
{
return $this->aggregation_temporality;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @param int $var
* @return $this
*/
public function setAggregationTemporality($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class);
$this->aggregation_temporality = $var;
return $this;
}
}

View File

@ -0,0 +1,437 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* HistogramDataPoint is a single data point in a timeseries that describes the
* time-varying values of a Histogram of double values. A Histogram contains
* summary statistics for a population of values, it may optionally contain the
* distribution of those values across a set of buckets.
* If the histogram contains the distribution of values, then both
* "explicit_bounds" and "bucket counts" fields must be defined.
* If the histogram does not contain the distribution of values, then both
* "explicit_bounds" and "bucket_counts" must be omitted and only "count" and
* "sum" are known.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.HistogramDataPoint</code>
*/
class HistogramDataPoint extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
*/
private $labels;
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
*/
private $start_time_unix_nano = 0;
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
*/
private $time_unix_nano = 0;
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
*/
private $count = 0;
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>double sum = 5;</code>
*/
private $sum = 0.0;
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
*/
private $bucket_counts;
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
*/
private $explicit_bounds;
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8;</code>
*/
private $exemplars;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels
* The set of labels that uniquely identify this timeseries.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
* @type int|string $time_unix_nano
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type int|string $count
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
* @type float $sum
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
* @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
* @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
* @type \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLabels()
{
return $this->labels;
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->labels = $arr;
return $this;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @return int|string
*/
public function getCount()
{
return $this->count;
}
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @param int|string $var
* @return $this
*/
public function setCount($var)
{
GPBUtil::checkUint64($var);
$this->count = $var;
return $this;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>double sum = 5;</code>
* @return float
*/
public function getSum()
{
return $this->sum;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>double sum = 5;</code>
* @param float $var
* @return $this
*/
public function setSum($var)
{
GPBUtil::checkDouble($var);
$this->sum = $var;
return $this;
}
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getBucketCounts()
{
return $this->bucket_counts;
}
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
* @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setBucketCounts($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64);
$this->bucket_counts = $arr;
return $this;
}
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExplicitBounds()
{
return $this->explicit_bounds;
}
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
* @param float[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExplicitBounds($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
$this->explicit_bounds = $arr;
return $this;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExemplars()
{
return $this->exemplars;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 8;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExemplars($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Exemplar::class);
$this->exemplars = $arr;
return $this;
}
}

View File

@ -0,0 +1,109 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of Metrics produced by an InstrumentationLibrary.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics</code>
*/
class InstrumentationLibraryMetrics extends \Google\Protobuf\Internal\Message
{
/**
* The instrumentation library information for the metrics in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
*/
private $instrumentation_library = null;
/**
* A list of metrics that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2;</code>
*/
private $metrics;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library
* The instrumentation library information for the metrics in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
* @type \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $metrics
* A list of metrics that originate from an instrumentation library.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The instrumentation library information for the metrics in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary
*/
public function getInstrumentationLibrary()
{
return $this->instrumentation_library;
}
/**
* The instrumentation library information for the metrics in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var
* @return $this
*/
public function setInstrumentationLibrary($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class);
$this->instrumentation_library = $var;
return $this;
}
/**
* A list of metrics that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getMetrics()
{
return $this->metrics;
}
/**
* A list of metrics that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Metric metrics = 2;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Metric[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setMetrics($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Metric::class);
$this->metrics = $arr;
return $this;
}
}

View File

@ -0,0 +1,256 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* IntDataPoint is a single data point in a timeseries that describes the
* time-varying values of a int64 metric.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntDataPoint</code>
*/
class IntDataPoint extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
*/
private $labels;
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
*/
private $start_time_unix_nano = 0;
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
*/
private $time_unix_nano = 0;
/**
* value itself.
*
* Generated from protobuf field <code>sfixed64 value = 4;</code>
*/
private $value = 0;
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5;</code>
*/
private $exemplars;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels
* The set of labels that uniquely identify this timeseries.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
* @type int|string $time_unix_nano
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type int|string $value
* value itself.
* @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLabels()
{
return $this->labels;
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->labels = $arr;
return $this;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* value itself.
*
* Generated from protobuf field <code>sfixed64 value = 4;</code>
* @return int|string
*/
public function getValue()
{
return $this->value;
}
/**
* value itself.
*
* Generated from protobuf field <code>sfixed64 value = 4;</code>
* @param int|string $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkInt64($var);
$this->value = $var;
return $this;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExemplars()
{
return $this->exemplars;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 5;</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExemplars($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class);
$this->exemplars = $arr;
return $this;
}
}

View File

@ -0,0 +1,238 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A representation of an exemplar, which is a sample input int measurement.
* Exemplars also hold information about the environment when the measurement
* was recorded, for example the span and trace ID of the active span when the
* exemplar was recorded.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntExemplar</code>
*/
class IntExemplar extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
*/
private $filtered_labels;
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
*/
private $time_unix_nano = 0;
/**
* Numerical int value of the measurement that was recorded.
*
* Generated from protobuf field <code>sfixed64 value = 3;</code>
*/
private $value = 0;
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
*/
private $span_id = '';
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
*/
private $trace_id = '';
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $filtered_labels
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
* @type int|string $time_unix_nano
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type int|string $value
* Numerical int value of the measurement that was recorded.
* @type string $span_id
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
* @type string $trace_id
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getFilteredLabels()
{
return $this->filtered_labels;
}
/**
* The set of labels that were filtered out by the aggregator, but recorded
* alongside the original measurement. Only labels that were filtered out
* by the aggregator should be included
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue filtered_labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setFilteredLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->filtered_labels = $arr;
return $this;
}
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the exact time when this exemplar was recorded
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* Numerical int value of the measurement that was recorded.
*
* Generated from protobuf field <code>sfixed64 value = 3;</code>
* @return int|string
*/
public function getValue()
{
return $this->value;
}
/**
* Numerical int value of the measurement that was recorded.
*
* Generated from protobuf field <code>sfixed64 value = 3;</code>
* @param int|string $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkInt64($var);
$this->value = $var;
return $this;
}
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
* @return string
*/
public function getSpanId()
{
return $this->span_id;
}
/**
* (Optional) Span ID of the exemplar trace.
* span_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes span_id = 4;</code>
* @param string $var
* @return $this
*/
public function setSpanId($var)
{
GPBUtil::checkString($var, False);
$this->span_id = $var;
return $this;
}
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
* @return string
*/
public function getTraceId()
{
return $this->trace_id;
}
/**
* (Optional) Trace ID of the exemplar trace.
* trace_id may be missing if the measurement is not recorded inside a trace
* or if the trace is not sampled.
*
* Generated from protobuf field <code>bytes trace_id = 5;</code>
* @param string $var
* @return $this
*/
public function setTraceId($var)
{
GPBUtil::checkString($var, False);
$this->trace_id = $var;
return $this;
}
}

View File

@ -0,0 +1,69 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* IntGauge is deprecated. Use Gauge with an integer value in NumberDataPoint.
* IntGauge represents the type of a int scalar metric that always exports the
* "current value" for every data point. It should be used for an "unknown"
* aggregation.
*
* A Gauge does not support different aggregation temporalities. Given the
* aggregation is unknown, points cannot be combined using the same
* aggregation, regardless of aggregation temporalities. Therefore,
* AggregationTemporality is not included. Consequently, this also means
* "StartTimeUnixNano" is ignored for all data points.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntGauge</code>
*/
class IntGauge extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class);
$this->data_points = $arr;
return $this;
}
}

View File

@ -0,0 +1,101 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* IntHistogram is deprecated, replaced by Histogram points using double-
* valued exemplars.
* This represents the type of a metric that is calculated by aggregating as a
* Histogram of all reported int measurements over a time interval.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntHistogram</code>
*/
class IntHistogram extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
*/
private $aggregation_temporality = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* @type int $aggregation_temporality
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntHistogramDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntHistogramDataPoint::class);
$this->data_points = $arr;
return $this;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @return int
*/
public function getAggregationTemporality()
{
return $this->aggregation_temporality;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @param int $var
* @return $this
*/
public function setAggregationTemporality($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class);
$this->aggregation_temporality = $var;
return $this;
}
}

View File

@ -0,0 +1,438 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* IntHistogramDataPoint is deprecated; use HistogramDataPoint.
* This is a single data point in a timeseries that describes
* the time-varying values of a Histogram of int values. A Histogram contains
* summary statistics for a population of values, it may optionally contain
* the distribution of those values across a set of buckets.
* If the histogram contains the distribution of values, then both
* "explicit_bounds" and "bucket counts" fields must be defined.
* If the histogram does not contain the distribution of values, then both
* "explicit_bounds" and "bucket_counts" must be omitted and only "count" and
* "sum" are known.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntHistogramDataPoint</code>
*/
class IntHistogramDataPoint extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
*/
private $labels;
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
*/
private $start_time_unix_nano = 0;
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
*/
private $time_unix_nano = 0;
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
*/
private $count = 0;
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>sfixed64 sum = 5;</code>
*/
private $sum = 0;
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
*/
private $bucket_counts;
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
*/
private $explicit_bounds;
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8;</code>
*/
private $exemplars;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels
* The set of labels that uniquely identify this timeseries.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
* @type int|string $time_unix_nano
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type int|string $count
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
* @type int|string $sum
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
* @type int[]|string[]|\Google\Protobuf\Internal\RepeatedField $bucket_counts
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
* @type float[]|\Google\Protobuf\Internal\RepeatedField $explicit_bounds
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
* @type \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLabels()
{
return $this->labels;
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->labels = $arr;
return $this;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @return int|string
*/
public function getCount()
{
return $this->count;
}
/**
* count is the number of values in the population. Must be non-negative. This
* value must be equal to the sum of the "count" fields in buckets if a
* histogram is provided.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @param int|string $var
* @return $this
*/
public function setCount($var)
{
GPBUtil::checkUint64($var);
$this->count = $var;
return $this;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>sfixed64 sum = 5;</code>
* @return int|string
*/
public function getSum()
{
return $this->sum;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero. This value must be equal to the sum of the "sum" fields in
* buckets if a histogram is provided.
*
* Generated from protobuf field <code>sfixed64 sum = 5;</code>
* @param int|string $var
* @return $this
*/
public function setSum($var)
{
GPBUtil::checkInt64($var);
$this->sum = $var;
return $this;
}
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getBucketCounts()
{
return $this->bucket_counts;
}
/**
* bucket_counts is an optional field contains the count values of histogram
* for each bucket.
* The sum of the bucket_counts must equal the value in the count field.
* The number of elements in bucket_counts array must be by one greater than
* the number of elements in explicit_bounds array.
*
* Generated from protobuf field <code>repeated fixed64 bucket_counts = 6;</code>
* @param int[]|string[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setBucketCounts($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::FIXED64);
$this->bucket_counts = $arr;
return $this;
}
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExplicitBounds()
{
return $this->explicit_bounds;
}
/**
* explicit_bounds specifies buckets with explicitly defined bounds for values.
* This defines size(explicit_bounds) + 1 (= N) buckets. The boundaries for
* bucket at index i are:
* (-infinity, explicit_bounds[i]] for i == 0
* (explicit_bounds[i-1], explicit_bounds[i]] for 0 < i < N-1
* (explicit_bounds[i], +infinity) for i == N-1
*
* The values in the explicit_bounds array must be strictly increasing.
* Histogram buckets are inclusive of their upper boundary, except the last
* bucket where the boundary is at infinity. This format is intentionally
* compatible with the OpenMetrics histogram definition.
*
* Generated from protobuf field <code>repeated double explicit_bounds = 7;</code>
* @param float[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExplicitBounds($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::DOUBLE);
$this->explicit_bounds = $arr;
return $this;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExemplars()
{
return $this->exemplars;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntExemplar exemplars = 8;</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntExemplar[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExemplars($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntExemplar::class);
$this->exemplars = $arr;
return $this;
}
}

View File

@ -0,0 +1,134 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* IntSum is deprecated. Use Sum with an integer value in NumberDataPoint.
* IntSum represents the type of a numeric int scalar metric that is calculated as
* a sum of all reported measurements over a time interval.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.IntSum</code>
*/
class IntSum extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
*/
private $aggregation_temporality = 0;
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
*/
private $is_monotonic = false;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* @type int $aggregation_temporality
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
* @type bool $is_monotonic
* If "true" means that the sum is monotonic.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.IntDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\IntDataPoint::class);
$this->data_points = $arr;
return $this;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @return int
*/
public function getAggregationTemporality()
{
return $this->aggregation_temporality;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @param int $var
* @return $this
*/
public function setAggregationTemporality($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class);
$this->aggregation_temporality = $var;
return $this;
}
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
* @return bool
*/
public function getIsMonotonic()
{
return $this->is_monotonic;
}
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
* @param bool $var
* @return $this
*/
public function setIsMonotonic($var)
{
GPBUtil::checkBool($var);
$this->is_monotonic = $var;
return $this;
}
}

View File

@ -0,0 +1,415 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Defines a Metric which has one or more timeseries.
* The data model and relation between entities is shown in the
* diagram below. Here, "DataPoint" is the term used to refer to any
* one of the specific data point value types, and "points" is the term used
* to refer to any one of the lists of points contained in the Metric.
* - Metric is composed of a metadata and data.
* - Metadata part contains a name, description, unit.
* - Data is one of the possible types (Gauge, Sum, Histogram, etc.).
* - DataPoint contains timestamps, labels, and one of the possible value type
* fields.
* Metric
* +------------+
* |name |
* |description |
* |unit | +------------------------------------+
* |data |---> |Gauge, Sum, Histogram, Summary, ... |
* +------------+ +------------------------------------+
* Data [One of Gauge, Sum, Histogram, Summary, ...]
* +-----------+
* |... | // Metadata about the Data.
* |points |--+
* +-----------+ |
* | +---------------------------+
* | |DataPoint 1 |
* v |+------+------+ +------+ |
* +-----+ ||label |label |...|label | |
* | 1 |-->||value1|value2|...|valueN| |
* +-----+ |+------+------+ +------+ |
* | . | |+-----+ |
* | . | ||value| |
* | . | |+-----+ |
* | . | +---------------------------+
* | . | .
* | . | .
* | . | .
* | . | +---------------------------+
* | . | |DataPoint M |
* +-----+ |+------+------+ +------+ |
* | M |-->||label |label |...|label | |
* +-----+ ||value1|value2|...|valueN| |
* |+------+------+ +------+ |
* |+-----+ |
* ||value| |
* |+-----+ |
* +---------------------------+
* All DataPoint types have three common fields:
* - Labels zero or more key-value pairs associated with the data point.
* - StartTimeUnixNano MUST be set to the start of the interval when the data's
* type includes an AggregationTemporality. This field is not set otherwise.
* - TimeUnixNano MUST be set to:
* - the moment when an aggregation is reported (independent of the
* aggregation temporality).
* - the instantaneous time of the event.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Metric</code>
*/
class Metric extends \Google\Protobuf\Internal\Message
{
/**
* name of the metric, including its DNS name prefix. It must be unique.
*
* Generated from protobuf field <code>string name = 1;</code>
*/
private $name = '';
/**
* description of the metric, which can be used in documentation.
*
* Generated from protobuf field <code>string description = 2;</code>
*/
private $description = '';
/**
* unit in which the metric value is reported. Follows the format
* described by http://unitsofmeasure.org/ucum.html.
*
* Generated from protobuf field <code>string unit = 3;</code>
*/
private $unit = '';
protected $data;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $name
* name of the metric, including its DNS name prefix. It must be unique.
* @type string $description
* description of the metric, which can be used in documentation.
* @type string $unit
* unit in which the metric value is reported. Follows the format
* described by http://unitsofmeasure.org/ucum.html.
* @type \Opentelemetry\Proto\Metrics\V1\IntGauge $int_gauge
* IntGauge and IntSum are deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_gauge` and `int_sum` fields.
* 2. New senders, which are aware of this change MUST send only `gauge`
* and `sum` fields.
* 3. New receivers, which are aware of this change MUST convert these into
* `gauge` and `sum` by using the provided as_int field in the oneof values.
* This field will be removed in ~3 months, on July 1, 2021.
* @type \Opentelemetry\Proto\Metrics\V1\Gauge $gauge
* @type \Opentelemetry\Proto\Metrics\V1\IntSum $int_sum
* This field will be removed in ~3 months, on July 1, 2021.
* @type \Opentelemetry\Proto\Metrics\V1\Sum $sum
* @type \Opentelemetry\Proto\Metrics\V1\IntHistogram $int_histogram
* IntHistogram is deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_histogram` field.
* 2. New senders, which are aware of this change MUST send only `histogram`.
* 3. New receivers, which are aware of this change MUST convert this into
* `histogram` by simply converting all int64 values into float.
* This field will be removed in ~3 months, on July 1, 2021.
* @type \Opentelemetry\Proto\Metrics\V1\Histogram $histogram
* @type \Opentelemetry\Proto\Metrics\V1\Summary $summary
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* name of the metric, including its DNS name prefix. It must be unique.
*
* Generated from protobuf field <code>string name = 1;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* name of the metric, including its DNS name prefix. It must be unique.
*
* Generated from protobuf field <code>string name = 1;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* description of the metric, which can be used in documentation.
*
* Generated from protobuf field <code>string description = 2;</code>
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* description of the metric, which can be used in documentation.
*
* Generated from protobuf field <code>string description = 2;</code>
* @param string $var
* @return $this
*/
public function setDescription($var)
{
GPBUtil::checkString($var, True);
$this->description = $var;
return $this;
}
/**
* unit in which the metric value is reported. Follows the format
* described by http://unitsofmeasure.org/ucum.html.
*
* Generated from protobuf field <code>string unit = 3;</code>
* @return string
*/
public function getUnit()
{
return $this->unit;
}
/**
* unit in which the metric value is reported. Follows the format
* described by http://unitsofmeasure.org/ucum.html.
*
* Generated from protobuf field <code>string unit = 3;</code>
* @param string $var
* @return $this
*/
public function setUnit($var)
{
GPBUtil::checkString($var, True);
$this->unit = $var;
return $this;
}
/**
* IntGauge and IntSum are deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_gauge` and `int_sum` fields.
* 2. New senders, which are aware of this change MUST send only `gauge`
* and `sum` fields.
* 3. New receivers, which are aware of this change MUST convert these into
* `gauge` and `sum` by using the provided as_int field in the oneof values.
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntGauge int_gauge = 4 [deprecated = true];</code>
* @return \Opentelemetry\Proto\Metrics\V1\IntGauge
*/
public function getIntGauge()
{
return $this->readOneof(4);
}
/**
* IntGauge and IntSum are deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_gauge` and `int_sum` fields.
* 2. New senders, which are aware of this change MUST send only `gauge`
* and `sum` fields.
* 3. New receivers, which are aware of this change MUST convert these into
* `gauge` and `sum` by using the provided as_int field in the oneof values.
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntGauge int_gauge = 4 [deprecated = true];</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntGauge $var
* @return $this
*/
public function setIntGauge($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntGauge::class);
$this->writeOneof(4, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Gauge gauge = 5;</code>
* @return \Opentelemetry\Proto\Metrics\V1\Gauge
*/
public function getGauge()
{
return $this->readOneof(5);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Gauge gauge = 5;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Gauge $var
* @return $this
*/
public function setGauge($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Gauge::class);
$this->writeOneof(5, $var);
return $this;
}
/**
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntSum int_sum = 6 [deprecated = true];</code>
* @return \Opentelemetry\Proto\Metrics\V1\IntSum
*/
public function getIntSum()
{
return $this->readOneof(6);
}
/**
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntSum int_sum = 6 [deprecated = true];</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntSum $var
* @return $this
*/
public function setIntSum($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntSum::class);
$this->writeOneof(6, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Sum sum = 7;</code>
* @return \Opentelemetry\Proto\Metrics\V1\Sum
*/
public function getSum()
{
return $this->readOneof(7);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Sum sum = 7;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Sum $var
* @return $this
*/
public function setSum($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Sum::class);
$this->writeOneof(7, $var);
return $this;
}
/**
* IntHistogram is deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_histogram` field.
* 2. New senders, which are aware of this change MUST send only `histogram`.
* 3. New receivers, which are aware of this change MUST convert this into
* `histogram` by simply converting all int64 values into float.
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntHistogram int_histogram = 8 [deprecated = true];</code>
* @return \Opentelemetry\Proto\Metrics\V1\IntHistogram
*/
public function getIntHistogram()
{
return $this->readOneof(8);
}
/**
* IntHistogram is deprecated and will be removed soon.
* 1. Old senders and receivers that are not aware of this change will
* continue using the `int_histogram` field.
* 2. New senders, which are aware of this change MUST send only `histogram`.
* 3. New receivers, which are aware of this change MUST convert this into
* `histogram` by simply converting all int64 values into float.
* This field will be removed in ~3 months, on July 1, 2021.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.IntHistogram int_histogram = 8 [deprecated = true];</code>
* @param \Opentelemetry\Proto\Metrics\V1\IntHistogram $var
* @return $this
*/
public function setIntHistogram($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\IntHistogram::class);
$this->writeOneof(8, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Histogram histogram = 9;</code>
* @return \Opentelemetry\Proto\Metrics\V1\Histogram
*/
public function getHistogram()
{
return $this->readOneof(9);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Histogram histogram = 9;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Histogram $var
* @return $this
*/
public function setHistogram($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Histogram::class);
$this->writeOneof(9, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Summary summary = 11;</code>
* @return \Opentelemetry\Proto\Metrics\V1\Summary
*/
public function getSummary()
{
return $this->readOneof(11);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.Summary summary = 11;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Summary $var
* @return $this
*/
public function setSummary($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Metrics\V1\Summary::class);
$this->writeOneof(11, $var);
return $this;
}
/**
* @return string
*/
public function getData()
{
return $this->whichOneof("data");
}
}

View File

@ -0,0 +1,277 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* NumberDataPoint is a single data point in a timeseries that describes the
* time-varying value of a double metric.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.NumberDataPoint</code>
*/
class NumberDataPoint extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
*/
private $labels;
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
*/
private $start_time_unix_nano = 0;
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
*/
private $time_unix_nano = 0;
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5;</code>
*/
private $exemplars;
protected $value;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels
* The set of labels that uniquely identify this timeseries.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
* @type int|string $time_unix_nano
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type float $as_double
* @type int|string $as_int
* @type \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $exemplars
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLabels()
{
return $this->labels;
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->labels = $arr;
return $this;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
*
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* Generated from protobuf field <code>double as_double = 4;</code>
* @return float
*/
public function getAsDouble()
{
return $this->readOneof(4);
}
/**
* Generated from protobuf field <code>double as_double = 4;</code>
* @param float $var
* @return $this
*/
public function setAsDouble($var)
{
GPBUtil::checkDouble($var);
$this->writeOneof(4, $var);
return $this;
}
/**
* Generated from protobuf field <code>sfixed64 as_int = 6;</code>
* @return int|string
*/
public function getAsInt()
{
return $this->readOneof(6);
}
/**
* Generated from protobuf field <code>sfixed64 as_int = 6;</code>
* @param int|string $var
* @return $this
*/
public function setAsInt($var)
{
GPBUtil::checkInt64($var);
$this->writeOneof(6, $var);
return $this;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getExemplars()
{
return $this->exemplars;
}
/**
* (Optional) List of exemplars collected from
* measurements that were used to form the data point
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.Exemplar exemplars = 5;</code>
* @param \Opentelemetry\Proto\Metrics\V1\Exemplar[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setExemplars($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\Exemplar::class);
$this->exemplars = $arr;
return $this;
}
/**
* @return string
*/
public function getValue()
{
return $this->whichOneof("value");
}
}

View File

@ -0,0 +1,105 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of InstrumentationLibraryMetrics from a Resource.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.ResourceMetrics</code>
*/
class ResourceMetrics extends \Google\Protobuf\Internal\Message
{
/**
* The resource for the metrics in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
*/
private $resource = null;
/**
* A list of metrics that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2;</code>
*/
private $instrumentation_library_metrics;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Resource\V1\Resource $resource
* The resource for the metrics in this message.
* If this field is not set then no resource info is known.
* @type \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_metrics
* A list of metrics that originate from a resource.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The resource for the metrics in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @return \Opentelemetry\Proto\Resource\V1\Resource
*/
public function getResource()
{
return $this->resource;
}
/**
* The resource for the metrics in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @param \Opentelemetry\Proto\Resource\V1\Resource $var
* @return $this
*/
public function setResource($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class);
$this->resource = $var;
return $this;
}
/**
* A list of metrics that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getInstrumentationLibraryMetrics()
{
return $this->instrumentation_library_metrics;
}
/**
* A list of metrics that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.InstrumentationLibraryMetrics instrumentation_library_metrics = 2;</code>
* @param \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setInstrumentationLibraryMetrics($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\InstrumentationLibraryMetrics::class);
$this->instrumentation_library_metrics = $arr;
return $this;
}
}

View File

@ -0,0 +1,133 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Sum represents the type of a numeric double scalar metric that is calculated
* as a sum of all reported measurements over a time interval.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Sum</code>
*/
class Sum extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
*/
private $aggregation_temporality = 0;
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
*/
private $is_monotonic = false;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* @type int $aggregation_temporality
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
* @type bool $is_monotonic
* If "true" means that the sum is monotonic.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.NumberDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\NumberDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\NumberDataPoint::class);
$this->data_points = $arr;
return $this;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @return int
*/
public function getAggregationTemporality()
{
return $this->aggregation_temporality;
}
/**
* aggregation_temporality describes if the aggregator reports delta changes
* since last report time, or cumulative changes since a fixed start time.
*
* Generated from protobuf field <code>.opentelemetry.proto.metrics.v1.AggregationTemporality aggregation_temporality = 2;</code>
* @param int $var
* @return $this
*/
public function setAggregationTemporality($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Metrics\V1\AggregationTemporality::class);
$this->aggregation_temporality = $var;
return $this;
}
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
* @return bool
*/
public function getIsMonotonic()
{
return $this->is_monotonic;
}
/**
* If "true" means that the sum is monotonic.
*
* Generated from protobuf field <code>bool is_monotonic = 3;</code>
* @param bool $var
* @return $this
*/
public function setIsMonotonic($var)
{
GPBUtil::checkBool($var);
$this->is_monotonic = $var;
return $this;
}
}

View File

@ -0,0 +1,65 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Summary metric data are used to convey quantile summaries,
* a Prometheus (see: https://prometheus.io/docs/concepts/metric_types/#summary)
* and OpenMetrics (see: https://github.com/OpenObservability/OpenMetrics/blob/4dbf6075567ab43296eed941037c12951faafb92/protos/prometheus.proto#L45)
* data type. These data points cannot always be merged in a meaningful way.
* While they can be useful in some applications, histogram data points are
* recommended for new applications.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.Summary</code>
*/
class Summary extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1;</code>
*/
private $data_points;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint[]|\Google\Protobuf\Internal\RepeatedField $data_points
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getDataPoints()
{
return $this->data_points;
}
/**
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint data_points = 1;</code>
* @param \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setDataPoints($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint::class);
$this->data_points = $arr;
return $this;
}
}

View File

@ -0,0 +1,286 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* SummaryDataPoint is a single data point in a timeseries that describes the
* time-varying values of a Summary metric.
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.SummaryDataPoint</code>
*/
class SummaryDataPoint extends \Google\Protobuf\Internal\Message
{
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
*/
private $labels;
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
*/
private $start_time_unix_nano = 0;
/**
* time_unix_nano is the moment when this aggregation value was reported.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
*/
private $time_unix_nano = 0;
/**
* count is the number of values in the population. Must be non-negative.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
*/
private $count = 0;
/**
* sum of the values in the population. If count is zero then this field
* must be zero.
*
* Generated from protobuf field <code>double sum = 5;</code>
*/
private $sum = 0.0;
/**
* (Optional) list of values at different quantiles of the distribution calculated
* from the current snapshot. The quantiles must be strictly increasing.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6;</code>
*/
private $quantile_values;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $labels
* The set of labels that uniquely identify this timeseries.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
* @type int|string $time_unix_nano
* time_unix_nano is the moment when this aggregation value was reported.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* @type int|string $count
* count is the number of values in the population. Must be non-negative.
* @type float $sum
* sum of the values in the population. If count is zero then this field
* must be zero.
* @type \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile[]|\Google\Protobuf\Internal\RepeatedField $quantile_values
* (Optional) list of values at different quantiles of the distribution calculated
* from the current snapshot. The quantiles must be strictly increasing.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLabels()
{
return $this->labels;
}
/**
* The set of labels that uniquely identify this timeseries.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.StringKeyValue labels = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\StringKeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLabels($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\StringKeyValue::class);
$this->labels = $arr;
return $this;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the last time when the aggregation value was reset
* to "zero". For some metric types this is ignored, see data types for more
* details.
* The aggregation value is over the time interval (start_time_unix_nano,
* time_unix_nano].
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
* Value of 0 indicates that the timestamp is unspecified. In that case the
* timestamp may be decided by the backend.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 2;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the moment when this aggregation value was reported.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January
* 1970.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 3;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* count is the number of values in the population. Must be non-negative.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @return int|string
*/
public function getCount()
{
return $this->count;
}
/**
* count is the number of values in the population. Must be non-negative.
*
* Generated from protobuf field <code>fixed64 count = 4;</code>
* @param int|string $var
* @return $this
*/
public function setCount($var)
{
GPBUtil::checkUint64($var);
$this->count = $var;
return $this;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero.
*
* Generated from protobuf field <code>double sum = 5;</code>
* @return float
*/
public function getSum()
{
return $this->sum;
}
/**
* sum of the values in the population. If count is zero then this field
* must be zero.
*
* Generated from protobuf field <code>double sum = 5;</code>
* @param float $var
* @return $this
*/
public function setSum($var)
{
GPBUtil::checkDouble($var);
$this->sum = $var;
return $this;
}
/**
* (Optional) list of values at different quantiles of the distribution calculated
* from the current snapshot. The quantiles must be strictly increasing.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getQuantileValues()
{
return $this->quantile_values;
}
/**
* (Optional) list of values at different quantiles of the distribution calculated
* from the current snapshot. The quantiles must be strictly increasing.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile quantile_values = 6;</code>
* @param \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setQuantileValues($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile::class);
$this->quantile_values = $arr;
return $this;
}
}

View File

@ -0,0 +1,113 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1\SummaryDataPoint;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Represents the value at a given quantile of a distribution.
* To record Min and Max values following conventions are used:
* - The 1.0 quantile is equivalent to the maximum value observed.
* - The 0.0 quantile is equivalent to the minimum value observed.
* See the following issue for more context:
* https://github.com/open-telemetry/opentelemetry-proto/issues/125
*
* Generated from protobuf message <code>opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile</code>
*/
class ValueAtQuantile extends \Google\Protobuf\Internal\Message
{
/**
* The quantile of a distribution. Must be in the interval
* [0.0, 1.0].
*
* Generated from protobuf field <code>double quantile = 1;</code>
*/
private $quantile = 0.0;
/**
* The value at the given quantile of a distribution.
*
* Generated from protobuf field <code>double value = 2;</code>
*/
private $value = 0.0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type float $quantile
* The quantile of a distribution. Must be in the interval
* [0.0, 1.0].
* @type float $value
* The value at the given quantile of a distribution.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Metrics\V1\Metrics::initOnce();
parent::__construct($data);
}
/**
* The quantile of a distribution. Must be in the interval
* [0.0, 1.0].
*
* Generated from protobuf field <code>double quantile = 1;</code>
* @return float
*/
public function getQuantile()
{
return $this->quantile;
}
/**
* The quantile of a distribution. Must be in the interval
* [0.0, 1.0].
*
* Generated from protobuf field <code>double quantile = 1;</code>
* @param float $var
* @return $this
*/
public function setQuantile($var)
{
GPBUtil::checkDouble($var);
$this->quantile = $var;
return $this;
}
/**
* The value at the given quantile of a distribution.
*
* Generated from protobuf field <code>double value = 2;</code>
* @return float
*/
public function getValue()
{
return $this->value;
}
/**
* The value at the given quantile of a distribution.
*
* Generated from protobuf field <code>double value = 2;</code>
* @param float $var
* @return $this
*/
public function setValue($var)
{
GPBUtil::checkDouble($var);
$this->value = $var;
return $this;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ValueAtQuantile::class, \Opentelemetry\Proto\Metrics\V1\SummaryDataPoint_ValueAtQuantile::class);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/metrics/v1/metrics.proto
namespace Opentelemetry\Proto\Metrics\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile instead.
* @deprecated
*/
class SummaryDataPoint_ValueAtQuantile {}
}
class_exists(SummaryDataPoint\ValueAtQuantile::class);
@trigger_error('Opentelemetry\Proto\Metrics\V1\SummaryDataPoint_ValueAtQuantile is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Metrics\V1\SummaryDataPoint\ValueAtQuantile instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,105 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/resource/v1/resource.proto
namespace Opentelemetry\Proto\Resource\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Resource information.
*
* Generated from protobuf message <code>opentelemetry.proto.resource.v1.Resource</code>
*/
class Resource extends \Google\Protobuf\Internal\Message
{
/**
* Set of labels that describe the resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1;</code>
*/
private $attributes;
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0, then
* no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 2;</code>
*/
private $dropped_attributes_count = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
* Set of labels that describe the resource.
* @type int $dropped_attributes_count
* dropped_attributes_count is the number of dropped attributes. If the value is 0, then
* no attributes were dropped.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Resource\V1\Resource::initOnce();
parent::__construct($data);
}
/**
* Set of labels that describe the resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* Set of labels that describe the resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setAttributes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->attributes = $arr;
return $this;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0, then
* no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 2;</code>
* @return int
*/
public function getDroppedAttributesCount()
{
return $this->dropped_attributes_count;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0, then
* no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 2;</code>
* @param int $var
* @return $this
*/
public function setDroppedAttributesCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_attributes_count = $var;
return $this;
}
}

View File

@ -0,0 +1,60 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Sampler that always makes a constant decision on span sampling.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.ConstantSampler</code>
*/
class ConstantSampler extends \Google\Protobuf\Internal\Message
{
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1;</code>
*/
private $decision = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int $decision
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1;</code>
* @return int
*/
public function getDecision()
{
return $this->decision;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision decision = 1;</code>
* @param int $var
* @return $this
*/
public function setDecision($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler_ConstantDecision::class);
$this->decision = $var;
return $this;
}
}

View File

@ -0,0 +1,33 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1\ConstantSampler;
/**
* How spans should be sampled:
* - Always off
* - Always on
* - Always follow the parent Span's decision (off if no parent).
*
* Protobuf type <code>opentelemetry.proto.trace.v1.ConstantSampler.ConstantDecision</code>
*/
class ConstantDecision
{
/**
* Generated from protobuf enum <code>ALWAYS_OFF = 0;</code>
*/
const ALWAYS_OFF = 0;
/**
* Generated from protobuf enum <code>ALWAYS_ON = 1;</code>
*/
const ALWAYS_ON = 1;
/**
* Generated from protobuf enum <code>ALWAYS_PARENT = 2;</code>
*/
const ALWAYS_PARENT = 2;
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ConstantDecision::class, \Opentelemetry\Proto\Trace\V1\ConstantSampler_ConstantDecision::class);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\ConstantSampler\ConstantDecision instead.
* @deprecated
*/
class ConstantSampler_ConstantDecision {}
}
class_exists(ConstantSampler\ConstantDecision::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\ConstantSampler_ConstantDecision is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\ConstantSampler\ConstantDecision instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,109 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of Spans produced by an InstrumentationLibrary.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.InstrumentationLibrarySpans</code>
*/
class InstrumentationLibrarySpans extends \Google\Protobuf\Internal\Message
{
/**
* The instrumentation library information for the spans in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
*/
private $instrumentation_library = null;
/**
* A list of Spans that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span spans = 2;</code>
*/
private $spans;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $instrumentation_library
* The instrumentation library information for the spans in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
* @type \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $spans
* A list of Spans that originate from an instrumentation library.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* The instrumentation library information for the spans in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @return \Opentelemetry\Proto\Common\V1\InstrumentationLibrary
*/
public function getInstrumentationLibrary()
{
return $this->instrumentation_library;
}
/**
* The instrumentation library information for the spans in this message.
* Semantically when InstrumentationLibrary isn't set, it is equivalent with
* an empty instrumentation library name (unknown).
*
* Generated from protobuf field <code>.opentelemetry.proto.common.v1.InstrumentationLibrary instrumentation_library = 1;</code>
* @param \Opentelemetry\Proto\Common\V1\InstrumentationLibrary $var
* @return $this
*/
public function setInstrumentationLibrary($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Common\V1\InstrumentationLibrary::class);
$this->instrumentation_library = $var;
return $this;
}
/**
* A list of Spans that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span spans = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getSpans()
{
return $this->spans;
}
/**
* A list of Spans that originate from an instrumentation library.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span spans = 2;</code>
* @param \Opentelemetry\Proto\Trace\V1\Span[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setSpans($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span::class);
$this->spans = $arr;
return $this;
}
}

View File

@ -0,0 +1,67 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Sampler that tries to sample with a rate per time window.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.RateLimitingSampler</code>
*/
class RateLimitingSampler extends \Google\Protobuf\Internal\Message
{
/**
* Rate per second.
*
* Generated from protobuf field <code>int64 qps = 1;</code>
*/
private $qps = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $qps
* Rate per second.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce();
parent::__construct($data);
}
/**
* Rate per second.
*
* Generated from protobuf field <code>int64 qps = 1;</code>
* @return int|string
*/
public function getQps()
{
return $this->qps;
}
/**
* Rate per second.
*
* Generated from protobuf field <code>int64 qps = 1;</code>
* @param int|string $var
* @return $this
*/
public function setQps($var)
{
GPBUtil::checkInt64($var);
$this->qps = $var;
return $this;
}
}

View File

@ -0,0 +1,105 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A collection of InstrumentationLibrarySpans from a Resource.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.ResourceSpans</code>
*/
class ResourceSpans extends \Google\Protobuf\Internal\Message
{
/**
* The resource for the spans in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
*/
private $resource = null;
/**
* A list of InstrumentationLibrarySpans that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2;</code>
*/
private $instrumentation_library_spans;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Resource\V1\Resource $resource
* The resource for the spans in this message.
* If this field is not set then no resource info is known.
* @type \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $instrumentation_library_spans
* A list of InstrumentationLibrarySpans that originate from a resource.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* The resource for the spans in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @return \Opentelemetry\Proto\Resource\V1\Resource
*/
public function getResource()
{
return $this->resource;
}
/**
* The resource for the spans in this message.
* If this field is not set then no resource info is known.
*
* Generated from protobuf field <code>.opentelemetry.proto.resource.v1.Resource resource = 1;</code>
* @param \Opentelemetry\Proto\Resource\V1\Resource $var
* @return $this
*/
public function setResource($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Resource\V1\Resource::class);
$this->resource = $var;
return $this;
}
/**
* A list of InstrumentationLibrarySpans that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getInstrumentationLibrarySpans()
{
return $this->instrumentation_library_spans;
}
/**
* A list of InstrumentationLibrarySpans that originate from a resource.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.InstrumentationLibrarySpans instrumentation_library_spans = 2;</code>
* @param \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setInstrumentationLibrarySpans($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans::class);
$this->instrumentation_library_spans = $arr;
return $this;
}
}

View File

@ -0,0 +1,726 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Span represents a single operation within a trace. Spans can be
* nested to form a trace tree. Spans may also be linked to other spans
* from the same or different trace and form graphs. Often, a trace
* contains a root span that describes the end-to-end latency, and one
* or more subspans for its sub-operations. A trace can also contain
* multiple root spans, or none at all. Spans do not need to be
* contiguous - there may be gaps or overlaps between spans in a trace.
* The next available field id is 17.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.Span</code>
*/
class Span extends \Google\Protobuf\Internal\Message
{
/**
* A unique identifier for a trace. All spans from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid.
* This field is semantically required. Receiver should generate new
* random trace_id if empty or invalid trace_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
*/
private $trace_id = '';
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid.
* This field is semantically required. Receiver should generate new
* random span_id if empty or invalid span_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
*/
private $span_id = '';
/**
* trace_state conveys information about request position in multiple distributed tracing graphs.
* It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
* See also https://github.com/w3c/distributed-tracing for more details about this field.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
*/
private $trace_state = '';
/**
* The `span_id` of this span's parent span. If this is a root span, then this
* field must be empty. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes parent_span_id = 4;</code>
*/
private $parent_span_id = '';
/**
* A description of the span's operation.
* For example, the name can be a qualified method name or a file name
* and a line number where the operation is called. A best practice is to use
* the same display name at the same call point in an application.
* This makes it easier to correlate spans in different traces.
* This field is semantically required to be set to non-empty string.
* When null or empty string received - receiver may use string "name"
* as a replacement. There might be smarted algorithms implemented by
* receiver to fix the empty span name.
* This field is required.
*
* Generated from protobuf field <code>string name = 5;</code>
*/
private $name = '';
/**
* Distinguishes between spans generated in a particular context. For example,
* two spans with the same name may be distinguished using `CLIENT` (caller)
* and `SERVER` (callee) to identify queueing latency associated with the span.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Span.SpanKind kind = 6;</code>
*/
private $kind = 0;
/**
* start_time_unix_nano is the start time of the span. On the client side, this is the time
* kept by the local machine where the span execution starts. On the server side, this
* is the time when the server's application handler starts running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 7;</code>
*/
private $start_time_unix_nano = 0;
/**
* end_time_unix_nano is the end time of the span. On the client side, this is the time
* kept by the local machine where the span execution ends. On the server side, this
* is the time when the server application handler stops running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 end_time_unix_nano = 8;</code>
*/
private $end_time_unix_nano = 0;
/**
* attributes is a collection of key/value pairs. The value can be a string,
* an integer, a double or the Boolean values `true` or `false`. Note, global attributes
* like server name can be set using the resource API. Examples of attributes:
* "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
* "/http/server_latency": 300
* "abc.com/myattribute": true
* "abc.com/score": 10.239
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9;</code>
*/
private $attributes;
/**
* dropped_attributes_count is the number of attributes that were discarded. Attributes
* can be discarded because their keys are too long or because there are too many
* attributes. If this value is 0, then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 10;</code>
*/
private $dropped_attributes_count = 0;
/**
* events is a collection of Event items.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Event events = 11;</code>
*/
private $events;
/**
* dropped_events_count is the number of dropped events. If the value is 0, then no
* events were dropped.
*
* Generated from protobuf field <code>uint32 dropped_events_count = 12;</code>
*/
private $dropped_events_count = 0;
/**
* links is a collection of Links, which are references from this span to a span
* in the same or different trace.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Link links = 13;</code>
*/
private $links;
/**
* dropped_links_count is the number of dropped links after the maximum size was
* enforced. If this value is 0, then no links were dropped.
*
* Generated from protobuf field <code>uint32 dropped_links_count = 14;</code>
*/
private $dropped_links_count = 0;
/**
* An optional final status for this span. Semantically when Status isn't set, it means
* span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status status = 15;</code>
*/
private $status = null;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $trace_id
* A unique identifier for a trace. All spans from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid.
* This field is semantically required. Receiver should generate new
* random trace_id if empty or invalid trace_id was received.
* This field is required.
* @type string $span_id
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid.
* This field is semantically required. Receiver should generate new
* random span_id if empty or invalid span_id was received.
* This field is required.
* @type string $trace_state
* trace_state conveys information about request position in multiple distributed tracing graphs.
* It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
* See also https://github.com/w3c/distributed-tracing for more details about this field.
* @type string $parent_span_id
* The `span_id` of this span's parent span. If this is a root span, then this
* field must be empty. The ID is an 8-byte array.
* @type string $name
* A description of the span's operation.
* For example, the name can be a qualified method name or a file name
* and a line number where the operation is called. A best practice is to use
* the same display name at the same call point in an application.
* This makes it easier to correlate spans in different traces.
* This field is semantically required to be set to non-empty string.
* When null or empty string received - receiver may use string "name"
* as a replacement. There might be smarted algorithms implemented by
* receiver to fix the empty span name.
* This field is required.
* @type int $kind
* Distinguishes between spans generated in a particular context. For example,
* two spans with the same name may be distinguished using `CLIENT` (caller)
* and `SERVER` (callee) to identify queueing latency associated with the span.
* @type int|string $start_time_unix_nano
* start_time_unix_nano is the start time of the span. On the client side, this is the time
* kept by the local machine where the span execution starts. On the server side, this
* is the time when the server's application handler starts running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
* @type int|string $end_time_unix_nano
* end_time_unix_nano is the end time of the span. On the client side, this is the time
* kept by the local machine where the span execution ends. On the server side, this
* is the time when the server application handler stops running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
* attributes is a collection of key/value pairs. The value can be a string,
* an integer, a double or the Boolean values `true` or `false`. Note, global attributes
* like server name can be set using the resource API. Examples of attributes:
* "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
* "/http/server_latency": 300
* "abc.com/myattribute": true
* "abc.com/score": 10.239
* @type int $dropped_attributes_count
* dropped_attributes_count is the number of attributes that were discarded. Attributes
* can be discarded because their keys are too long or because there are too many
* attributes. If this value is 0, then no attributes were dropped.
* @type \Opentelemetry\Proto\Trace\V1\Span\Event[]|\Google\Protobuf\Internal\RepeatedField $events
* events is a collection of Event items.
* @type int $dropped_events_count
* dropped_events_count is the number of dropped events. If the value is 0, then no
* events were dropped.
* @type \Opentelemetry\Proto\Trace\V1\Span\Link[]|\Google\Protobuf\Internal\RepeatedField $links
* links is a collection of Links, which are references from this span to a span
* in the same or different trace.
* @type int $dropped_links_count
* dropped_links_count is the number of dropped links after the maximum size was
* enforced. If this value is 0, then no links were dropped.
* @type \Opentelemetry\Proto\Trace\V1\Status $status
* An optional final status for this span. Semantically when Status isn't set, it means
* span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* A unique identifier for a trace. All spans from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid.
* This field is semantically required. Receiver should generate new
* random trace_id if empty or invalid trace_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
* @return string
*/
public function getTraceId()
{
return $this->trace_id;
}
/**
* A unique identifier for a trace. All spans from the same trace share
* the same `trace_id`. The ID is a 16-byte array. An ID with all zeroes
* is considered invalid.
* This field is semantically required. Receiver should generate new
* random trace_id if empty or invalid trace_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
* @param string $var
* @return $this
*/
public function setTraceId($var)
{
GPBUtil::checkString($var, False);
$this->trace_id = $var;
return $this;
}
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid.
* This field is semantically required. Receiver should generate new
* random span_id if empty or invalid span_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
* @return string
*/
public function getSpanId()
{
return $this->span_id;
}
/**
* A unique identifier for a span within a trace, assigned when the span
* is created. The ID is an 8-byte array. An ID with all zeroes is considered
* invalid.
* This field is semantically required. Receiver should generate new
* random span_id if empty or invalid span_id was received.
* This field is required.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
* @param string $var
* @return $this
*/
public function setSpanId($var)
{
GPBUtil::checkString($var, False);
$this->span_id = $var;
return $this;
}
/**
* trace_state conveys information about request position in multiple distributed tracing graphs.
* It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
* See also https://github.com/w3c/distributed-tracing for more details about this field.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
* @return string
*/
public function getTraceState()
{
return $this->trace_state;
}
/**
* trace_state conveys information about request position in multiple distributed tracing graphs.
* It is a trace_state in w3c-trace-context format: https://www.w3.org/TR/trace-context/#tracestate-header
* See also https://github.com/w3c/distributed-tracing for more details about this field.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
* @param string $var
* @return $this
*/
public function setTraceState($var)
{
GPBUtil::checkString($var, True);
$this->trace_state = $var;
return $this;
}
/**
* The `span_id` of this span's parent span. If this is a root span, then this
* field must be empty. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes parent_span_id = 4;</code>
* @return string
*/
public function getParentSpanId()
{
return $this->parent_span_id;
}
/**
* The `span_id` of this span's parent span. If this is a root span, then this
* field must be empty. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes parent_span_id = 4;</code>
* @param string $var
* @return $this
*/
public function setParentSpanId($var)
{
GPBUtil::checkString($var, False);
$this->parent_span_id = $var;
return $this;
}
/**
* A description of the span's operation.
* For example, the name can be a qualified method name or a file name
* and a line number where the operation is called. A best practice is to use
* the same display name at the same call point in an application.
* This makes it easier to correlate spans in different traces.
* This field is semantically required to be set to non-empty string.
* When null or empty string received - receiver may use string "name"
* as a replacement. There might be smarted algorithms implemented by
* receiver to fix the empty span name.
* This field is required.
*
* Generated from protobuf field <code>string name = 5;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* A description of the span's operation.
* For example, the name can be a qualified method name or a file name
* and a line number where the operation is called. A best practice is to use
* the same display name at the same call point in an application.
* This makes it easier to correlate spans in different traces.
* This field is semantically required to be set to non-empty string.
* When null or empty string received - receiver may use string "name"
* as a replacement. There might be smarted algorithms implemented by
* receiver to fix the empty span name.
* This field is required.
*
* Generated from protobuf field <code>string name = 5;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* Distinguishes between spans generated in a particular context. For example,
* two spans with the same name may be distinguished using `CLIENT` (caller)
* and `SERVER` (callee) to identify queueing latency associated with the span.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Span.SpanKind kind = 6;</code>
* @return int
*/
public function getKind()
{
return $this->kind;
}
/**
* Distinguishes between spans generated in a particular context. For example,
* two spans with the same name may be distinguished using `CLIENT` (caller)
* and `SERVER` (callee) to identify queueing latency associated with the span.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Span.SpanKind kind = 6;</code>
* @param int $var
* @return $this
*/
public function setKind($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Span_SpanKind::class);
$this->kind = $var;
return $this;
}
/**
* start_time_unix_nano is the start time of the span. On the client side, this is the time
* kept by the local machine where the span execution starts. On the server side, this
* is the time when the server's application handler starts running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 7;</code>
* @return int|string
*/
public function getStartTimeUnixNano()
{
return $this->start_time_unix_nano;
}
/**
* start_time_unix_nano is the start time of the span. On the client side, this is the time
* kept by the local machine where the span execution starts. On the server side, this
* is the time when the server's application handler starts running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 start_time_unix_nano = 7;</code>
* @param int|string $var
* @return $this
*/
public function setStartTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->start_time_unix_nano = $var;
return $this;
}
/**
* end_time_unix_nano is the end time of the span. On the client side, this is the time
* kept by the local machine where the span execution ends. On the server side, this
* is the time when the server application handler stops running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 end_time_unix_nano = 8;</code>
* @return int|string
*/
public function getEndTimeUnixNano()
{
return $this->end_time_unix_nano;
}
/**
* end_time_unix_nano is the end time of the span. On the client side, this is the time
* kept by the local machine where the span execution ends. On the server side, this
* is the time when the server application handler stops running.
* Value is UNIX Epoch time in nanoseconds since 00:00:00 UTC on 1 January 1970.
* This field is semantically required and it is expected that end_time >= start_time.
*
* Generated from protobuf field <code>fixed64 end_time_unix_nano = 8;</code>
* @param int|string $var
* @return $this
*/
public function setEndTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->end_time_unix_nano = $var;
return $this;
}
/**
* attributes is a collection of key/value pairs. The value can be a string,
* an integer, a double or the Boolean values `true` or `false`. Note, global attributes
* like server name can be set using the resource API. Examples of attributes:
* "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
* "/http/server_latency": 300
* "abc.com/myattribute": true
* "abc.com/score": 10.239
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* attributes is a collection of key/value pairs. The value can be a string,
* an integer, a double or the Boolean values `true` or `false`. Note, global attributes
* like server name can be set using the resource API. Examples of attributes:
* "/http/user_agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
* "/http/server_latency": 300
* "abc.com/myattribute": true
* "abc.com/score": 10.239
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 9;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setAttributes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->attributes = $arr;
return $this;
}
/**
* dropped_attributes_count is the number of attributes that were discarded. Attributes
* can be discarded because their keys are too long or because there are too many
* attributes. If this value is 0, then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 10;</code>
* @return int
*/
public function getDroppedAttributesCount()
{
return $this->dropped_attributes_count;
}
/**
* dropped_attributes_count is the number of attributes that were discarded. Attributes
* can be discarded because their keys are too long or because there are too many
* attributes. If this value is 0, then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 10;</code>
* @param int $var
* @return $this
*/
public function setDroppedAttributesCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_attributes_count = $var;
return $this;
}
/**
* events is a collection of Event items.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Event events = 11;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getEvents()
{
return $this->events;
}
/**
* events is a collection of Event items.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Event events = 11;</code>
* @param \Opentelemetry\Proto\Trace\V1\Span\Event[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setEvents($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span\Event::class);
$this->events = $arr;
return $this;
}
/**
* dropped_events_count is the number of dropped events. If the value is 0, then no
* events were dropped.
*
* Generated from protobuf field <code>uint32 dropped_events_count = 12;</code>
* @return int
*/
public function getDroppedEventsCount()
{
return $this->dropped_events_count;
}
/**
* dropped_events_count is the number of dropped events. If the value is 0, then no
* events were dropped.
*
* Generated from protobuf field <code>uint32 dropped_events_count = 12;</code>
* @param int $var
* @return $this
*/
public function setDroppedEventsCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_events_count = $var;
return $this;
}
/**
* links is a collection of Links, which are references from this span to a span
* in the same or different trace.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Link links = 13;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getLinks()
{
return $this->links;
}
/**
* links is a collection of Links, which are references from this span to a span
* in the same or different trace.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.trace.v1.Span.Link links = 13;</code>
* @param \Opentelemetry\Proto\Trace\V1\Span\Link[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setLinks($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Trace\V1\Span\Link::class);
$this->links = $arr;
return $this;
}
/**
* dropped_links_count is the number of dropped links after the maximum size was
* enforced. If this value is 0, then no links were dropped.
*
* Generated from protobuf field <code>uint32 dropped_links_count = 14;</code>
* @return int
*/
public function getDroppedLinksCount()
{
return $this->dropped_links_count;
}
/**
* dropped_links_count is the number of dropped links after the maximum size was
* enforced. If this value is 0, then no links were dropped.
*
* Generated from protobuf field <code>uint32 dropped_links_count = 14;</code>
* @param int $var
* @return $this
*/
public function setDroppedLinksCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_links_count = $var;
return $this;
}
/**
* An optional final status for this span. Semantically when Status isn't set, it means
* span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status status = 15;</code>
* @return \Opentelemetry\Proto\Trace\V1\Status
*/
public function getStatus()
{
return $this->status;
}
/**
* An optional final status for this span. Semantically when Status isn't set, it means
* span's status code is unset, i.e. assume STATUS_CODE_UNSET (code = 0).
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status status = 15;</code>
* @param \Opentelemetry\Proto\Trace\V1\Status $var
* @return $this
*/
public function setStatus($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\Status::class);
$this->status = $var;
return $this;
}
}

View File

@ -0,0 +1,181 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1\Span;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Event is a time-stamped annotation of the span, consisting of user-supplied
* text description and key-value pairs.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.Span.Event</code>
*/
class Event extends \Google\Protobuf\Internal\Message
{
/**
* time_unix_nano is the time the event occurred.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
*/
private $time_unix_nano = 0;
/**
* name of the event.
* This field is semantically required to be set to non-empty string.
*
* Generated from protobuf field <code>string name = 2;</code>
*/
private $name = '';
/**
* attributes is a collection of attribute key/value pairs on the event.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3;</code>
*/
private $attributes;
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 4;</code>
*/
private $dropped_attributes_count = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int|string $time_unix_nano
* time_unix_nano is the time the event occurred.
* @type string $name
* name of the event.
* This field is semantically required to be set to non-empty string.
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
* attributes is a collection of attribute key/value pairs on the event.
* @type int $dropped_attributes_count
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* time_unix_nano is the time the event occurred.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
* @return int|string
*/
public function getTimeUnixNano()
{
return $this->time_unix_nano;
}
/**
* time_unix_nano is the time the event occurred.
*
* Generated from protobuf field <code>fixed64 time_unix_nano = 1;</code>
* @param int|string $var
* @return $this
*/
public function setTimeUnixNano($var)
{
GPBUtil::checkUint64($var);
$this->time_unix_nano = $var;
return $this;
}
/**
* name of the event.
* This field is semantically required to be set to non-empty string.
*
* Generated from protobuf field <code>string name = 2;</code>
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* name of the event.
* This field is semantically required to be set to non-empty string.
*
* Generated from protobuf field <code>string name = 2;</code>
* @param string $var
* @return $this
*/
public function setName($var)
{
GPBUtil::checkString($var, True);
$this->name = $var;
return $this;
}
/**
* attributes is a collection of attribute key/value pairs on the event.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* attributes is a collection of attribute key/value pairs on the event.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 3;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setAttributes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->attributes = $arr;
return $this;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 4;</code>
* @return int
*/
public function getDroppedAttributesCount()
{
return $this->dropped_attributes_count;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 4;</code>
* @param int $var
* @return $this
*/
public function setDroppedAttributesCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_attributes_count = $var;
return $this;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Event::class, \Opentelemetry\Proto\Trace\V1\Span_Event::class);

View File

@ -0,0 +1,217 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1\Span;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* A pointer from the current span to another span in the same trace or in a
* different trace. For example, this can be used in batching operations,
* where a single batch handler processes multiple requests from different
* traces or when the handler receives a request from a different project.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.Span.Link</code>
*/
class Link extends \Google\Protobuf\Internal\Message
{
/**
* A unique identifier of a trace that this linked span is part of. The ID is a
* 16-byte array.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
*/
private $trace_id = '';
/**
* A unique identifier for the linked span. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
*/
private $span_id = '';
/**
* The trace_state associated with the link.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
*/
private $trace_state = '';
/**
* attributes is a collection of attribute key/value pairs on the link.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4;</code>
*/
private $attributes;
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 5;</code>
*/
private $dropped_attributes_count = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type string $trace_id
* A unique identifier of a trace that this linked span is part of. The ID is a
* 16-byte array.
* @type string $span_id
* A unique identifier for the linked span. The ID is an 8-byte array.
* @type string $trace_state
* The trace_state associated with the link.
* @type \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $attributes
* attributes is a collection of attribute key/value pairs on the link.
* @type int $dropped_attributes_count
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* A unique identifier of a trace that this linked span is part of. The ID is a
* 16-byte array.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
* @return string
*/
public function getTraceId()
{
return $this->trace_id;
}
/**
* A unique identifier of a trace that this linked span is part of. The ID is a
* 16-byte array.
*
* Generated from protobuf field <code>bytes trace_id = 1;</code>
* @param string $var
* @return $this
*/
public function setTraceId($var)
{
GPBUtil::checkString($var, False);
$this->trace_id = $var;
return $this;
}
/**
* A unique identifier for the linked span. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
* @return string
*/
public function getSpanId()
{
return $this->span_id;
}
/**
* A unique identifier for the linked span. The ID is an 8-byte array.
*
* Generated from protobuf field <code>bytes span_id = 2;</code>
* @param string $var
* @return $this
*/
public function setSpanId($var)
{
GPBUtil::checkString($var, False);
$this->span_id = $var;
return $this;
}
/**
* The trace_state associated with the link.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
* @return string
*/
public function getTraceState()
{
return $this->trace_state;
}
/**
* The trace_state associated with the link.
*
* Generated from protobuf field <code>string trace_state = 3;</code>
* @param string $var
* @return $this
*/
public function setTraceState($var)
{
GPBUtil::checkString($var, True);
$this->trace_state = $var;
return $this;
}
/**
* attributes is a collection of attribute key/value pairs on the link.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4;</code>
* @return \Google\Protobuf\Internal\RepeatedField
*/
public function getAttributes()
{
return $this->attributes;
}
/**
* attributes is a collection of attribute key/value pairs on the link.
*
* Generated from protobuf field <code>repeated .opentelemetry.proto.common.v1.KeyValue attributes = 4;</code>
* @param \Opentelemetry\Proto\Common\V1\KeyValue[]|\Google\Protobuf\Internal\RepeatedField $var
* @return $this
*/
public function setAttributes($var)
{
$arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Opentelemetry\Proto\Common\V1\KeyValue::class);
$this->attributes = $arr;
return $this;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 5;</code>
* @return int
*/
public function getDroppedAttributesCount()
{
return $this->dropped_attributes_count;
}
/**
* dropped_attributes_count is the number of dropped attributes. If the value is 0,
* then no attributes were dropped.
*
* Generated from protobuf field <code>uint32 dropped_attributes_count = 5;</code>
* @param int $var
* @return $this
*/
public function setDroppedAttributesCount($var)
{
GPBUtil::checkUint32($var);
$this->dropped_attributes_count = $var;
return $this;
}
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(Link::class, \Opentelemetry\Proto\Trace\V1\Span_Link::class);

View File

@ -0,0 +1,63 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1\Span;
/**
* SpanKind is the type of span. Can be used to specify additional relationships between spans
* in addition to a parent/child relationship.
*
* Protobuf type <code>opentelemetry.proto.trace.v1.Span.SpanKind</code>
*/
class SpanKind
{
/**
* Unspecified. Do NOT use as default.
* Implementations MAY assume SpanKind to be INTERNAL when receiving UNSPECIFIED.
*
* Generated from protobuf enum <code>SPAN_KIND_UNSPECIFIED = 0;</code>
*/
const SPAN_KIND_UNSPECIFIED = 0;
/**
* Indicates that the span represents an internal operation within an application,
* as opposed to an operation happening at the boundaries. Default value.
*
* Generated from protobuf enum <code>SPAN_KIND_INTERNAL = 1;</code>
*/
const SPAN_KIND_INTERNAL = 1;
/**
* Indicates that the span covers server-side handling of an RPC or other
* remote network request.
*
* Generated from protobuf enum <code>SPAN_KIND_SERVER = 2;</code>
*/
const SPAN_KIND_SERVER = 2;
/**
* Indicates that the span describes a request to some remote service.
*
* Generated from protobuf enum <code>SPAN_KIND_CLIENT = 3;</code>
*/
const SPAN_KIND_CLIENT = 3;
/**
* Indicates that the span describes a producer sending a message to a broker.
* Unlike CLIENT and SERVER, there is often no direct critical path latency relationship
* between producer and consumer spans. A PRODUCER span ends when the message was accepted
* by the broker while the logical processing of the message might span a much longer time.
*
* Generated from protobuf enum <code>SPAN_KIND_PRODUCER = 4;</code>
*/
const SPAN_KIND_PRODUCER = 4;
/**
* Indicates that the span describes consumer receiving a message from a broker.
* Like the PRODUCER kind, there is often no direct critical path latency relationship
* between producer and consumer spans.
*
* Generated from protobuf enum <code>SPAN_KIND_CONSUMER = 5;</code>
*/
const SPAN_KIND_CONSUMER = 5;
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(SpanKind::class, \Opentelemetry\Proto\Trace\V1\Span_SpanKind::class);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\Span\Event instead.
* @deprecated
*/
class Span_Event {}
}
class_exists(Span\Event::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\Span_Event is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\Span\Event instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\Span\Link instead.
* @deprecated
*/
class Span_Link {}
}
class_exists(Span\Link::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\Span_Link is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\Span\Link instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\Span\SpanKind instead.
* @deprecated
*/
class Span_SpanKind {}
}
class_exists(Span\SpanKind::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\Span_SpanKind is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\Span\SpanKind instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,152 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* The Status type defines a logical error model that is suitable for different
* programming environments, including REST APIs and RPC APIs.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.Status</code>
*/
class Status extends \Google\Protobuf\Internal\Message
{
/**
* The deprecated status code. This is an optional field.
* This field is deprecated and is replaced by the `code` field below. See backward
* compatibility notes below. According to our stability guarantees this field
* will be removed in 12 months, on Oct 22, 2021. All usage of old senders and
* receivers that do not understand the `code` field MUST be phased out by then.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true];</code>
*/
private $deprecated_code = 0;
/**
* A developer-facing human readable error message.
*
* Generated from protobuf field <code>string message = 2;</code>
*/
private $message = '';
/**
* The status code.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.StatusCode code = 3;</code>
*/
private $code = 0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type int $deprecated_code
* The deprecated status code. This is an optional field.
* This field is deprecated and is replaced by the `code` field below. See backward
* compatibility notes below. According to our stability guarantees this field
* will be removed in 12 months, on Oct 22, 2021. All usage of old senders and
* receivers that do not understand the `code` field MUST be phased out by then.
* @type string $message
* A developer-facing human readable error message.
* @type int $code
* The status code.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\Trace::initOnce();
parent::__construct($data);
}
/**
* The deprecated status code. This is an optional field.
* This field is deprecated and is replaced by the `code` field below. See backward
* compatibility notes below. According to our stability guarantees this field
* will be removed in 12 months, on Oct 22, 2021. All usage of old senders and
* receivers that do not understand the `code` field MUST be phased out by then.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true];</code>
* @return int
*/
public function getDeprecatedCode()
{
return $this->deprecated_code;
}
/**
* The deprecated status code. This is an optional field.
* This field is deprecated and is replaced by the `code` field below. See backward
* compatibility notes below. According to our stability guarantees this field
* will be removed in 12 months, on Oct 22, 2021. All usage of old senders and
* receivers that do not understand the `code` field MUST be phased out by then.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode deprecated_code = 1 [deprecated = true];</code>
* @param int $var
* @return $this
*/
public function setDeprecatedCode($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class);
$this->deprecated_code = $var;
return $this;
}
/**
* A developer-facing human readable error message.
*
* Generated from protobuf field <code>string message = 2;</code>
* @return string
*/
public function getMessage()
{
return $this->message;
}
/**
* A developer-facing human readable error message.
*
* Generated from protobuf field <code>string message = 2;</code>
* @param string $var
* @return $this
*/
public function setMessage($var)
{
GPBUtil::checkString($var, True);
$this->message = $var;
return $this;
}
/**
* The status code.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.StatusCode code = 3;</code>
* @return int
*/
public function getCode()
{
return $this->code;
}
/**
* The status code.
*
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.Status.StatusCode code = 3;</code>
* @param int $var
* @return $this
*/
public function setCode($var)
{
GPBUtil::checkEnum($var, \Opentelemetry\Proto\Trace\V1\Status_StatusCode::class);
$this->code = $var;
return $this;
}
}

View File

@ -0,0 +1,84 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1\Status;
/**
* Protobuf type <code>opentelemetry.proto.trace.v1.Status.DeprecatedStatusCode</code>
*/
class DeprecatedStatusCode
{
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_OK = 0;</code>
*/
const DEPRECATED_STATUS_CODE_OK = 0;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_CANCELLED = 1;</code>
*/
const DEPRECATED_STATUS_CODE_CANCELLED = 1;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2;</code>
*/
const DEPRECATED_STATUS_CODE_UNKNOWN_ERROR = 2;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3;</code>
*/
const DEPRECATED_STATUS_CODE_INVALID_ARGUMENT = 3;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4;</code>
*/
const DEPRECATED_STATUS_CODE_DEADLINE_EXCEEDED = 4;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_NOT_FOUND = 5;</code>
*/
const DEPRECATED_STATUS_CODE_NOT_FOUND = 5;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6;</code>
*/
const DEPRECATED_STATUS_CODE_ALREADY_EXISTS = 6;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7;</code>
*/
const DEPRECATED_STATUS_CODE_PERMISSION_DENIED = 7;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8;</code>
*/
const DEPRECATED_STATUS_CODE_RESOURCE_EXHAUSTED = 8;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9;</code>
*/
const DEPRECATED_STATUS_CODE_FAILED_PRECONDITION = 9;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_ABORTED = 10;</code>
*/
const DEPRECATED_STATUS_CODE_ABORTED = 10;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11;</code>
*/
const DEPRECATED_STATUS_CODE_OUT_OF_RANGE = 11;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12;</code>
*/
const DEPRECATED_STATUS_CODE_UNIMPLEMENTED = 12;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13;</code>
*/
const DEPRECATED_STATUS_CODE_INTERNAL_ERROR = 13;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNAVAILABLE = 14;</code>
*/
const DEPRECATED_STATUS_CODE_UNAVAILABLE = 14;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_DATA_LOSS = 15;</code>
*/
const DEPRECATED_STATUS_CODE_DATA_LOSS = 15;
/**
* Generated from protobuf enum <code>DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16;</code>
*/
const DEPRECATED_STATUS_CODE_UNAUTHENTICATED = 16;
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(DeprecatedStatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode::class);

View File

@ -0,0 +1,38 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1\Status;
/**
* For the semantics of status codes see
* https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#set-status
*
* Protobuf type <code>opentelemetry.proto.trace.v1.Status.StatusCode</code>
*/
class StatusCode
{
/**
* The default status.
*
* Generated from protobuf enum <code>STATUS_CODE_UNSET = 0;</code>
*/
const STATUS_CODE_UNSET = 0;
/**
* The Span has been validated by an Application developers or Operator to have
* completed successfully.
*
* Generated from protobuf enum <code>STATUS_CODE_OK = 1;</code>
*/
const STATUS_CODE_OK = 1;
/**
* The Span contains an error.
*
* Generated from protobuf enum <code>STATUS_CODE_ERROR = 2;</code>
*/
const STATUS_CODE_ERROR = 2;
}
// Adding a class alias for backwards compatibility with the previous class name.
class_alias(StatusCode::class, \Opentelemetry\Proto\Trace\V1\Status_StatusCode::class);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\Status\DeprecatedStatusCode instead.
* @deprecated
*/
class Status_DeprecatedStatusCode {}
}
class_exists(Status\DeprecatedStatusCode::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\Status_DeprecatedStatusCode is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\Status\DeprecatedStatusCode instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,16 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace.proto
namespace Opentelemetry\Proto\Trace\V1;
if (false) {
/**
* This class is deprecated. Use Opentelemetry\Proto\Trace\V1\Status\StatusCode instead.
* @deprecated
*/
class Status_StatusCode {}
}
class_exists(Status\StatusCode::class);
@trigger_error('Opentelemetry\Proto\Trace\V1\Status_StatusCode is deprecated and will be removed in the next major release. Use Opentelemetry\Proto\Trace\V1\Status\StatusCode instead', E_USER_DEPRECATED);

View File

@ -0,0 +1,282 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Global configuration of the trace service. All fields must be specified, or
* the default (zero) values will be used for each type.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.TraceConfig</code>
*/
class TraceConfig extends \Google\Protobuf\Internal\Message
{
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes = 4;</code>
*/
private $max_number_of_attributes = 0;
/**
* The global default max number of annotation events per span.
*
* Generated from protobuf field <code>int64 max_number_of_timed_events = 5;</code>
*/
private $max_number_of_timed_events = 0;
/**
* The global default max number of attributes per timed event.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_timed_event = 6;</code>
*/
private $max_number_of_attributes_per_timed_event = 0;
/**
* The global default max number of link entries per span.
*
* Generated from protobuf field <code>int64 max_number_of_links = 7;</code>
*/
private $max_number_of_links = 0;
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_link = 8;</code>
*/
private $max_number_of_attributes_per_link = 0;
protected $sampler;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type \Opentelemetry\Proto\Trace\V1\ConstantSampler $constant_sampler
* @type \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased $trace_id_ratio_based
* @type \Opentelemetry\Proto\Trace\V1\RateLimitingSampler $rate_limiting_sampler
* @type int|string $max_number_of_attributes
* The global default max number of attributes per span.
* @type int|string $max_number_of_timed_events
* The global default max number of annotation events per span.
* @type int|string $max_number_of_attributes_per_timed_event
* The global default max number of attributes per timed event.
* @type int|string $max_number_of_links
* The global default max number of link entries per span.
* @type int|string $max_number_of_attributes_per_link
* The global default max number of attributes per span.
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce();
parent::__construct($data);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1;</code>
* @return \Opentelemetry\Proto\Trace\V1\ConstantSampler
*/
public function getConstantSampler()
{
return $this->readOneof(1);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.ConstantSampler constant_sampler = 1;</code>
* @param \Opentelemetry\Proto\Trace\V1\ConstantSampler $var
* @return $this
*/
public function setConstantSampler($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\ConstantSampler::class);
$this->writeOneof(1, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2;</code>
* @return \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased
*/
public function getTraceIdRatioBased()
{
return $this->readOneof(2);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.TraceIdRatioBased trace_id_ratio_based = 2;</code>
* @param \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased $var
* @return $this
*/
public function setTraceIdRatioBased($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\TraceIdRatioBased::class);
$this->writeOneof(2, $var);
return $this;
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3;</code>
* @return \Opentelemetry\Proto\Trace\V1\RateLimitingSampler
*/
public function getRateLimitingSampler()
{
return $this->readOneof(3);
}
/**
* Generated from protobuf field <code>.opentelemetry.proto.trace.v1.RateLimitingSampler rate_limiting_sampler = 3;</code>
* @param \Opentelemetry\Proto\Trace\V1\RateLimitingSampler $var
* @return $this
*/
public function setRateLimitingSampler($var)
{
GPBUtil::checkMessage($var, \Opentelemetry\Proto\Trace\V1\RateLimitingSampler::class);
$this->writeOneof(3, $var);
return $this;
}
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes = 4;</code>
* @return int|string
*/
public function getMaxNumberOfAttributes()
{
return $this->max_number_of_attributes;
}
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes = 4;</code>
* @param int|string $var
* @return $this
*/
public function setMaxNumberOfAttributes($var)
{
GPBUtil::checkInt64($var);
$this->max_number_of_attributes = $var;
return $this;
}
/**
* The global default max number of annotation events per span.
*
* Generated from protobuf field <code>int64 max_number_of_timed_events = 5;</code>
* @return int|string
*/
public function getMaxNumberOfTimedEvents()
{
return $this->max_number_of_timed_events;
}
/**
* The global default max number of annotation events per span.
*
* Generated from protobuf field <code>int64 max_number_of_timed_events = 5;</code>
* @param int|string $var
* @return $this
*/
public function setMaxNumberOfTimedEvents($var)
{
GPBUtil::checkInt64($var);
$this->max_number_of_timed_events = $var;
return $this;
}
/**
* The global default max number of attributes per timed event.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_timed_event = 6;</code>
* @return int|string
*/
public function getMaxNumberOfAttributesPerTimedEvent()
{
return $this->max_number_of_attributes_per_timed_event;
}
/**
* The global default max number of attributes per timed event.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_timed_event = 6;</code>
* @param int|string $var
* @return $this
*/
public function setMaxNumberOfAttributesPerTimedEvent($var)
{
GPBUtil::checkInt64($var);
$this->max_number_of_attributes_per_timed_event = $var;
return $this;
}
/**
* The global default max number of link entries per span.
*
* Generated from protobuf field <code>int64 max_number_of_links = 7;</code>
* @return int|string
*/
public function getMaxNumberOfLinks()
{
return $this->max_number_of_links;
}
/**
* The global default max number of link entries per span.
*
* Generated from protobuf field <code>int64 max_number_of_links = 7;</code>
* @param int|string $var
* @return $this
*/
public function setMaxNumberOfLinks($var)
{
GPBUtil::checkInt64($var);
$this->max_number_of_links = $var;
return $this;
}
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_link = 8;</code>
* @return int|string
*/
public function getMaxNumberOfAttributesPerLink()
{
return $this->max_number_of_attributes_per_link;
}
/**
* The global default max number of attributes per span.
*
* Generated from protobuf field <code>int64 max_number_of_attributes_per_link = 8;</code>
* @param int|string $var
* @return $this
*/
public function setMaxNumberOfAttributesPerLink($var)
{
GPBUtil::checkInt64($var);
$this->max_number_of_attributes_per_link = $var;
return $this;
}
/**
* @return string
*/
public function getSampler()
{
return $this->whichOneof("sampler");
}
}

View File

@ -0,0 +1,68 @@
<?php
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: opentelemetry/proto/trace/v1/trace_config.proto
namespace Opentelemetry\Proto\Trace\V1;
use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\RepeatedField;
use Google\Protobuf\Internal\GPBUtil;
/**
* Sampler that tries to uniformly sample traces with a given ratio.
* The ratio of sampling a trace is equal to that of the specified ratio.
*
* Generated from protobuf message <code>opentelemetry.proto.trace.v1.TraceIdRatioBased</code>
*/
class TraceIdRatioBased extends \Google\Protobuf\Internal\Message
{
/**
* The desired ratio of sampling. Must be within [0.0, 1.0].
*
* Generated from protobuf field <code>double samplingRatio = 1;</code>
*/
private $samplingRatio = 0.0;
/**
* Constructor.
*
* @param array $data {
* Optional. Data for populating the Message object.
*
* @type float $samplingRatio
* The desired ratio of sampling. Must be within [0.0, 1.0].
* }
*/
public function __construct($data = NULL) {
\GPBMetadata\Opentelemetry\Proto\Trace\V1\TraceConfig::initOnce();
parent::__construct($data);
}
/**
* The desired ratio of sampling. Must be within [0.0, 1.0].
*
* Generated from protobuf field <code>double samplingRatio = 1;</code>
* @return float
*/
public function getSamplingRatio()
{
return $this->samplingRatio;
}
/**
* The desired ratio of sampling. Must be within [0.0, 1.0].
*
* Generated from protobuf field <code>double samplingRatio = 1;</code>
* @param float $var
* @return $this
*/
public function setSamplingRatio($var)
{
GPBUtil::checkDouble($var);
$this->samplingRatio = $var;
return $this;
}
}

View File

@ -10,6 +10,7 @@
<ignoreFiles>
<directory name="var"/>
<directory name="vendor"/>
<directory name="proto"/>
<directory name="tests/TraceContext/W3CTestService"/>
</ignoreFiles>
</projectFiles>

View File

@ -0,0 +1,107 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Contrib\Unit;
use InvalidArgumentException;
use OpenTelemetry\Contrib\OtlpGrpc\Exporter;
use OpenTelemetry\Sdk\Resource\ResourceInfo;
use OpenTelemetry\Sdk\Trace\Attributes;
use OpenTelemetry\Sdk\Trace\Span;
use OpenTelemetry\Sdk\Trace\TracerProvider;
use PHPUnit\Framework\TestCase;
class OTLPGrpcExporterTest extends TestCase
{
/**
* @test
*/
public function testExporter()
{
$provider = new TracerProvider(
ResourceInfo::create(
new Attributes([
'service.name' => 'my-service',
])
)
);
$tracer = $provider->getTracer('io.opentelemetry.contrib.php');
$span = $tracer->startAndActivateSpan('test.otlp');
$span->setAttribute('attr1', 'val1')
->setAttribute('attr2', 'val1');
$foo = (new Exporter())->export([$span]);
$this->assertEquals(Exporter::FAILED_RETRYABLE, $foo);
}
public function testRefusesInvalidHeaders()
{
$foo = new Exporter('localhost:4317', true, '', 'a:bc');
$this->assertEquals([], $foo->getHeaders());
//$this->expectException(InvalidArgumentException::class);
}
public function testSetHeadersWithEnvironmentVariables()
{
putenv('OTEL_EXPORTER_OTLP_HEADERS=x-aaa=foo,x-bbb=barf');
$exporter = new Exporter();
$this->assertEquals(['x-aaa' => ['foo'], 'x-bbb' => ['barf']], $exporter->getHeaders());
putenv('OTEL_EXPORTER_OTLP_HEADERS'); // Clear the envvar or it breaks future tests
}
public function testSetHeadersInConstructor()
{
$exporter = new Exporter('localhost:4317', true, '', 'x-aaa=foo,x-bbb=bar');
$this->assertEquals(['x-aaa' => ['foo'], 'x-bbb' => ['bar']], $exporter->getHeaders());
$exporter->setHeader('key', 'value');
$this->assertEquals(['x-aaa' => ['foo'], 'x-bbb' => ['bar'], 'key' => ['value']], $exporter->getHeaders());
}
/**
* @test
*/
public function shouldBeOkToExporterEmptySpansCollection()
{
$this->assertEquals(
Exporter::SUCCESS,
(new Exporter('test.otlp'))->export([])
);
}
/**
* @test
*/
public function failsIfNotRunning()
{
$exporter = new Exporter('test.otlp');
$span = $this->createMock(Span::class);
$exporter->shutdown();
$this->assertEquals(\OpenTelemetry\Sdk\Trace\Exporter::FAILED_NOT_RETRYABLE, $exporter->export([$span]));
}
public function testHeadersShouldRefuseArray()
{
$headers = [
'key' => ['value'],
];
$this->expectException(InvalidArgumentException::class);
$headers_as_string = (new Exporter())->metadataFromHeaders($headers);
}
}

View File

@ -0,0 +1,247 @@
<?php
declare(strict_types=1);
namespace OpenTelemetry\Tests\Contrib\Unit;
use OpenTelemetry\Contrib\OtlpGrpc\SpanConverter;
use Opentelemetry\Proto\Trace\V1;
use Opentelemetry\Proto\Trace\V1\InstrumentationLibrarySpans;
use Opentelemetry\Proto\Trace\V1\ResourceSpans;
use OpenTelemetry\Sdk\Resource\ResourceInfo;
use OpenTelemetry\Sdk\Trace\Attribute;
use OpenTelemetry\Sdk\Trace\Attributes;
use OpenTelemetry\Sdk\Trace\Clock;
use OpenTelemetry\Sdk\Trace\Span;
use OpenTelemetry\Sdk\Trace\SpanContext;
use OpenTelemetry\Sdk\Trace\SpanStatus;
use OpenTelemetry\Sdk\Trace\TracerProvider;
use PHPUnit\Framework\TestCase;
class OTLPGrpcSpanConverterTest extends TestCase
{
/**
* @test
*/
public function shouldConvertASpanToAPayloadForOtlp()
{
$tracer = (new TracerProvider())->getTracer('OpenTelemetry.OtlpTest');
$timestamp = Clock::get()->timestamp();
/** @var Span $span */
$span = $tracer->startAndActivateSpan('guard.validate');
$span->setAttribute('service', 'guard');
$span->addEvent('validators.list', $timestamp, new Attributes(['job' => 'stage.updateTime']));
$span->end();
$converter = new SpanConverter();
$row = $converter->as_otlp_span($span);
$this->assertInstanceOf(V1\Span::class, $row);
$this->assertSame($span->getContext()->getSpanId(), bin2hex($row->getSpanId()));
$this->assertSame($span->getContext()->getTraceId(), bin2hex($row->getTraceId()));
$this->assertSame($span->getSpanName(), $row->getName());
// $this->assertIsInt($row['timestamp']);
// // timestamp should be in microseconds
// $this->assertGreaterThan(1e15, $row['timestamp']);
// $this->assertIsInt($row['duration']);
// $this->assertGreaterThan(0, $row['duration']);
// $this->assertCount(1, $row['tags']);
// /** @var Attribute $attribute */
// $attribute = $span->getAttribute('service');
// $this->assertEquals($attribute->getValue(), $row['tags']['service']);
// $this->assertCount(1, $row['annotations']);
// [$annotation] = $row['annotations'];
// $this->assertEquals('validators.list', $annotation['value']);
// [$event] = \iterator_to_array($span->getEvents());
// $this->assertIsInt($annotation['timestamp']);
// // timestamp should be in microseconds
// $this->assertGreaterThan(1e15, $annotation['timestamp']);
}
/**
* @test
*/
// public function durationShouldBeInMicroseconds()
// {
// $span = new Span('duration.test', SpanContext::generate());
// $row = (new SpanConverter('duration.test'))->as_otlp_span($span);
// $this->assertEquals(
// (int) (($span->getEnd() - $span->getStart()) / 1000),
// $row['duration']
// );
// }
/**
* @test
*/
public function tagsAreCoercedCorrectlyToStrings()
{
$span = new Span('tags.test', SpanContext::generate());
$listOfStrings = ['string-1','string-2'];
$listOfNumbers = [1,2,3,3.1415,42];
$listOfBooleans = [true,true,false,true];
$listOfRandoms = [true,[1,2,3],false,'string-1',3.1415];
$span->setAttribute('string', 'string');
$span->setAttribute('integer-1', 1024);
$span->setAttribute('integer-2', 0);
$span->setAttribute('float', '1.2345');
$span->setAttribute('boolean-1', true);
$span->setAttribute('boolean-2', false);
$span->setAttribute('list-of-strings', $listOfStrings);
$span->setAttribute('list-of-numbers', $listOfNumbers);
$span->setAttribute('list-of-booleans', $listOfBooleans);
$span->setAttribute('list-of-random', $listOfRandoms);
$converter = new SpanConverter();
$tags = $converter->as_otlp_span($span)->getAttributes();
// // Check that we can convert all attributes to tags
$this->assertCount(10, $tags);
// // Tags destined for Otlp must be pairs of strings
// foreach ($tags as $tagKey => $tagValue) {
// $this->assertIsString($tagKey);
// $this->assertIsString($tagValue);
// }
// $this->assertEquals($tags['string'], 'string');
// $this->assertEquals($tags['integer-1'], '1024');
// $this->assertEquals($tags['integer-2'], '0');
// $this->assertEquals($tags['float'], '1.2345');
// $this->assertEquals($tags['boolean-1'], 'true');
// $this->assertEquals($tags['boolean-2'], 'false');
// // Lists must be casted to strings and joined with a separator
// $this->assertEquals($tags['list-of-strings'], join(',', $listOfStrings));
// $this->assertEquals($tags['list-of-numbers'], join(',', $listOfNumbers));
// $this->assertEquals($tags['list-of-booleans'], 'true,true,false,true');
// // This currently works, but OpenTelemetry\Trace\Span should stop arrays
// // containing multiple value types from being passed to the Exporter.
// $this->assertEquals($tags['list-of-random'], 'true,1,2,3,false,string-1,3.1415');
}
public function testOtlpHappyPathSpan()
{
$start_time = 1617313804325769988;
$end_time = 1617313804325783095;
// Construct a comprehensive happy path Span in the SDK
$sdk = new Span(
'http_get',
new SpanContext(
bin2hex('0000000000000001'), // traceId
bin2hex('00000001'), // spanId
0, // traceFlags
),
null, // parentSpanContext
null, // sampler
ResourceInfo::create(
new Attributes([
'instance' => 'test-a',
])
)
);
// We have to set the time twice here due to the way PHP deals with Monotonic Clock and Realtime Clock.
$sdk->setStartEpochTimestamp($start_time);
$sdk->setStart(125464959232828);
$sdk->setAttribute('user', 'alice');
$sdk->setAttribute('authenticated', true);
$sdk->addEvent('Event1', 1617313804325769955, new Attributes(['success' => 'yes']));
$sdk->setSpanStatus(SpanStatus::OK);
$sdk->end(125464959245935);
// Construct the same span in OTLP to compare.
$expected = new ResourceSpans([
'resource' => new \Opentelemetry\Proto\Resource\V1\Resource([
'attributes' => [
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'telemetry.sdk.name',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'opentelemetry']),
]),
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'telemetry.sdk.language',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'php']),
]),
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'telemetry.sdk.version',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'dev']),
]),
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'instance',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'test-a']),
]),
],
]),
'instrumentation_library_spans' => [
new InstrumentationLibrarySpans([
'instrumentation_library' => new \Opentelemetry\Proto\Common\V1\InstrumentationLibrary([
// TODO: Fetch instrumentation library from TracerProvider
// 'name' => 'lib-a',
// 'version' => 'v0.1.0',
]),
'spans' => [
new V1\Span([
'trace_id' => '0000000000000001',
'span_id' => '00000001',
'name' => 'http_get',
'start_time_unix_nano' => $start_time,
'end_time_unix_nano' => $end_time,
'kind' => V1\Span\SpanKind::SPAN_KIND_INTERNAL,
'status' => new V1\Status([ 'code' => V1\Status\StatusCode::STATUS_CODE_OK ]),
'attributes' => [
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'user',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'alice']),
]),
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'authenticated',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'bool_value' => true]),
]),
],
'events' => [
new V1\Span\Event([
'name' => 'Event1',
'time_unix_nano' => 1617313804325769955,
'attributes' => [
new \Opentelemetry\Proto\Common\V1\KeyValue([
'key' => 'success',
'value' => new \Opentelemetry\Proto\Common\V1\AnyValue([ 'string_value' => 'yes']),
]),
],
]),
],
]),
],
]),
],
]);
$otlpspan = (new SpanConverter())->as_otlp_resource_span([$sdk]);
$this->assertEquals($expected, $otlpspan);
}
}